WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer
FLL_CTL0 |= XCAP18PF; // set load capacitance for 32k xtal
FLL_CTL1 = FLL_CTL1 & ~XT2OFF; // clear bit = high freq xtal on
do // loop until flag is clear
{
FLL_CTL0 = FLL_CTL0 & ~XT2OF; // clear high freq oscillator fault flag
for (i = 50000; i; i--); // delay for crystal to start and FLL to lock
}
while (FLL_CTL0 & XT2OF); // test high freq oscillator fault flag
// if flag remained clear then -
FLL_CTL1 = SELS; // switch SMCLK = HF xtal
P1DIR = 0x32; // P1.1, P1.4 & P1.5 to outputs
P1SEL = 0x32; // P1.1, P1.4 & P1.5 functions to output
// MCLK, SMCLK & ACLK
while(1); // loop in place
}