LPC1227, System Clockout ever 12MHz

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

LPC1227, System Clockout ever 12MHz

194 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by UKlakow on Tue Oct 04 15:39:00 MST 2011
Hello, sorry bevor, i am a german and my english is i lttel bit poor!

i have same problems with the system clock and clockout.
the orginal file: "system_LPC122x.c" have follow settings for system clock:[SIZE=2]
             #define SYSPLLCLKSEL_Val      0x00000001[/SIZE][SIZE=2]
             #define SYSPLL_SETUP             1[/SIZE][SIZE=2]
             #define SYSPLLCTRL_Val          0x00000041        // request: 0x.....24[/SIZE][SIZE=2]
[/SIZE][SIZE=2]             #define SYSAHBCLKDIV_Val    0x00000001        // requested 2[/SIZE][SIZE=2][/SIZE][SIZE=2]
             #define CLKOUTCLKSEL_Val    0x00000003        // original value: 0[/SIZE]

if a change the SysPLLCTRL to 0x.......24 then the debuger told me: No source availible!
and also the board is not running (checked by my osillosscop)
the other the original value shut gennerate a clock from 24MHz, a tray to put out this signal on Clockout pin, unfortunately i say only 12Mhz at the outout.

best regards, U.Klakow
0 Kudos
2 Replies

171 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by UKlakow on Thu Oct 06 08:31:38 MST 2011
Yes I get it what you say, about in the user manual, chapter 4.10.4 table, the 3 line is printed:
[COLOR=Teal][B]  FCLKOUT Frequency of sys_pllclkout. FCLKOUT must be < 100 MHz.[/B][/COLOR]
if a config the clock divider's at 2, then the used clocks shut run only 30MHz!

Now I now what is the problem, in the file "sytem_LPC122x.c" what is generated  from the LPCXpresso IDE is a wrong configuration sequence. The code line:
[B][COLOR=Teal] LPC_SYSCON->SYSPLLCTRL    = SYSPLLCTRL_Val;[/COLOR][/B]
follow a couple of line later is the line:
[COLOR=Teal][B]LPC_SYSCON->SYSAHBCLKDIV  = SYSAHBCLKDIV_Val;[/B][/COLOR]
and the outer settings of the other divider register for the outer lines.
after i move the line in front of:
[B][COLOR=Teal] LPC_SYSCON->SYSPLLCTRL    = SYSPLLCTRL_Val;
[/COLOR][/B][COLOR=Teal][COLOR=Black]the MCU run with 30MHz!
The only more question about this fix is this: if a new MCU is startup, is it possible to change the SYSAHBCLKDIV befor
the setting of SYSPLLCTRL register?

[/COLOR][/COLOR] my Question 2) was about the clockout signal: now i have solved this also by my self, for this operation i had been insert two lines in the same file:
[COLOR=Teal][B]#if (CLKOUTCLK_SETUP)
  LPC_SYSCON->CLKOUTCLKSEL = CLKOUTCLKSEL_Val;
  LPC_SYSCON->CLKOUTDIV    = CLKOUTCLKDIV_Val;
  LPC_SYSCON->CLKOUTUEN    = 0x00;
  LPC_SYSCON->CLKOUTUEN    = 0x01;
#endif[/B][/COLOR] 

now i see 30MHz at the clock output pin!

Best regards from germany, Ulrich Klakow
0 Kudos

171 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Oct 04 16:53:46 MST 2011
Your new SYSPLLCTRL_Val is nonsense :)

With MSEL = 4, M = 5

Result: 5*12MHz = 60 MHz main clock :eek:

User manual:

Quote:

The LPC122x operate at CPU frequencies of up to 45 MHz.:mad:

0 Kudos