Hi ,
I am working in MSP430F5335. In this to generate PWM with the requency of 50Khz and 87% duty cycle. i used the bsp code to generate this pwm. but i can't able to get the 87% of duty cycle. It gives only 84% or 5%. And also the first 3 pwm cycle shows different frequcy and different duty cycle. I have attached my logic analyzer out put and my code is below
include <msp430.h>
Pwm frequency as 50kHz, dutycycle 87%
int main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT2;
P1SEL |= BIT2;
TA0CCR0 = 20-1;
TA0CCTL1 = OUTMOD_7;
TA0CCR1 = 17;
TA0CTL = TASSEL_1 + MC_1 + TACLR;
while(1);
}
can any one guide me why this is happens
Thanks in advance