我现在要用到内部128K和外部4M的陶瓷谐振器相互切换。
外部振荡器接到P50,P51口,怎么切近CLKCON没有反应呢(给CLKCON赋值赋不了)?
Enter_Bank0;
if(SwitchValue == HFOSC)
{
IR_Interrupt_First = 1;
#if SystemClk==1
CLKCON = 0x84;
while((CLKCON&0x10) != 0)
;
CLKCON |= 0x02;
#endif
#if SystemClk==2
CLKCON = 0xa4;
while((CLKCON&0x10) != 0)
;
CLKCON |= 0x02;
#endif
#if SystemClk==4
CLKCON = 0xc0;
while((CLKCON&0x10) != 0)
;
CLKCON |= 0x02;
#endif
}
else
{
CLKCON &= ~0x02; //FS = 0 Selection Low System Clock
NOP();
CLKCON &= ~0x04; //Off HFCLK
IR_Interrupt_First = 0;
} |