|
做的产品以前是用的外部的12M晶振,型号LPC1758,现在想用内部的振荡器提供时钟,按照手册改了时钟源: CLKSRCSEL = 0x01;(外部晶振) 改为0x00(内部),
但是还是不行。求解:
//把下边的四行都删掉了。。
SCS = (SCS & 0x04) | 0x20; /* Enable mainOSC,1MHz~20MHz */
while ((SCS & (1ul << 6)) == 0) {
}
CLKSRCSEL = 0x01; /* select main OSC as the PLL */
/* clock source */
PLL0CFG = (((PLL_NVALUE - 1) << 16) | (PLL_MVALUE - 1));
PLL0FEED = 0xAA; /* Enable but disconnect PLL */
PLL0FEED = 0x55;
PLL0CON = 1;
PLL0FEED = 0xAA; /* Enable but disconnect PLL */
PLL0FEED = 0x55;
while ((PLL0STAT & (1ul << 24)) == 0) {
}
CCLKCFG = (FCCO / FCCLK) - 1;
while (((PLL0STAT & (1ul << 26)) == 0)) { /* Check lock bit status */
}
while (((PLL0STAT & 0x00007FFF) != (PLL_MVALUE - 1)) &&
(((PLL0STAT & 0x00FF0000) >> 16) != (PLL_NVALUE - 1))) {
}
PLL0CON = 3; /* connect the PLL */
PLL0FEED = 0xAA;
PLL0FEED = 0x55;
while ((PLL0STAT & (1ul << 25)) == 0) { /* Wait until the PLL is */
}
/* connected and locked */ |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|