CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz
while (CLKCON & CLKCON_OSC); // Wait for change to take effect
SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc)
CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz
while (CLKCON & CLKCON_OSC); // Wait for change to take effect
SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc)