程式設定如下,但CPUCLK一直維持在24MHZ,PLL沒有倍頻輸出
main (void)
{
uint32_t delayCnt;
UNLOCKREG();
SYSCLK->PWRCON.XTL12M_EN = 1; // 24MHZ External X'TAL
SYSCLK->PWRCON.OSC22M_EN = 1;
SYSCLK->PWRCON.OSC10K_EN = 1;
SYSCLK->PWRCON.XTL32K_EN = 1;
for (delayCnt=0;delayCnt<100000;delayCnt++); // Delay for clock stable
SYSCLK->CLKSEL0.HCLK_S = 0x010; // HCLK clock source = PLL clock
SYSCLK->PLLCON.PLL_SRC = 0;
SYSCLK->PLLCON.OE = 0;
SYSCLK->PLLCON.BP = 0;
SYSCLK->PLLCON.PD = 0;
SYSCLK->PLLCON.OUT_DV = 3; // NO = 4
SYSCLK->PLLCON.IN_DV = 1; // NR = 3
SYSCLK->PLLCON.FB_DV = 22; // NF = 24
// PLLFOUT = FIN * NF/NR * 1/NO
// = 24MHZ * 24/3 * 1/4 = 48MHZ
LOCKREG();
|