Skip to main content
Visitor II
February 26, 2024
Question

Synchronizing 2 timers for PWM input ?

  • February 26, 2024
  • 1 reply
  • 1172 views

Hello,

Is there a way to synchronize 2 timers in PWM input so that the second timer will do the PWM input reading in sync (in phase) with the first (master) one ? I see that it is possible with PWM output but for PWM input the "trigger source" is grayed out in CubeIDE.

I'm using the H723ZG 144-Nucleo board.

Thank you, J.

    This topic has been closed for replies.

    1 reply

    Super User
    February 26, 2024

    That something is grayed out in CubeIDE means only that Cube/CubeMX/CubeIDE does not provide a clicking interface to it. It still may or may not be possible, and synchronization of two timers is definitively independent from their channels being set as input or output.

    In other words, if you cannot click something, then write it normally.

    On the other hand, if you intend to use what ST describes to be "PWM Input" (e.g. in RM under TIM subchapter of the same name) - and I suspect that's what results from clicking too - then each timer is reset by the leading edge of its input signal, so they will come out of sync anyway (unless the leading edges of the input signals are aligned, in which case there's no need for synchronization as it will happen through the synchronous reset anyway).

    JW

    jea74Author
    Visitor II
    March 5, 2024

    Thanks for this explanation - I reworked the code to be more "event driven" vs. the timers and it works.

    Jea