KEA128的片子,我采用的是8M的外部晶振 想得到20Mhz的总线频率,通过下面的设置,发现晶振无法输出我想要的频率,求专家解决!
OSC_CR = 0x96; // high-range, high-gain oscillator selected
while ((OSC_CR & OSC_CR_OSCINIT_MASK) == 0); // wait until oscillator is ready
ICS_C2 = 0x20; // BDIV=divide by 2 – use default until clock dividers configured
ICS_C1 = 0x18; // 8MHz external reference clock/256 as source to FLL
while ((ICS_S & ICS_S_IREFST_MASK) == 1); // wait for external source selected
while ((ICS_S & ICS_S_LOCK_MASK) == 0); // wait for FLL to lock
SIM_CLKDIV = 0x01100000; // core clock = ICSOUT/1 and bus clock = core clock/2
ICS_C2 = 0x00; // BDIV=divide by 1 – allows max core and bus clock frequencies |