WDTCTL = WDTPW | WDTHOLD;
P4OUT = 0;
P4DIR = BIT4; // For P4.4 test output
P3SEL0 |= BIT4; // Output SMCLK as a test
P3SEL1 |= BIT4;
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
//CSCTL1 = DCOFSEL_6; // Set DCO to 8MHz
CSCTL2 = SELS__HFXTCLK | SELM__HFXTCLK; // Set SMCLK and MCLK to 8Mhz Crystal
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
CSCTL4 |= HFXTDRIVE_3;
CSCTL4 &= ~(HFXTOFF);
do
{
CSCTL5 &= ~(HFXTOFFG); // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
}while (SFRIFG1&OFIFG); // Test oscillator fault flag
CSCTL0_H = 0; // Lock CS registers
P4OUT ^= BIT4; // Toggle LED P4.4 at the rate of MCLK (8Mhz minus the instruction cycles) Note: Here I see only 500Khz toggle, I expected around 4Mhz or faster.
//__delay_cycles(8000000); // Wait 8,000,000 CPU Cycles
}