AnsweredAssumed Answered

STM32F407VG: Using timers to count every pulses of an external clock during a specified time

Question asked by walid amehri on Jul 20, 2017
Latest reply on Jan 9, 2018 by asim khan

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)