
    //----------------------------------------------------------------
    // Oscillator Configuration
    //----------------------------------------------------------------

    OSCXCN = 0x67;	// EXTERNAL Oscillator Control Register	
    for (n = 0; n < 255; n++) ;            // wait for osc to start
    while ( (OSCXCN & 0x80) == 0 );        // wait for xtal to stabilize

    OSCICN = 0x08;	// Internal Oscillator Control Register
