测试过标准库和lite库,外挂16M和24M晶振都试过,使用外部晶振作为pll时钟源,然后倍频到48M都会卡死,何解?参考demo的switch那个例子,切换到pll代码如下:
stcPLLCfg.enInFreq = SysctrlPllInFreq20_24MHz; //RCH 24MHz
stcPLLCfg.enOutFreq = SysctrlPllOutFreq36_48MHz; //PLL 输出48MHz
stcPLLCfg.enPllClkSrc = SysctrlPllXthXtal; //输入时钟源选择RCH
stcPLLCfg.enPllMul = SysctrlPllMul2; //24MHz x 2 = 48MHz
Sysctrl_SetPLLFreq(&stcPLLCfg);
Sysctrl_SetPLLStableTime(SysctrlPllStableCycle16384);
Sysctrl_ClkSourceEnable(SysctrlClkPLL, TRUE);
///< 时钟切换
Sysctrl_SysClkSwitch(SysctrlClkPLL); |