cancel
Showing results for 
Search instead for 
Did you mean: 

Two shifted PWM

ehmet
Associate
Posted on July 18, 2010 at 18:55

Two shifted PWM

3 REPLIES 3
epassoni950
Associate II
Posted on May 17, 2011 at 13:59

Hello,

To obtain 2 PWM like your diagram, I think you must use 2 Timer. PWM2 is a standard PWM from TIM2 for example. PWM1 must use one-pulse mode (see documentation) from TIM3 for exemple. You must use a Timer synchronisation from TIM2 to TIM3 to start (trigger) TIM3 with a event on TIM2.

Another solution is to use the 2 Timer with a standard PWM and to program CNT register of a Timer with Period / 2 while CNT register of other Timer is 0. After that you must start the 2 Timer at the same time. Exactly at the same time is not possible but with a small assembly routine you can have the 2 STR instructions which write to the 2 CR1 registers very close to.

With Timer synchornisation, you can also use a third Timer only to start at the same time the 2 others Timers. For example, a trigger out from TIM4 can start TIM2 and TIM3.

Regards

Eric

lowpowermcu
Associate II
Posted on May 17, 2011 at 13:59

Hi tekin,

I can't understand your chronogram. Can you re-edit it to be clearer ?

MCU Lüfter,

John F.
Senior
Posted on May 17, 2011 at 13:59

Copy it into notepad and reformat font as Arial or Times New Roman.

John F.