Hi.
I am using LPC 824.
How to put 12 MHz of IRC oscillator into PLL and make 30 MHz CPU operating clock?
In MCUXpresso Config Tools, SYSPLL CLOCK = 24MHz seems to be able to
Can I use 30 MHz with the IRC oscillator?
Thank you.
MCUXpresso Config Toolsgenerate code for 24MHz
/*******************************************************************************
* Code for BOARD_BootClockRUN configuration
******************************************************************************/
void BOARD_BootClockRUN(void)
{
/*!< Set up the clock sources */
/*!< Set up IRC */
POWER_DisablePD(kPDRUNCFG_PD_IRC_OUT); /*!< Ensure IRC OUT is on */
POWER_DisablePD(kPDRUNCFG_PD_IRC); /*!< Ensure IRC is on */
CLOCK_Select(kSYSPLL_From_Irc); /*!< set IRC to pll select */
clock_sys_pll_t config;
config.src = kCLOCK_SysPllSrcIrc; /*!< set pll src */
config.targetFreq = 24000000U; /*!< set pll target freq */
CLOCK_InitSystemPll(&config); /*!< set parameters */
CLOCK_SetMainClkSrc(kCLOCK_MainClkSrcIrc); /*!< select irc for main clock */
CLOCK_Select(kCLKOUT_From_Irc); /*!< select IRC for CLKOUT */
CLOCK_SetCoreSysClkDiv(1U);
/*!< Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;
}
Solved! Go to Solution.
Hi jun yamada ,
With 12 MHz of IRC oscillator as input, It's not possible to set SYSPLL_CLOCK as 30M, because in LPC824 PLL, N_DIV value can not be set, it is locked as 1.
SYSPLL_CLOCK = clockin * M
so with clockin as 12M, we can only get SYSPLL_CLOCK as 12,24,36,48,60... ...
However, we can take use of SYSAHBCLKDIV to set system clock as 30M. see below:
system clock = clockin * M/SYSAHBCLKDIV = 12M * 5 / 2 =30M
This is very useful PLL configuration examples. I extracted from user manual for your reference.
For more information about LPC824 PLL, see LPC824 user manual, 5.7.4 System PLL functional description.
Have a great day,
Jun Zhang
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi jun yamada ,
With 12 MHz of IRC oscillator as input, It's not possible to set SYSPLL_CLOCK as 30M, because in LPC824 PLL, N_DIV value can not be set, it is locked as 1.
SYSPLL_CLOCK = clockin * M
so with clockin as 12M, we can only get SYSPLL_CLOCK as 12,24,36,48,60... ...
However, we can take use of SYSAHBCLKDIV to set system clock as 30M. see below:
system clock = clockin * M/SYSAHBCLKDIV = 12M * 5 / 2 =30M
This is very useful PLL configuration examples. I extracted from user manual for your reference.
For more information about LPC824 PLL, see LPC824 user manual, 5.7.4 System PLL functional description.
Have a great day,
Jun Zhang
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
OK.
You can do this with the MCUXpresso Config Tools.
I'll try.
Thank you very much.
You are welcome!