1,时钟配置代码如下::
void Clk_Init()
{
ubyte LcTemp;
ICS_C1|=ICS_C1_IRCLKEN_MASK; /* Enable the internal reference clock*/
ICS_C3= 0x90; /* Reference clock frequency = 31.25 KHz*/
LcTemp = ICS_C3;
while(LcTemp !=0x90)
{
ICS_C3= 0x90; /* Reference clock frequency = 31.25 KHz*/
LcTemp = ICS_C3;
}
while(!(ICS_S & ICS_S_LOCK_MASK)); /* Wait for PLL lock, now running at 40 MHz (1280 * 31.25Khz) */
ICS_C2|=ICS_C2_BDIV(1) ; /*BDIV=2, Bus clock = 20 MHz*/
ICS_S |= ICS_S_LOCK_MASK ; /* Clear Loss of lock sticky bit */
SIM_SOPT | = CLKOE; /*Bus clock output is enabled on PTC5*/
}
测试环境:5个样品测试环境一样。
PTC5 PIN无外接任何电路,测试BUS CLOCK分别是:19.2MHZ,20.3MHZ,20.1MHZ,19.3MHZ,20.3MHZ(测试仪器高精度),这款芯片全温度范围误差2%。
我想了解,怎样保证你输出时钟一致性??????
|