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.

How to generate Two channel PWMs with one timer and two CCR in MSP430G2211

Other Parts Discussed in Thread: MSP430G2212

Hi:

    I want to generate two channel PWMs, but there have only one timer with two CCR.

    Please tell me how to do, thanks!

Fred

  • Hi Fred,

    why don't you use the MSP430G2212 instead? It has 3 CCR registers and can generate two PWM's. Pls notice that both PWM will have the same frequency (CCR0).

    Rgds
    aBUGSworstnightmare 

  • Hi aBUGSworstnightmare:

        The Part Number have been decided by the customer. So they want to gain two PWM's.

    Fred

  • It is possible to use two PWMs, but then you cannot freely choose the PWM frequency.

    To do so, you have to run the timer in continuous mode. The PWM frequency is then determined by the timer clock 65536. Then CCR0 can be used in set/reset or reset/set mode to provide a second PWM instead of controlling the PWM frequency.
    The resulting PWM frequency, however, is quite low. only 15.26Hz per 1MHz timer clock (244Hz maximum if the timer is clocked by 16MHz)
    The possible resolution, however, is incredible: you can set the PWM duty cycle in 15.26ppm steps. :)

**Attention** This is a public forum