Hi,
I am new to MSP430 series microcontroller. I am trying to do pulse width modulation. My code is as follows
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD;
TA1CCTL0 = 0x0040;
TA1CTL = 0x0110;
TA1CCR0 = 655;
TA1CCR1 = 327;
P2DIR |= 0x02;
P2SEL |= 0x02;
//TA1CTL = TASSEL_1 + MC_1 + TACLR;
__bis_SR_register(LPM3_bits);
// __no_operation();
}
MSP430F5438 counts up to 655 with no problem. I get 50Hz time period. The clock is 32KHz. The problem is that MSP is not taking the "TA1CCR1" value "327" into account. "327" suppose to give me 50% duty cycle. I am not able to control the Duty Cycle. The time period is correct 20msec but I have no control over Duty Cycle. Please advise!
jess