Hi,
I am trying to program 2 PWM channels on the msp430g2553 - both channels can use the same base frequency.
I tried the following code:
#include <msp430g2553.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x0C; // P1.2/TA0.1 and P1.3 output
P1SEL |= 0x0C; // P1.2 and P1.3 TA1/2 options
P2DIR |= 0x02; // P2.1/TA1.1 output
P2SEL |= 0x02; // P2.1 options
CCR0 = 1000-1; // PWM Period
CCTL1 = OUTMOD_7; // CCR1 reset/set
CCTL2 = OUTMOD_7; // CCR1 reset/set
CCR1 = 10; // CCR1 PWM duty cycle
CCR2 = 500;
TACTL = TASSEL_2 + MC_1; // SMCLK, up mode
_BIS_SR(CPUOFF); // Enter LPM0
}
However this did not generate a PWM signal on P2.1. Am I missing something?
Thank you.