2022-04-10 08:36 AM
Hi,
I need to read a PWM that a rotating wheel generates (16 pulses per revolution) and I want to use one of the STM32F429 timers to do it. The problem is that the period goes from 7.8ms to infinite (no pulses), so I don't know what will happen if the timer overflows without receiving any pulse. Anything slower than 62.5s can be considered 0rpm.
Can I use the PWM function of the timer? Or I need to manually stop it once it reaches 62.5s of inactivity?
Thanks in advance,
Roger.
2022-04-10 08:45 AM
Don't count the pulses, measure their interval instead using the capture function of a timer. You may use 32-bit timer. Also, you may service the Update interrupt or check the timer Update flag in capture interrupt to detect overflow.