Skip to main content
ehmet
Visitor II
July 18, 2010
Question

Two shifted PWM

  • July 18, 2010
  • 3 replies
  • 668 views
Posted on July 18, 2010 at 18:55

Two shifted PWM

    This topic has been closed for replies.

    3 replies

    lowpowermcu
    Associate III
    May 17, 2011
    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,

    epassoni950
    Associate II
    May 17, 2011
    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

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

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

    John F.