HI ,
I am new to MSP430 processor and TI CCS i am working on a DC DC converter, to implement a voltage control algorithm i need a 10 milli seconds timer interrupt based delay using TIMER0 of MSP430.
I am trying to use the example below which i found in sample codes.
WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1DIR |= BIT0; // P1.0 output TA0CCTL0 = CCIE; // CCR0 interrupt enabled TA0CCR0 = 50000; TA0CTL = TASSEL_2 + MC_1 + TACLR; // SMCLK, upmode, clear TAR __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, enable interrupts __no_operation(); // For debugger // Timer0 A0 interrupt service routine #pragma vector=TIMER0_A0_VECTOR __interrupt void TIMER0_A0_ISR(void) { P1OUT ^= BIT0; // Toggle P1.0 }
the above timer example is configured for 48 milliseconds interrupt approx but when i try to run the same code, I observed that timer interrupt rate is only 2 milliseconds instead of 48 milliseconds.
the source clock for the above code is SMCLK (DCO = 1.045MhZ). I think i need to tune the DCO ( digitally controlled oscillator) frequency. please suggest how to initialise timer0 and SMCLK accordingly to
achieve 10 milliseconds delay.
Thanks & Regards
Naveen Reddy