cancel
Showing results for 
Search instead for 
Did you mean: 

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

walid amehri
Associate
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
1 REPLY 1
asim khan
Associate III
Posted on January 09, 2018 at 09:51

Hi walid

Have you found some solution to your problem.?.i am  interfacing tcs3200 color sensor with stm32f746zg

and i have to count pulses to determine the color of an object..i am having the same problem as you did..so if you have found some solution ,please share.thanks