jeffjohnvol
04-19-2007, 12:25 AM
I have a need to count pulses and the time in between. I would be using the falling edge of the pulse, and plan on using the BS2px stamp. I don't care about the width of each pulse, just the time in between falling edges.
I don't believe I can't use the PULSIN command because the pulse width may be quite long, especially if the rotary position magnet finishes up on the sensor. I understand that the PULSIN is limited to 0.13 seconds maximum pulse width, and as the rotation starts slow I could miss several pulses.
I was considering putting a PAUSE 10 (or PAUSE 9) in the loop with counters to 0.01 second each loop. Then by checking the state, watch for a trailing edge. Testing on the PC should reveal how long each loop's processing takes and I may need to adjust my PAUSE value.
Does anyone see an issue with this, or is there a better way?
Thanks.
Jeff
I don't believe I can't use the PULSIN command because the pulse width may be quite long, especially if the rotary position magnet finishes up on the sensor. I understand that the PULSIN is limited to 0.13 seconds maximum pulse width, and as the rotation starts slow I could miss several pulses.
I was considering putting a PAUSE 10 (or PAUSE 9) in the loop with counters to 0.01 second each loop. Then by checking the state, watch for a trailing edge. Testing on the PC should reveal how long each loop's processing takes and I may need to adjust my PAUSE value.
Does anyone see an issue with this, or is there a better way?
Thanks.
Jeff