cancel
Showing results for 
Search instead for 
Did you mean: 

I am using STM32F103RGT controller. I want to use the PWM-CH and PWM CHN complementary pwm in my application. I have created 4 PWMs 2 complementary each others. but I could not able make the phase shift.

DSaha.3
Associate II

Dear Team,

I want to use the 4 pwms for the phase shifted full bridge application. But I am unable to generate phase shifted pwms. Request to guide how to configure and used the PWMs with phase shifted pwm waveforms from the microcontroller...

7 REPLIES 7
TDK
Guru

You can't apply an arbitrary phase shift between channels within the same timer. You can do 180 degrees out of phase, or in-phase.

There are some possibilities with advanced timer features like break time which can sort of phase shift things, but not in an arbitrary manner.

You could use two different timers to do phase shift by starting them from different counter values.

If you feel a post has answered your question, please click "Accept as Solution".

Hello TDK,

Thanks for your reply. I also understand the same that with same timer it is not possible to make. Can you please share the example that how can I used other timer creating phase shift between two pwm pulses. This will help me to understand how can be implemented.

Regards,

Dnyanesh

I'm not going to write code for it, but one idea would be to have one timer in gated slave mode, and the other master timer driving it, then start them from different CNT values. The CNT value could also be modified on the fly but this makes it harder to synchronize the two exactly.

If you feel a post has answered your question, please click "Accept as Solution".

Please can you share the details how can be the PWM timer configuration and additional process logic for phase shift.

Regards,

Dnyanesh

Do you need arbitrary phase shift ? Or some specific case ?

You can align one output to "left" and another output to "right". Also you can use "center aligned" PWM to realize some "shifted" PWMs. Next you can generate PWMs by two timer, started with arbitrary phase shift (like TDK wrotes). And with some STMs (STM32F334, STM32H7xx) you can use "high resolution timer" with very flexible outputs. That one can truly realize "phase shifted" PWMs.

Can you elaborate more on the configuration side.

I need a waveform like attached image. I want to control DC-DC converter Full bridge with phase shifted topology.

If you know the specific configuration please share with me.

Regards,

Dnyanesh

Read the Timer synchronization and Timers and external trigger synchronization subchapters of TIM chapter in RM0008, together with description of TIMx_SMCR (for slave) and TIMx_CR2 (for master) registers.

JW