This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5510: Creating Phase Shifted PWMs on Different Timers

Part Number: MSP430F5510

Hi,

I need to produce 8 PWMs in msp430f5510. I can implement 4 PWMs on one Timer (Timer A0) in the micro controller but now need 4 more PWM outputs (phase shifted by 180 degrees with reference to those produced in TimerA0). The duty cycle on the PWM needs to be varied in the code also. I can't seem to figure out a way in which I can start the Timer B by 180 degree delay. Also the frequency of the PWM is constant and around 150 KHz. Any help would be appreciated. 

Thanks in advance!

  • Hi DS06,

    You can either stagger-start the timers, calculating and evaluating the delay involved between c/assembly instructions, or use a single timer ISR and handle the PWM logic of a single port (8 pins) accordingly. Either way you will probably need to operate the MCU frequency at 16 to 25 MHz to adjust and compensate for the timer frequencies required.

    Regard,
    Ryan
  • Hi Ryan,

    Thanks for the reply. I was thinking of switching on the Timer B in the interrupt generated by Timer A0 (CCIFG). According to the user manual the CCIFG (interrupt flag) is triggered at the exact midpoint of the timer period if timer is used in up/down configuration. Turning the Timer B on at that very instant should cause it to have a delay of a half switching period with respect to Timer A0. Do you think this idea would work? 

  • Hi DS06,

    This will work depending on the shift accuracy required by your application. There will be a brief delay associated with servicing the ISR and completing the instruction to turn on Timer B. But you definitely should be able to tune the timing accordingly to get within a few degrees of 180.

    Regards,
    Ryan

**Attention** This is a public forum