Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set cpu frequency based on F_CPU / board_build.f_cpu #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions system/CMSIS/system/system_LPC17xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,15 +559,17 @@ void SystemInit (void)

LPC_SC->CCLKCFG = 0x00000002; /* Setup CPU Clock Divider */

if(isLPC1769()) {
LPC_SC->PLL0CFG = 0x0000000E; /* configure PLL0 */
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
} else {
LPC_SC->PLL0CFG = 0x00010018; // 100MHz
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
}
#if F_CPU == 96000000
LPC_SC->PLL0CFG = 0x0000000B; /* configure PLL0 */
#elif F_CPU == 100000000
LPC_SC->PLL0CFG = 0x00010018;
#elif F_CPU == 120000000 && MCU_LPC1769
LPC_SC->PLL0CFG = 0x0000000E;
#else
#error "The configured cpu frequency is not supported"
#endif
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;

LPC_SC->PLL0CON = 0x01; /* PLL0 Enable */
LPC_SC->PLL0FEED = 0xAA;
Expand Down