AnsweredAssumed Answered

LPC812 crystal with mcuXpresso SDK

Question asked by Carter Timm on Jan 7, 2019
Latest reply on Jan 25, 2019 by Brendon Slade



I can't seem to get an external 12MHz crystal working with the MCUXpresso SDK and its associated GUI tools. I can, however, make it work with the LPCopen driver library, but I'd rather stick with the MCUXpresso SDK since it seems like NXP will be phasing out or stopping support for the LPCopen SDK in the coming months or years (please correct me if I'm wrong) and I really, really don't want to mix two different driver libraries in the same project (everything else is working fine).


I'm ensuring that 'sys_osc' is the input to the SYSPLLCLKSEL mux, but what I'm seeing is that the PLL never locks. Additionally, the system oscillator is NOT bypassed (it is active), since I'm using the recommended crystal attached to both XTALIN and XTALOUT pins with the recommended 27pF bypass caps as well. If I hook up a scope, no activity is present across either side of the crystal.


Anyway, here's the code that is generated by MCUXpresso SDK:


/*!< Set up the clock sources */
/*!< Set up IRC */
POWER_DisablePD(kPDRUNCFG_PD_IRC_OUT); /*!< Ensure IRC_OUT is on */
POWER_DisablePD(kPDRUNCFG_PD_IRC); /*!< Ensure IRC is on */
POWER_DisablePD(kPDRUNCFG_PD_SYSOSC); /*!< Ensure Main osc is on */
CLOCK_InitSysOsc(12000000U); /*!< Set main osc freq */
CLOCK_Select(kSYSPLL_From_SysOsc); /*!< set sysosc to pll select */
clock_sys_pll_t config;
config.src = kCLOCK_SysPllSrcSysosc; /*!< set pll src */
config.targetFreq = 60000000U; /*!< set pll target freq */
CLOCK_InitSystemPll(&config); /*!< set parameters */
CLOCK_SetMainClkSrc(kCLOCK_MainClkSrcSysPll); /*!< select pll clock for main clock */
CLOCK_Select(kCLKOUT_From_SysOsc); /*!< select pll clock for CLKOUT */
CLOCK_UpdateClkOUTsrc(); /*!< update CLKOUT src */
CLOCK_SetClkDivider(kCLOCK_DivUsartClk, 1U); /*!< set UART div */
/*!< Set SystemCoreClock variable. */


Any advice? Thanks for your time.