PWMPal - Count and Reset
Martin Hebel
Posts: 1,239
Is there a way to read and reset·a counter of the PWM without losing any counts?
Thanks,
Martin
·
Thanks,
Martin
·
Comments
Talking to myself... it happens sometimes...
-MH
What resolution are you looking for?
If the frequency of the pwm is 1000 hz, is 1 ms resolution ok?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I'm not trying to generate PWM, simply read a count from an external signal·(the PWMPal does more than PWM).
Jon,
Thanks for listening, but not much more to say on the subject if it doesn't already do it.· The need of course is apparent if I'm trying to track total pulses, which could be as high as 1000 pulses per minute.· Reading then clearing with a seperate instruction·100 or so mSec later would result in the lost of several (or more)·counts.· I could allow it to accumulate, but at that rate the·count would overflow fairly quickly.· Even if it was a slow count, missing one during that time may have a negative impact on system control or monitoring.· Of course·there's never assurance that one won't be missed, even when reset at the·machine code level after immediately buffering the count for transmission, but chances are much less during that couple microseconds than the 100 mSec it takes·for the BASIC Stamp to send and receive the serial·data, plus intrepreter time.
The PWMPal is a cool device, just needs a few tweaks [noparse]:)[/noparse]
Thanks,
Martin
Regards,
Al Williams
AWC
http://www.awce.com