Skip to main content
Explorer
September 17, 2025
Question

Generate two 50% duty PWM signals with 90° phase shift using a single timer

  • September 17, 2025
  • 1 reply
  • 357 views

Hi everyone,
I’m trying to generate two PWM signals with 50% duty cycle and a 90° phase shift, to simulate an A/B type output.I managed to achieve this using two different timers and adjusting the compare values, but I’d like to know if it’s possible to do it with a single timer, specifically TIM1.
I noticed there are Asymmetric PWM1 and Asymmetric PWM2 modes, but I don’t really understand how they work and whether they can be used to get this kind of phase shift between two channels.
Has anyone tried something similar or knows how to configure TIM1 to produce two PWM outputs in quadrature (90° out of phase) without relying on a second timer?

 

Thanks!

    This topic has been closed for replies.

    1 reply

    Super User
    September 17, 2025

    A simple way is to use two outputs of a single timer in Toggle mode.

    Changing polarity in TIMx_CCER.CCxP then allows to simulate reversing direction of "rotation".

    JW