Reply by "yad...@yahoo.com [msp430]" July 23, 20142014-07-23
Hai everyone.

I am beginner in MSP430, I was watching MSP430 wprkshop videos from Texas Instruments.
I was following the steps and the code they explained in workshop in one code where they source clock from VLO and toggle led, I forgot to reset oscillator pending interrupt flag then led started blinking fastly can anyone explain me why.

Here is the code snippet.

#include

#ifndef TIMER0_A1_VECTOR
#define TIMER0_A1_VECTOR TIMERA1_VECTOR
#define TIMER0_A0_VECTOR TIMERA0_VECTOR
#endif

void main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

P1DIR = 0x40; //Configure P1.6 as output by writing 1 to corresponding pin
P1OUT = 0; //make output of that pin as zero

BCSCTL3 |= LFXT1S_2; //Configure basic clock system+ to use VLO
//IFG1 &= ~OFIFG; //I forgot to add this line in the code, Disabling Oscillator interrupt //pending flag then LED started blinking fastly
_bis_SR_register(SCG0+SCG1);
BCSCTL2 |= SELM_3 + DIVM_3;

while(1)
{
P1OUT = 0x40; // LED on
_delay_cycles(100);
P1OUT = 0; // LED off
_delay_cycles(5000);
}
}

Beginning Microcontrollers with the MSP430