IRC and XTAL - Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IRC and XTAL - Problem

471 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Mon Feb 23 11:01:15 MST 2015
Hello,

I am facing a problem regarding the clock configuration of my custom board. At the beginning I was using the internal IRC clock "Chip_SetupIrcClocking()"  and no problem occured. I changed the configuration to use an external clock of ~16M through XTAL1 "Chip_SetupXtalClocking()" and the micro seems not running properly. In order to know if the micro is working I have a LED that toggle at a fixed frequency.

When I am in Debug mode the micro works for both IRC configuration, XTAL configuration and IRC & XTAL configuration together. However, when I power reset my board and leave the micro run freely the LED does not toggle.

I confirm with an oscilloscope that the ~16M clock is in XTAL1 PIN.

The IRC must be always configured even if I use an external clock? Or I miss some configuration for an external clock?


My micro is the LPC4337 and I am using LPCOpen libraries.


Best Regards
Labels (1)
0 Kudos
4 Replies

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Thu Feb 26 02:26:04 MST 2015
Thanks xianghuiwang ;)

Regards
0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xianghuiwang on Wed Feb 25 12:16:57 MST 2015
Hi, Hugo,
The IRC is the default clock when the part comes out of reset. The application code needs to switch to external clock if so desired. To properly setup the PLL for the desired frequency, the frequency of the external clock needs to be provided to the application.
regards,
0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Feb 24 12:23:55 MST 2015
I change the value of "OscRateIn", from 0 to ~16M and now the micro is running. I thought that when I choose an external clock as reference, the micro will determine which frequency is applied.

That variable must reflect the clock frequency in XTAL1?
0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Feb 23 12:32:01 MST 2015

Please note if you based your code on an LPCOpen example, that you may be linking in a hardcoded value for the external oscillator. Search for 'OscRateIn' in the sysinit.c file.

Regards,
LPCXpresso Support
0 Kudos