cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a very slow PWM frequency

RMira.2
Associate

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.

1 REPLY 1
gbm
Lead III

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.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice