在這部分的控制,依照實際的經驗來看,最常遇到問題是以下幾點
- 更換 clock source
- 變更CPU clock
以下就利用 AN11027 來作解釋
先下載:
AN11027 Using the LPC1100 low power modes and wake-up times on the LPCXpresso
更換 clock source
從上圖右上方的 main clock 回頭來看,先看到的是 register :
MAINCLKSEL ,main clock source select
( bit1,bit0 ) - Clock source for main clock
( 0 , 0 ) - IRC oscillator
( 0 , 1 ) - Input clock to system PLL
( 1 , 0 ) - WDT oscillator
( 1 , 1 ) - System PLL clock out
case 'a': 中可見,選擇了 IRC
/* Switch MAINCLKSEL to IRC */
LPC_SYSCON->MAINCLKSEL = 0;
上述路徑如下圖

先略過 SYSTEM PLL這區塊,接著往上圖左下看
SYSPLLCLKSEL ,SYSTEM PLL clock source select
( bit1,bit0 ) - System PLL clock source
( 0 , 0 ) - IRC oscillator
( 0 , 1 ) - System oscillator
( 1 , 0 ) - Reserved
( 1 , 1 ) - Reserved
case 'b': 可見, MAINCLKSLE 選擇了 Input clock to system PLL
LPC_SYSCON->MAINCLKSEL = 1;
接著 SYSPLLCLKSEL 選擇 System oscillator
LPC_SYSCON->SYSPLLCLKSEL = 1;
上述路徑如下圖

CGU, Clock Generation Unit , 2 .....<待續>
0 留言:
張貼留言