7 years, 9 months ago.

LPC1549: Using Internal clock

Hello,

1) Do I have to make any changes in the mbed lib for it to use the external 12MHz crystal?

2) I want to avoid an external crystal. It may not be possible since my CAN bus can run at 500k freq. Correct?

3) If i use external crystal how can I be sure that the crystal is being used? Does the chip autoswitch between internal clock and external crystal?

4) I have created simplistic board without a crystal and have pushed a simple UART program and it doesnt seem to work. With external crystal it works

thanks a bunch

1 Answer

7 years, 9 months ago.

Hi,

Quote:

1) Do I have to make any changes in the mbed lib for it to use the external 12MHz crystal?

The clock setting for the device is in the CMSIS startup code which is in the pre-built binary of mbed library. So, you need to use either mbed-dev libray (online compiler), or offline compiler.

Quote:

2) I want to avoid an external crystal. It may not be possible since my CAN bus can run at 500k freq. Correct?

I don't have an answer for this question because it is device specific. You may ask NXP LPC comminity site: https://community.nxp.com/community/lpc

Quote:

3) If i use external crystal how can I be sure that the crystal is being used? Does the chip autoswitch between internal clock and external crystal?

I don't think the chip autosiwtch clock source. Please refer LPC15xx users manual (maybe in SYSCON).

Watarai-San

I see the following variables in system_LPC15XX.c

<<code>> <h> System Oscillator Control (SYSOSCCTRL) <o.0> BYPASS: System Oscillator Bypass Enable <i> If enabled then PLL input (sys_osc_clk) is fed <i> directly from XTALIN and XTALOUT pins.

SYSOSCCTRL_Val = 0 CHANGED TO BYPASS

<o.0..1> System PLL Clock Source Select (SYSPLLCLKSEL) <0=> IRC Oscillator <1=> Crystal Oscillator (SYSOSC)

  1. define SYSPLLCLKSEL_Val 0x00000000 CHANGED TO 0 TO USE IRC

MAINCLKSELA_Val =0 SET TO USE IRC MAINCLKSELB_Val=0 SET TO USE SELA

<<code>>

Are these the changes you are referring to these changes. We made this and its not working with these changes..

Need your help please

posted by Surendar S 04 Mar 2017

Hi,

I quickly tested the IRC for the LPC1549 and this worked with simple blinky and printf serial output. /media/uploads/MACRUM/system_lpc15xx.c

posted by Toyomasa Watarai 04 Mar 2017