STM32 high accuracy frequency measurement
4.2
Enter capture mode can be used to measure the pulse width or frequency. STM32 timer, except TIM6, TIM7, others timers with input capture functions. STM32 input capture simply means that by detecting the edge of the signal on the TIMx_CHx, at the edge of signal hopping (like rising/falling edge) when the current timer value (TIMx_CNT) to store the channel to the corresponding capture/compare registers (TIMx_CCRx), and completing a capture. Can also be configured to capture triggers an interrupt when . such as/DMA for example: TIM5_CH1 we used to capture high level pulse width, that is, to set the input capture is a rising edge detection, recorded rising edge TIM5_CNT values. And then configure the capture signal falling edge of capture, when fall arrives, capture and record TIM5_CNT values at this time. Thus, difference between two TIM5_CNT that high level pulse width, TIM5 count frequency, we are aware of, so you can calculate the exact time of high level pulse