Does the Master uP send data on an 18.5ms interval, or a 17ms interval?
I’m using MPLAB, and looking at the VexCode.zip download. A comment in main.c:main() says 18.5ms but a comment in user_routines.c:Process_Data_From_Master_uP() says 17ms.
Is this a highly stable interval, or is it “jittery”? I want to sample some data periodically, and I’d like the intervals to be similar (say, within 10%). Will Process_Data_From_Master_uP() be called with this kind of regularity, or must I set up my own timer?
From the 2004 “mini IFI” controller, this period is pretty jittery, but accurate enough for rough timing uses, if your total code execution isnt too long. Depending on your resolution and accuracy required, may be better to use timers and interrupts. There are quite a lot of sample code around and when done properly, you get to have your interrupt triggered at fixed rates.
Thanks for the info - I’ve been digging around and experimenting quite a lot since I posted that, and I think I’ve got everything sorted out.
I’m going to be logging data that is collected on a periodic basis, and some of that data is from shaft encoders to track RPM. If the sample period varies wildly, then the pulse counts from each period will be too uneven. I need the sample periods to be fairly even so that I don’t have to smooth the resulting data too much.