i have a problem with pwm's.i am using timer A and the total period is 80 and on times are 5%, 75% and 50%. i want to generate 3 different PWM's for same application.
Hold Watchdog
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
// Configure DCO to oscillate at 8MHz
BCSCTL1 = CALBC1_8MHZ; // Set DCO to 8MHz
DCOCTL = CALDCO_8MHZ;
// Configure Timer A for generating PWM with initialization values.
TA0CCR0 = 8*PWM_PERIOD_uS; // PWM Period
TA0CCTL1 = OUTMOD_7; // TA0CCR1 reset/set
TA0CCR1 = 1*PWM_INIT_ON_TIME_uS; // TA0CCR1 PWM duty cycle (Pin 23 i.e P1.2)
TA0CTL = TASSEL_2 + MC_1; // SMCLK, up mode
P1DIR|=0x0E;
P1SEL|=0x0C;
For 50% iam usig this
TA0CCR1 = 8*PWM_INIT_ON_TIME_uS; ; // TA0CCR1 PWM duty cycle 50%
BATTERY_CV_LIMIT=EQUILIZATIONBATTERYVOLTAGE;
For 75% iam usig this
TA0CCR1 =12 *PWM_INIT_ON_TIME_uS; ; // TA0CCR1 PWM duty cycle 50%
BATTERY_CV_LIMIT=EQUILIZATIONBATTERYVOLTAGE;
incremntal_conductance();
For 5% iam using this
TA0CCR1 = 1*PWM_INIT_ON_TIME_uS; ; // TA0CCR1 PWM duty cycle 50%
BATTERY_CV_LIMIT=EQUILIZATIONBATTERYVOLTAGE;
some times its happenning and some times its not hapening.give me some idea for this.is there any problem with oscillator selection or CCR1.