I need two PWM outputs the are hardware operated so that there is no CPU overhead.
Device: MSP430F2112
Example code shown for P1.2. Not sure why P1.3 required?
The first one works fine:
{ WDTCTL
= WDTPW + WDTHOLD; // Stop WDT
// P1.2 PWM output (Uses timer0_A3)
P1DIR |= 0x0C; // P1.2 and P1.3 outputs
P1SEL |= 0x0C; //P1.2 and P1.3 TA0/1 options
CCR0
= 390-1; // PWM Period (2.63KHz)
CCTL1 = OUTMOD_7; // CCR1 reset/set
CCR1 = 70; // CCR1 PWM duty cycle
TACTL = TASSEL_2 + ID_0 + MC_1; // SMCLK, up mode
// How would I code a PWM output on pin P1.1?
// I assume I have to use timer1_A2?
_BIS_SR(CPUOFF); // Enter LPM0
}
Thanks.