Using internal oscillator instead external

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

Using internal oscillator instead external

772 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zlajoan on Wed Mar 05 07:16:27 MST 2014
Hi!

I am working on board with LPC1114 processor. I would like to use only internal oscillator so that the external could be removed from the board.
I've changed  
#define SYSPLLCLKSEL_Val  0x00000001
to
#define SYSPLLCLKSEL_Val  0x00000000
as suggested in one topic, but program execution gets stuck in
while (!(LPC_SYSCON->SYSPLLSTAT & 0x01));      /* Wait Until PLL Locked    */

Any suggestions?

Best regards,
Zlatko
0 Kudos
Reply
4 Replies

714 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zlajoan on Wed Mar 05 09:35:34 MST 2014
My apologies, I've fogotten to rebuild Core-Lib...

It is enough to change only this line as I did first time:
#define SYSPLLCLKSEL_Val      0x00000000


Thanks LabRat.

Zlatko
0 Kudos
Reply

714 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Mar 05 09:15:40 MST 2014

Quote: zlajoan

Quote: LabRat

Quote: zlajoan
Any suggestions?



#define SYSOSC_SETUP          [color=#f00]0[/color]


Still the same problem, stuck in loop.



You are kidding 

void SystemInit (void)
{
#if (CLOCK_SETUP)                                 /* Clock Setup              */
#if (SYSCLK_SETUP)                                /* System Clock Setup       */
[color=#f00]#if (SYSOSC_SETUP)                                /* System Oscillator Setup  */[/color]
  uint32_t i;

  LPC_SYSCON->PDRUNCFG     &= ~(1 << 5);          /* Power-up System Osc      */
  LPC_SYSCON->SYSOSCCTRL    = SYSOSCCTRL_Val;
  for (i = 0; i < 200; i++) __NOP();
  LPC_SYSCON->SYSPLLCLKSEL  = SYSPLLCLKSEL_Val;   /* Select PLL Input         */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x01;               /* Update Clock Source      */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x00;               /* Toggle Update Register   */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x01;
  while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01));     /* Wait Until Updated       */
#if (SYSPLL_SETUP)                                /* System PLL Setup         */
  LPC_SYSCON->SYSPLLCTRL    = SYSPLLCTRL_Val;
  LPC_SYSCON->PDRUNCFG     &= ~(1 << 7);          /* Power-up SYSPLL          */
 [color=#f00] while (!(LPC_SYSCON->SYSPLLSTAT & 0x01));      /* Wait Until PLL Locked    */[/color]
#endif
[color=#f00]#endif[/color]
#if (WDTOSC_SETUP)                                /* Watchdog Oscillator Setup*/
  LPC_SYSCON->WDTOSCCTRL    = WDTOSCCTRL_Val;
  LPC_SYSCON->PDRUNCFG     &= ~(1 << 6);          /* Power-up WDT Clock       */
#endif
  LPC_SYSCON->MAINCLKSEL    = MAINCLKSEL_Val;     /* Select PLL Clock Output  */
  LPC_SYSCON->MAINCLKUEN    = 0x01;               /* Update MCLK Clock Source */
  LPC_SYSCON->MAINCLKUEN    = 0x00;               /* Toggle Update Register   */
  LPC_SYSCON->MAINCLKUEN    = 0x01;
  while (!(LPC_SYSCON->MAINCLKUEN & 0x01));       /* Wait Until Updated       */
#endif

  LPC_SYSCON->SYSAHBCLKDIV  = SYSAHBCLKDIV_Val;
  LPC_SYSCON->SYSAHBCLKCTRL = AHBCLKCTRL_Val;
  LPC_SYSCON->SSP0CLKDIV    = SSP0CLKDIV_Val;
  LPC_SYSCON->UARTCLKDIV    = UARTCLKDIV_Val;
  LPC_SYSCON->SSP1CLKDIV    = SSP1CLKDIV_Val;
#endif


Either you've forgottem to rebuild the Core-Lib or you are using your own System init?
0 Kudos
Reply

714 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zlajoan on Wed Mar 05 08:40:42 MST 2014

Quote: LabRat

Quote: zlajoan
Any suggestions?



#define SYSOSC_SETUP          [color=#f00]0[/color]


Still the same problem, stuck in loop.
0 Kudos
Reply

714 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Mar 05 07:48:55 MST 2014

Quote: zlajoan
Any suggestions?



#define SYSOSC_SETUP          [color=#f00]0[/color]
0 Kudos
Reply