Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 6 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 ?
<<CODE>> main () { MAINCLKSEL = 0 ; / IRC oscilator MAINCLKEN = 1 ; / Update clock source SystemCoreClockUpdate(); /update all .... } <</CODE>>
1 Answer
5 years, 6 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:
<<CODE>> SYSAHBCLKDIV = 60; // set clock to 60/60 = 1 MHz by example SystemCoreClockUpdate(); <</CODE>>posted by 28 Jun 2019