Changing the main frequency clock

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

Changing the main frequency clock

655 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Tue Jul 28 22:48:54 MST 2015
Hi,

The LPC812-Max board works at 24 MHz. But what if I want to make it work slower (using the IRC) or at its max freq, say 30 MHz using a 10 MHz external crystal?

There are not clear ways to change the 24 MHz freq. I have followed the function calls chain and I couldn't see a single one that receives a parameter indicating not only the external crystal freq, but also a PLL multiplier. In other words, the 24 MHz freq seems to be fixed.

A design I'm working on is supposed to use a 10 MHz crystal (we bought hundreds of them  :p ) in order to get 30 MHz system clock. For now 24 MHz is ok, but 30 MHz is a must.

Any ideas? Something that I have over-locked?
Labels (1)
4 Replies

552 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Tue Dec 08 23:44:21 MST 2015
I'm not familiar with the LPC54102 chip, but I guess it's following the same principles from the LPCXpresso framework, so it's not enough to change the frequency as you did in

Chip_SetupIrcClocking(32000000);

You must also inform the crystal frequency and the oscillation source. Pretty nasty, uh? That's the NXP way :P

Some time ago I wrote a little tutorial (mostly for myself) in regards how to choose the correct oscillation source. Maybe you want to check it out:

https://fjrg76.wordpress.com/2012/11/02/configuring-the-clock-options-for-the-lpc1227/
0 Kudos

552 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by koonyook on Tue Dec 08 07:38:05 MST 2015
I'm using LPC54102 and I want to make the main clock slower from 100MHz to 32MHz.

so I change in sysinit_5410x.c

from

Chip_SetupIrcClocking(100000000);

to

Chip_SetupIrcClocking(32000000);

but after running, the SystemCoreClock is still at 96000000

Do I need to change something else?
0 Kudos

552 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Thu Jul 30 00:50:02 MST 2015
Hi,

I looked at the functions you pointed me out, but although that has answered my original question (thanks!), two more have arose:

1.- I need to touch system files. Very bad idea.

2.- That workaround won't work when in the same workspace I have two o more projects, some using an external crystal, and some using the internal clock. One workspace per project? Maybe. Conditional compilation? We'll go back to point 1.

Right?
0 Kudos

552 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Wed Jul 29 07:38:19 MST 2015
Hi fjrg76,

Are you using the latest LPCOpen package for the LPC81x? If so, have you looked at Chip_SetupIrcClocking in sysinit_8xx.c? This function should be called in SystemInit(), prior to entering main().
0 Kudos