Skip to main content
Visitor II
June 16, 2025
Question

count external pulses using timer for 6 channels :

  • June 16, 2025
  • 4 replies
  • 444 views

Hi Team,

Currently I am working with STM32U575ZIT6 SOC and I am using Timer for counting external clock pulses,

Below is my requirement :

1. I have a requirement to count external pulses using timer for 6 channels, All those channels are connected to spin rate of a physical system; a wind-turbine RPM or something similar.
2. The maximum frequency of the incoming signal To ensure the timer can handle it without missing counts is up to 100 kHz and probably closer to a max of 3600.
3. The counter will roll over and is expected to reset on reboot.
4. Also noticed that a single timer can support only one counting element to count its pulses, Can anyone suggest How I can add a support to count 6 external pulses coming from wind turbines ?

 

Thanks and Regards,
Ram Jan

    This topic has been closed for replies.

    4 replies

    ram_janaAuthor
    Visitor II
    June 16, 2025

    Requesting to share stm32 cube configurations and firmware... Thanks

    Super User
    June 16, 2025

    Use 6 different timers in external clock mode and hook up each channel to the ETR signal. The chip has enough of them.

    TDK_0-1750080891742.png

     

    Technical Moderator
    June 16, 2025

    Hello @ram_jana 

    You can use external clock mode as suggested by @TDK  or configure the timer in input capture mode. 

    Please check the example below: 

    STM32CubeU5/Projects/NUCLEO-U575ZI-Q/Examples/TIM/TIM_InputCapture at main · STMicroelectronics/STM32CubeU5 · GitHub

    ram_janaAuthor
    Visitor II
    June 16, 2025

    Hi Saket_Om,

    The custom board is already designed, so I can't use the ETR method to connect to a specific pin. Could you please share the firmware using the Input Capture method with Timer 3 and Timer 4?

    Technical Moderator
    June 16, 2025

    Hello @ram_jana 

    I shared the example, you can use it as reference and update it to use TIM3 and TIM4.