Showing results for 
Search instead for 
Did you mean: 

TIM1 counting pulse from input signal help

Associate II

Hello, I currently have a test bench project to carry out, so it's a drive motor that turns another motor, which generates an FCEM signal on my 3 phases, but the duration of the signal depends on the speed at which I'm turning, so I'd like to use timer 1 on the STM32F103C8T6 to count the number of pulses between 2 rising edges, if you could help me. I'm using an rx tx link to have a master and a slave, the master at a frequency of 93.5 kHz on the cpu and I'd like to know if it's possible to count the number of pulses from my 3 phases at 72 MHz. If you could help me please thank you.


 i changed spi to usuart


So perhaps External Clock mode to make the TIM count, and then Input Capture or Input PWM Capture on the CCRx from a CHx input? For Period or Period and Duty

With Input Prescale you could count between 1, 2, 4 or 8 input pulses to improve resolution.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..