4 years, 8 months ago.

LPC824Max board to chip LPC824

I want to develop and test on LPC824max MBed board. After will load hex file to chip LPC824.

LPC824max runs with external xtal configured to 30 MHz. In my chip I want to run with IRC in 12 MHz.

Is this way correct ?

main () {
   MAINCLKSEL = 0 ;         / IRC oscilator
  MAINCLKEN   =  1 ;        / Update clock source
   SystemCoreClockUpdate();      /update all

   .... }

1 Answer

4 years, 8 months ago.

If your custom board does not have xtal on board, it will not work because clock source selector is initialized in the beginning of startup code. I suggest to use mbed-dev (source code) library rather than mbed (pre-build) library and edit the SystemInit() function in the system_LPC8xx.c file.


In fact I see now in LPC824max board that xtal Y1 is disconected by default. Running see that system is initialized with IRC ( SYSPLLCKLSEL = 0 / MAINCLKSEL = 3). So, I will do transfer to LPC824 chip without problem. In my Main() will setup the required system clock:

SYSAHBCLKDIV = 60;   //    set clock to  60/60 = 1 MHz by example
posted by Renato Ferreira 28 Jun 2019