Hi,
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P11DIR = BIT1+BIT2+BIT0; // P11.1-2 to output direction
P11SEL |= BIT1+BIT2+BIT0; // P11.1-2 to output SMCLK,MCLK
P5SEL |= 0x0C; // Port select XT2
UCSCTL6 &= ~XT2OFF;
UCSCTL3 |= SELREF_2;
UCSCTL4 |= SELA_2;
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);
SFRIFG1 &= ~OFIFG;
}while (SFRIFG1&OFIFG);
UCSCTL6 &= ~XT2DRIVE0;
UCSCTL4 |= SELS_5 + SELM_5;
while(1);
}
This is my code for set External crystal (XT2=12MHZ) ,here i debug the code the external crystal is perfectly work.
But switch off the board and on(reset) the Clock goes to 1MHZ .
What the reason for this one problem?