Visitor II
July 20, 2017
Question
STM32F407VG: Using timers to count every pulses of an external clock during a specified time
- July 20, 2017
- 1 reply
- 563 views
Posted on July 20, 2017 at 16:12
I am working on a project to count the pulses of an external signal, I am using TIM2 to count every pulses of the signal and the TIM4 to set the duration of counting.
For example : I have an external signal with a Frequency of 10 kHz, and I want to count the pulses for a duration of 10 ms (rationnally it must be 100 pulses in 10ms).
The questions is : How do I configure my TIM4 in order to set the duration of counting for TIM2 ??
I developped the code shown below but it did not work (main.c)
#pulse-counter #stm32f4-discovery #stm32f4-timer