I'm using an MSP430F5529 board and CCS to program it for this problem. My code is as follows:
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; //stop watchdog timer
P1SEL |= BIT0; //configure P1.0 as TA0.1
P1DIR |= BIT0; //P1.0 is output (compare mode)
P4SEL |= BIT7; //configure P4.7 as TA0.2
P4DIR |= BIT7; //P4.7 is output (compare mode)
TA0CCR0 = 999; //CCR0 is used to generate the desired period
TA0CCR1 = 749; //CCR1 is used to generate 0.25 duty cycle
TA0CCR2 = 249; //CCR2 is used to generate 0.75 duty cycle
TA0CCTL1 = OUTMOD_7; //PWM 1
TA0CCTL2 = OUTMOD_7; //PWM 2
TA0CTL = MC_1 + TASSEL_2 + TACLR|ID_3;
_BIS_SR(LPM0_bits+GIE);
while(TA0CCTL2 == 1)
{
P4OUT ^= BIT7;
if(TA0CCTL1 == 1)
{
P1OUT ^= BIT0;
}
}
}
This code only results in the LED on pin 1.0 to illuminate, it does not blink and the LED on pin 4.7 doesn't even turn on.