Change clock in lpc1769

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

Change clock in lpc1769

1,846 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Fri Jun 15 11:07:49 MST 2012
Hello,
I am doubt about change clock in lpc1769

How can change the clock?
0 Kudos
Reply
6 Replies

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 15 13:52:37 MST 2012

Quote: bruno
I trying to generate a clock of 10 Mhz CPU clock.

The clock of crystal is 12 Mhz.



As mentioned above, there are just 2 values to change :eek:

#define PLL0CFG_Val           0x0000000E //FCCO = 2*12MHz*15=360MHz
#define CCLKCFG_Val           0x00000023 //CCLK = FCCO /36 = 10MHz
0 Kudos
Reply

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Fri Jun 15 13:39:25 MST 2012
With values of #define that are posted.  He is generating  a CPU clock of 72 MHz.

I'm sorry, by don't explication correct of doubt
0 Kudos
Reply

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Fri Jun 15 13:38:13 MST 2012
I trying to generate a clock of 10 Mhz CPU clock.

The clock of crystal is 12 Mhz.
0 Kudos
Reply

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 15 13:25:02 MST 2012

Quote: bruno
For example, I want modify these #define for a clock of 10 Mhz.



:confused:

Sorry, I don't understand what you are trying to do.

Are you trying to generate a 10MHz CPU clock or are you using a 10MHz crystal ?




[COLOR=#3f7f5f][SIZE=2]

[/SIZE][/COLOR]
0 Kudos
Reply

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Fri Jun 15 13:14:19 MST 2012
Could you  make a example for me?

I am trying read, the read for registres but I don't understand, how modified these registers.

For example, I want modify these #define for a clock of 10 Mhz.

[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] CLOCK_SETUP 1[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SCS_Val 0x00000020[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] CLKSRCSEL_Val 0x00000001[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PLL0_SETUP 1
[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PLL0CFG_Val 0x0000000F [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//B[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PLL1_SETUP 1[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PLL1CFG_Val 0x00000023
[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] CCLKCFG_Val 0x00000003 [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//03[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] USBCLKCFG_Val 0x00000000[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PCLKSEL0_Val 0x00000000[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PCLKSEL1_Val 0x00000000[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PCONP_Val 0x042887DE[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] CLKOUTCFG_Val 0x00000000
[/SIZE]
0 Kudos
Reply

1,779 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 15 11:17:59 MST 2012
In system_LPC17xx.c of CMSIS you find a function called SystemInit :)

PLL0 Settings are done via:


Quote:

#define PLL0CFG_Val           0x00050063
#define CCLKCFG_Val           0x00000003

This sets Fcco to 400MHz and CCLK to Fcco/4 = 100MHz (from 12MHz crystal), as explained in UM10360
0 Kudos
Reply