lpcware

[SOLVED] LPC11U67 System PLL won't lock.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by acker10 on Thu Apr 17 23:19:50 MST 2014
I'm trying to follow the directions in the LPC11U6x user manual for basic clock configuration.

Debugger shows that my loop to check the System PLL status (SYSPLLSTAT) register for a PLL lock is never exiting.  (Section 4.4.4 in the user manual.)

What are the debugging steps for this kind of problem?

I've used this same crystal on a LPC11U37 with same circuitry without problems.  Bad solder joint on XTALOUT/XTALIN pins (LQFP48)?  Not the right capacitor values?  Perhaps the LPC11U67is more picky about crystal accuracy than the LPC11U37 was?  (No, I don't have an oscilloscope unfortunately.)  My code is bad?  (Bad MSEL/PSEL selection?)

The crystal is 12mhz with two 18pF capacitors.

Here's the code:

void setupClock()
{
  LPC_SYSCON->PDRUNCFG_b.SYSPLL_PD = 0; // 0=powered, 1=off
  LPC_SYSCON->SYSPLLCLKSEL = 1; // 0=irc, 1=systemosc, 3=32khzclk

  LPC_SYSCON->SYSPLLCLKUEN = 1;
  LPC_SYSCON->SYSPLLCLKUEN = 0;
  LPC_SYSCON->SYSPLLCLKUEN = 1;
  while(!(LPC_SYSCON->SYSPLLCLKUEN & 0x01)); // this works

  // must admit not sure this is right
  LPC_SYSCON->SYSPLLCTRL_b.MSEL = 3;
  LPC_SYSCON->SYSPLLCTRL_b.PSEL = 1;

  while(!(LPC_SYSCON->SYSPLLSTAT & 0x01)); // **this is where it never exits**
}


Thanks.

Outcomes