//外部晶振
void Clock_Init( void )
{
uchar temp_stabset, temp_stabwait;
OSTS = 0x05;
OSCCTL = 0x40|0x01;
MSTOP = 0;
temp_stabset = 0x1f;
do{
temp_stabwait = OSTC;
temp_stabwait &= temp_stabset;
}while(temp_stabwait != temp_stabset);
MCM = 0x05;
RSTOP = 1;
XTSTART = 0;
PCC &= (uchar)~(0x07 | 0x10);
PCC |= 0x01;
LSRSTOP = 0;
}
//内部晶振
void Clock_Init( void )
{
OSCCTL = 0x00;
MSTOP = 1;
RSTOP = 0;
MCM = 0x00;
XTSTART = 0;
PCC &= (uchar)~(0x07 | 0x10);
PCC |= 0x01;
LSRSTOP = 0;
}