2015-04-14 4:47 AM
I have setup a timer in PWM input mode. It all works well. I have setup the prescaler and period counter so I can measure down to 10 Hz. But if the input frequency is too low (< 10 Hz) the timer will wrap around.
If I read the capture values I will calculate the wrong frequency.Or can the timer be set to not wrap around?PWM input mode2015-04-14 8:01 AM
Use a 32-bit timer if your unspecified part has one. Consider master/slaving a pair of 16-bit counters. Consider if you can use an update interrupt, or a 32-bit free running timebase, or 1ms ticker, to invalidate measurements over too long a period.
2015-04-14 2:53 PM
It is a STM32F437ZI, The timer pins is already defined. The timers I use are 16-bit timers.
How would an update interrupt help? In what way could I use that?2015-04-14 3:38 PM
Well I'd imagine you could use Update, or a threshold via CCR3/CC3 to catch the situations where the measurement is invalid, or timed out.
Depending on if you can live with loss of resolution, you could also increase the prescaler.We’re moving the ST Community to a new platform to give you a better and more reliable community experience.