库版本MS51_Series_BSP_Keil_V1.00.004
sys.c文件
void ClockSwitch(unsigned char u8FsysMode)
{
SFRS = 0 ;
BIT_TMP=EA;EA=0;
switch (u8FsysMode)
{
/***** HIRC Disable part ******/
case FSYS_HIRC:
clr_CKSWT_OSC1;
clr_CKSWT_OSC0;
break;
/***** LIRC Disable part******/
case FSYS_LIRC:
set_CKSWT_OSC1;
clr_CKSWT_OSC0;
break;
/***** ECLK P30 Disable part ******/
case FSYS_OSCIN_P30:
set_CKSWT_ECLKST;//手册描述的ECLKST外部时钟状态位是只读的,这里居然是写1
break;
}
EA = BIT_TMP;
}
把
set_CKSWT_ECLKST;
改成
clr_CKSWT_OSC1;//
set_CKSWT_OSC0;//
就正常了。 |