lpcware

Bugreport: LPCOpen 2.08c for LPC15xx configures PLL incorrectly

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by barts on Tue Jun 02 23:00:08 MST 2015
Hello,

I recently played with the LPC1549 LPCXpresso board, creating an application with LPCOpen. I had problems with what seemed an inaccurate or instable CPU clock frequency. After investigating it turned out that there's something wrong in Chip_SetupXtalClocking() in sysiniit_15xx.c.

/* 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);


The comment states that the value 1 is passed as PSEL value, but the second argument of Chip_Clock_SetupSystemPLL() is actually 2 instead of 1. That causes the FCCO to be set at 576 MHz, way beyond the maximum of 320 MHz. Changing the argument to 1 fixed my problems.

Outcomes