Help! My OKdo E1 board hangs up [solved]

Or… MCUXpresso Clocks Configuration tutorial using OKdo E1 board.

What to do about the non-populated 16 MHz crystal on OKdo E1 board?

Many of the examples available in the MCUXpresso SDK for lpcxpresso55s69 work just fine on the E1 board. “It was made that way”. However, those that use the BOARD_BootClockPLL150M() or BOARD_BootClock100M() clock functional groups hang up in the PLL initialisation routine. It doesn’t take much effort in a debug session to find that the code is stuck in a while() loop in the Clock driver (fsl_clock.c, function CLOCK_SetPLL0Freq()):

#1 in “reasons my code hang up”: the unguarded while() loop

What is happening is the PLL is not locking. And it is not locking because it does not have a reference clock. And there is no reference clock because there is no crystal fitted to the board.

The workaround is really simple… provide a reference to PLL0 from the internal clock source instead of from the (missing) crystal. To maintain a 150 MHz output clock we need to adjust the PLL multiplier and divider values, and I show you how to do this in my video tutorial 3 MCUXpresso Clocks Config tutorial with OKdo E1 board

It is straightforward to create a new functional group in the MCUXpresso clocks tool (if you know that the Functional Groups Properties icon is the second one to the right of the Functional Groups: dropdown box):

Functional Groups Properties icon

I used the dialog to create a new functional group, and named it BOARD_BootClockFRO12_PLL_150MHz().

New functional group: BOARD_BootClockFRO12_PLL_150MHz

Since this functional group is going to use the PLL0, it is necessary to enable it, so the setting PLL0 Mode must be changed to ‘Normal’. After saving the new group [OK], we can edit it in the Clocks Diagram.

Editing PLL0 configuration for 150 MHz

The change is to select the internal free-running oscillator fro_12m in the PLLCLKSEL multiplexer. The tool will highlight an error, because the existing PLL0 multiplier and divider generate an illegal output frequency. I fixed this with updated values – ( /8 * 200) to generate 300 MHz output. Finally, this is divided down into range with the PLL0_PDEC divider, yielding an output 150 MHz clock for the chip.

As always, I enable the CLKOUT pin, and output the main clock to a pin. Clearly, 150 MHz is too fast for the output pad, and I used a CLKOUTDIV of 200 and was able to measure 750 kHz on the clock output pin.

So that’s it really. That was an easy problem to find, and fix (when you know the Clocks tool). I know that these little tips and tricks on how to apply the MCUXpresso Config tools to these LPC55xx boards are popular, and so come back next week when I’ll start to set up the Pins on my OKdo E1 board for the weather station project.

If you’d like to see more videos, check out my embeddedpro YouTube channel for other tutorials about Cortex M33, LPC55S69, LPC55S16 and the OKdo E1 board.

4 thoughts on “Help! My OKdo E1 board hangs up [solved]

  1. Pingback: MCUXpresso tutorial: I2C using the Pins/Clocks/Peripherals Config tools and lpcxpresso55s69 SDK | MCU on Eclipse

  2. Pingback: MicroTick (UTICK) Timer Tutorial with OKdo E1 board | MCU on Eclipse

  3. Since the E1 PCB has pads for a 16 MHz crystal, is there any reason to not just solder a crystal there? Do you have any idea what crystal component would be correct for this?


  4. Hi Philip & thanks for your interest in these blogs and the OKdo E1 board. Given the LPC55S69 has such a flexible clocking scheme, and that it can run at 150 MHz via PLL0 with the IRC as the reference, the decision was made to omit the 16 MHz crystal. This helps to keep the cost of the board down, but of course you can fit a crystal if you need 16.0000 MHz.
    I have a prototype E1 board on my desk (with green PCB) and this is fitted with a 16 MHz crystal. The BOM shows Epson FA-238 16 MHz crystal. It is marked “1600T E98JC”.


What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.