Skip to main content
Visitor II
February 12, 2024
Question

TIM1 counting pulse from input signal help

  • February 12, 2024
  • 1 reply
  • 1451 views

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.

spislave.png

i changed spi to usuart

    This topic has been closed for replies.

    1 reply

    Graduate II
    February 12, 2024

    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.