|
//----------------------------------------------------------------
// Oscillator Configuration
//----------------------------------------------------------------SFRPAGE = 0x00;
FLSCL = 0x30; // FLASH Memory Control
SFRPAGE = 0x0F;
OSCXCN = 0x67; // EXTERNAL Oscillator Control Register
for (n = 0; n < 383; n++) ; // wait for osc to start
while ( (OSCXCN & 0x80) == 0 ); // wait for xtal to stabilize
PLL0DIV = 0x01; // PLL pre-divide Register
PLL0MUL = 4; // PLL Clock scaler Register
PLL0FLT = 0x0F; // PLL Filter Register
PLL0CN = 0x05; // PLL Control Register
for(b = 0; b < 15; b++); // wait at least 5us
PLL0CN |= 0x02; // enable PLL
while ( (PLL0CN & 0x10) == 0 ); // wait for PLL to lockCLKSEL = 0x02; // Oscillator Clock Selector
OSCICN = 0x00; // Internal Oscillator Control Register
E-mail: info@telesys.ru