lpcware

Inconsistency in LPCOpen sysinit_15xx.c

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by miccio on Thu Sep 17 11:19:21 MST 2015
Hello everyone,

I wanted to write my own set of libraries so I looked into the LPCOpen file mentioned in the title and found this:

/* Setup PLL for main oscillator rate (FCLKIN = 12MHz) * 6 = 72MHz
   MSEL = 5 (this is pre-decremented), PSEL = 1 (for P = 2)
   FCLKOUT = FCLKIN * (MSEL + 1) = 12MHz * 6 = 72MHz
   FCCO = FCLKOUT * 2 * P = 72MHz * 2 * 2 = 288MHz (within FCCO range) */
Chip_Clock_SetupSystemPLL(5, 2);


However, the given values of MSEL and PSEL yield M=6, P=4, which result in a FCCO freq. of 562MHz (therefore beyond its boundaries) for input freq of 12MHz, regardless of it being sourced from the IRC or the XTAL.
That is, according to UM10736 page76, which actually suggests MSEL and PSEL values of 5 and 1 respectively.

How can the library functions work if their settings are wrong?

Outcomes