Yet another counter question......
Mickster
Posts: 2,693
in Propeller 1
I believe the answer will be "no" but just double-checking:
Whilst counting pulses, if I kill a high-order bit in the counter's register, to avoid rollover, would that in any way interrupt the pulse count? IOW, could I lose pulses?
Whilst counting pulses, if I kill a high-order bit in the counter's register, to avoid rollover, would that in any way interrupt the pulse count? IOW, could I lose pulses?
Comments
You can write every value into the register, not sure why you think it gets cleared.
For the rollover you want avoid, we need a bit more info what you want to do. Normally you can just read the PHSx register and subtract it from the previous read value to get no rollovers.
Andy
Bean
You could measure this aperture, by running two timers, one where you clear upper bits (RMW) and one free-running, and then compare the LSBs.
-Phil
In my case, the difference will never be greater than, say, 1,000,000 between the two registers so I was thinking that I could watch for bit 22 (or greater) being high on both registers and simply reset them. This, apparently is not a good idea because I don't want to risk losing pulses at all. So I guess I need to handle rollover some way.
the difference will simply be correct at all times.
LOL, that simple fact didn't REGISTER with me, seemed so COUNTER intuitive....thanks!