Skip to main content
Associate
August 4, 2026
Question

Phase shifted full brige PWM with STM32G0B1CBT6 using tim1 ( ch1 & ch2)

  • August 4, 2026
  • 3 replies
  • 79 views

I’m trying to Generate 4 PWM for my rectifier circuit so my right leg is of tim1 ch1 and tim1ch1N and my left leg  is of tim1ch2 and tim2ch1N , what i want to achieve is i want 50% duty with phase shift between my leg1 and leg2 i saw many examples with OC mode , with different timers but i need it in the same tim1 only this are my pin outs 

 

3 replies

waclawek.jan
Super User
August 6, 2026

One way to achieve 50% duty is to use the Toggle mode (instead of PWM mode), at twice the timer overflow frequency (i.e. half TIMx_ARR value). Mutual difference of initial TIMx_CCRx values then determine the phase shift. This is probably your only option with the current hardware setup.

The TIM1 in ‘G0B1 is capable of Combined PWM mode which can be used for phase-shifted PWM, but for that you’d need to use channels from different pairs CH1-CH2 and CH3-CH4, e.g. CH1 and CH3. Read the Combined PWM subchapter of TIM chapter in RM.

JW

saravanaAuthor
Associate
August 7, 2026

I saw some examples with OC mode, but dont know exactly how to use the same lets say if the pin is in different timers i can abe to achieve it , but with tim1 CH1 and CH2 exactly dont know how to implement it

waclawek.jan
Super User
August 7, 2026

You may want to start from existing examples which are using TIM1, and experiment around them, while also reading the documentation.

The particular pins used, are chosen within the GPIO module.

JW