2015-02-02 05:20 PM
Hello,
I am endeavoring (as with every hair-pulling experience with the STM32F4) to measure/capture LOW frequency pulses. For this, I'm assuming I need to use a 32 bit timer: TIM2 or TIM5. This is a bit of a dilemma since TIM2 or TIM5 do not have a capture compare. So how to measure low frequency pulses? Thank you.... #stm32f4-timer-capture-compare2015-02-03 03:53 PM
Regarding your suggestion, about delta measurements, you said to take 2 of them and subtract (2nd - 1st) But separated by what interval of time?
Two edges of your input signal, it's what the states in your pasted code do, but trying to bring some clarity. The whole bigger/smaller code is a jumble, for 16-bit and 32-bit unsigned you can just let the processor do the math, the wrapping of the arithmetic will handle the wrapping of the counter.2015-02-03 04:04 PM
Ok - I thought you were referring to something different than what was in the function pasted.
I'm actually using the function to read a signal that's more like a sine wave, periodic in nature. It seems to capture good, considering the signal. I may end up buffering through a Scmitt trigger to give it more of a pulse, but for now it should work. I found that changing the filter from 0x0 to 0xf made some difference, depending on the amplitude of the signal. I'll need to read on that to see exactly what it does and what kind of signals it is designed for. thanks clive1.2015-02-03 04:17 PM