Changing the clock frecuency for the LPC1227

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by fjrg76 on Wed Oct 31 01:25:57 MST 2012

I built a board of my own featuring the LPC1227 uC and it's using a 10 MHz crystal. This uC runs at 30 MHz, so with such a crystal I planned to achieve its maximum frecuency.

The CMSIS code, as is, only allows 12 MHz crystals, so I've needed to tweak the "system_LPC122x.c" file. After doing so I've just got the uC runs at 20 MHz:

//#define __XTAL                12000000
#define __XTAL                10000000
//#define SYSPLLCLKSEL_Val      0x00000000
#define SYSPLLCLKSEL_Val      0x00000001

Also, if I change this line:

#define SYSAHBCLKDIV_Val      0x00000001  // <-- 20 MHz

for this one:

#define SYSAHBCLKDIV_Val      0x00000002 // <-- 10 MHz

I get 10 MHz, so I'm pretty shure I need to change a constant so that the 10 MHz crystal frecuency is multiplied  three times, but I have no idea which one, any ideas?

Thank you!!