Showing results for 
Search instead for 
Did you mean: 

Synchronizing 2 timers for PWM input ?

Associate III


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.


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).


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