2015-04-14 04: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 08: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 02: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 03: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.