Hello,
I have two sensors of 220Hz and I need timing even more fast/precise than that. I am writing my first CRBasic program, how do I continuously scan? The instruction I've seen is Scan/Next Scan but the fastest scan is in milliseconds. I would like something which continuously scans as fast as the processor can run so I can pick up the edges. I am using the instruction TimerInput to read the digital PWM from my sensors. Or is TimerInput implemented with interrupts?
TimerInput is handled by a coprocessor. So, it can measure frequencies faster than your scan rate.
Hi JDavis
Thanks for your response, that makes sense. A followup question I have, which is related, is the repetition of the TimerInput instruction.
The way I envision TimerInput working is it running continuously: at every edge the time is written to storage. For my application this should be 220 edges/second, running and writing data for hours.
However, the documentation doesn't indicate this. The way I interpret the documentation is that the 'Dest' parameter is a 1D array, meaning only one measurement is written to it, once, then the instruction is terminated.
How do I get this instruction to write continuously to a 2D array? I don't think I can do it by running lots of scans and repeating every scan, because scans are every 1mS but this has to run more frequently than that.
Many thanks