#include <msp430x14x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P4DIR |= 0x7e; // P4.1 - P4.6 output
P4SEL |= 0x7e; // P4.1 - P4.6 TBx options
TBCCR0 = 512-1; // PWM Period
TBCCTL1 = OUTMOD_7; // CCR1 reset/set
TBCCR1 = 384; // CCR1 PWM duty cycle
TBCCTL2 = OUTMOD_7;
TBCCR2 = 128;
TBCCTL3 = OUTMOD_7;
TBCCR3 = 64;
TBCCTL4 = OUTMOD_7;
TBCCR4 = 32;
TBCCTL5 = OUTMOD_7;
TBCCR5 = 16;
TBCCTL6 = OUTMOD_7;
TBCCR6 = 8;
TBCTL = TBSSEL_2 + MC_1; // SMCLK, up mode
_BIS_SR(CPUOFF); // Enter LPM0
} |