Hello gang again, I have a quick question for the experts here. I have a progam loop that is intended to run in a tight loop, checking 6 different flow pulses (the pulses come in at 330 per liter of water pumped) I am trying to determine if the program loop is 'quick' enough to catch the one channel that flows the highest, about 16 US Gal/min. I figure this is about 350 pulses per second, 3 ms per pulse cycle (say 1.5 ms between a 'high' and a 'low' signal). The other flows are much less, about 4 gpm, so maybe I'd suggest halving the 1.5 ms to 0.75ms to allow the program to count any one of the 6 channels. So can the program loop swing around in say 750us?
The main program loop does the main counting, every 2 seconds or so it does other things, so it will miss some counts while it is doing secondary tasks, but I can slow that to say every 10 seconds by increasing the loop counter trigger.
Not sure how to actually measure the time between program loops, is it the timer command? How do I measure the time without affecting the actual loop time?
Any usggestions on how I can optimse the code to run more eficianetly, other than offloading counting to another picaxe?
Thanks in advance! John
The main program loop does the main counting, every 2 seconds or so it does other things, so it will miss some counts while it is doing secondary tasks, but I can slow that to say every 10 seconds by increasing the loop counter trigger.
Not sure how to actually measure the time between program loops, is it the timer command? How do I measure the time without affecting the actual loop time?
Any usggestions on how I can optimse the code to run more eficianetly, other than offloading counting to another picaxe?
Thanks in advance! John
Attachments
-
18.5 KB Views: 18