c8051f120,设置PLL参考时钟源为外部振荡器(32.768k),倍频到8M多,单步调试发现pll没法锁定,换内部振荡器(6.125M)ok,外部振荡器选择太低?谢谢。
void Oscillator_Init()
{
int i = 0;
SFRPAGE = CONFIG_PAGE;
OSCXCN = 0x61;
for (i = 0; i < 3000; i++); // Wait 1ms for initialization
while ((OSCXCN & 0x80) == 0);
OSCICN = 0x81;
PLL0CN = 0x04;
PLL0CN |= 0x01;
PLL0DIV = 0x01;
PLL0MUL = 0xFF;
for (i = 0; i < 15; i++); // Wait 5us for initialization
PLL0CN |= 0x02;
while ((PLL0CN & 0x10) == 0);////单步调试一直过不去
CLKSEL = 0x02;
OSCICN &= ~0x80;
}
|