Skip navigation
Using SDK drivers for LPC845 Breakout Board, this project measures the ambient light intensity by using LDR (Light Dependent Resistor). The voltage values from LDR are read through an ADC. The new LPC845 Breakout board has an SDK support which makes it a lot easier to interface an LDR for measuring light intensity compared to the conventional coding style. I have used the MCUXpresso IDE for modifying the pins and clock configuration settings.
The project requires a resistor and LDR (Light Dependent Resistor)/Photoresistor in a resistor divider circuit as shown below:

The value of R1 here is 4.4Kohm. 

The output of this resistor divider circuit is connected to the assigned ADC channel. In this application, I have assigned it to the ADC0_8 channel which is the PIO0_18 (pin 3) and configured it accordingly in the software.
Components used: LPC845 Breakout Board, Light Dependent Resistor(LDR)/Photoresistor, 2.2Kohm resistor (Quantity:2)
LPC845 Breakout Board connections to the LDR are as shown:
Pin NameBoard LocationPin Name
ADC_8PIO0_18 (CN1-3)resistor divider o/p
GNDCN1-204.4k resistor
For this application, I have used ADC0_8 as the ADC channel which converts the LDR output analog voltage values to digital values. The values printed on the console window reflect the change in the light intensity.
(For testing purposes, the light intensity can be changed by covering the LDR or using a cellphone flash)
The LPC845 Breakout board has an SDK package support. I used the ADC SDK driver API in the software for interfacing the hardware components. The MCUXpresso SDK Builder has open source drivers, middleware, and reference example applications for software development. Customize and download the SDK specific to the processor and then import the zip file to the project in MCUXpresso IDE.
The LPC845 Breakout board also features function-configurable I/O ports through a switch matrix (SWM). This makes it easier to configure pin routing and other pin electrical features. The configuration tool which is integrated into the IDE is useful for making changes in the switch matrix. The source code is auto-generated when the pin configuration or peripherals are changed.
/* ADC_CHN8 connect to P0_18 */
SWM_SetFixedPinSelect(SWM0, kSWM_ADC_CHN8, true);
The source code for this application and board info for the LPC845 Breakout board can be found here.
int main(void)
/* Initialize board hardware. */
/* Configure the converter and work mode. */
/* Trigger the sequence's conversion by software */
/* Wait for the converter to be done. */
while (!ADC_GetChannelConversionResult(DEMO_ADC_BASE, DEMO_ADC_SAMPLE_CHANNEL_NUMBER, &adcResultInfoStruct))
/* Display the conversion result */
PRINTF("adcResult = %d\r\n", adcResultInfoStruct.result);

The LPC546xx IAP EEPROM Write page API  does not enable the EEPROM clock for the write operation. This causes  EEPROM write operation to fail when using the IAP API.  This problem does not occur for IAP Read EEPROM page command.


The workaround is to enable the EEPROM clock  ( set bit 9) in AHBCLKCTRL0 register of SYSCON before calling the IAP EEPROM write function.



Hi folks,

Attached is a sample source code for OTP programming in NXP LPC54018 MCU.

Brief about the example:

The example programs 4 words of data each into OTP bank 1 and OTP bank 2. The example uses LPC54018 SDK drivers. The complete SDK for LPC54018 can be downloaded from Welcome | MCUXpresso SDK Builder .

Hope this is helpful !

Best Regards,


NXP lpc54018

If you are searching for a high-performance, power efficient, yet cost sensitive MCU for your designs, then here is the exciting news: NXP recently introduced the LPC51U68 MCU.


Power efficient solution for future IoT designs

Based on the Arm® Cortex®-M0+ core, the LPC51U68 MCU pushes the performance of the core to 100MHz, which is more than two times faster than current Cortex-M0+-based products. The LPC51U68 MCU also provides expanded memory resources of up to 96KB on-chip SRAM and 256 KB on-chip flash programming memory with flash accelerator. It also features unparalleled design flexibility and integration including a USB 2.0 full-speed device controller supporting crystal-less operations, eight flexible serial communication peripherals, each of which can be enabled as UART, SPIs or I2C and up to two I2S interfaces. The LPC51U68 MCU integrates a variety of timers including three general purpose timers, one versatile timer with PWM (SCTimer/PWM), one RTC/alarm timer, a multi-rate timer and watchdog timers. On the analog side, an on-chip 12-channel ADC with a 12-bit resolution and conversion rates at up to 5Msps and temperature sensors are provided. With all the features integrated, the LPC51U68 MCU brings unparalleled design flexibility, computing performance and integration into today’s demanding IoT and industrial applications.


LPC51U68 Block Diagram


Extraordinary compatibility

While considering the LPC51U68 MCU as an upgrade of the LPC11U68 MCU family, it provides pin-function compatibility with Arm® Cortex®-M4 based LPC5410x and LPC5411x MCU families in the same packages and pinout versions enabling a smooth transition to the power-efficient MCUs based on Arm® Cortex®-M4 core.


Low power design for energy efficiency

While providing excellent computing power with the Arm Cortex-M0+ core, the LPC51U68 MCU displays ultra-low-power consumption and a unique low-power design. The microcontroller supports four low-power modes and API-driven power profiles, providing developers with easy-to-use dynamic current management at runtime and fast wake-up times from the microcontroller’s reduced power modes.


LPC51U68 Run Currents and Extended Power Modes


Make your design easier with tools supported

LPC51U68 MCUs are fully supported by NXP’s MCUXpresso software and tools which brings together the best of NXP’s software enablement into one enablement platform for a shared software experience across a broader set of Arm® Cortex®-M MCUs. In addition, this new MCU is supported by the LPCXpresso51U68 development board, designed to enable evaluation and prototyping with the LPC51U68 MCU. The board features an on-board, CMSIS-DAP / SEGGER J-Link compatible debug probe, expansion options based on Arduino UNO and PMod, plus additional expansion port pins and more


LPCXpresso51U68 Development Board

 OM40005: LPC51U68 Development Board

To learn more about LPC51U68 MCU, visit


Live at Computex 2018 this week is: The High Performance Gaming Mouse Controlling Hundreds of Full Color LEDs Powered by LPC51U68

  • A 100MHz Arm® Cortex®-M0+ delivering real-time response for game player
  • 96K SRAM for LED pattern allows for a smooth transition 
  • Built-in USB drivers in ROM and supports 1K report rate
  • 8 Flexcomm serial channels to drive up to 800 LEDs with full color control at the same time



@jennymplunkett from the Arm mbed team just posted a great tutorial using the LPCXpresso54608 touch screen on her blog... check it out at

Same code shown will also run on LPCXpresso54628.


Thanks Jenny!

The LPC800-DIP board is now being sold by Coridium for just $10:


They have their own version of gcc and BASIC running on it too, available for just a few $$



I have the OM13086 Cloud Connectivity Kit
I have been following the ZentriOS "Quickstart Guide".
As part of the Zentri OS Quickstart procedures, I chose "Custom Install", so instead of using the "Zentri IDE", I'm uisng LPCXpresso 8.2.2, with the Zentri SDK plugin

I've left the LPCXpresso43S67 board jumpers in the default configuration, please see attached photos.
I connected the LPCXpresso43S67 + LPC General Purpose Shield boards to my laptop with 2 USB cables.
When I follow the Quickstart instruction "Running the ZentriOS Setup Device Wizard", it fails, with these messages:


Setting up the device for SDK development ...
03:27:16.165 [INFO] Verifying DMS credentials ...
03:27:17.904 [INFO] DMS credentials valid
03:27:17.946 [INFO] Retrieving available platforms from DMS ...
03:27:18.515 [INFO] 4 platforms available
03:27:18.517 [INFO] Probing for connected device ...
03:27:18.517 [INFO] Discovering device connected to local computer ...
03:27:19.36 [INFO] Starting OpenOCD server for AMW106 ...
03:27:23.365 [INFO] Starting OpenOCD server for AMW004 ...
03:27:27.786 [INFO] Starting OpenOCD server for AVN4343 ...
03:27:31.823 [ERROR] Is the device connected and correctly enumerated?
03:27:31.823 [ERROR] Exception: No devices found
03:27:33.391 [INFO] Ensure the device is connected via USB to the computer and that the USB is correctly enumerated.

<img src="" width="539" height="192" />

More information here: <a target="_blank" href="" >Connecting NXP Hardware</a>
03:27:35.292 [INFO] Is the device connected and correctly enumerated?
03:27:35.293 [INFO] Checking for solution ...
03:27:35.295 [INFO] Retrieving driver nodes ...
03:27:35.638 [INFO] NXP driver repair available
03:27:36.805 [INFO] Attempting to repair NXP driver issue
tools/makefiles/ recipe for target 'setup' failed

Today we announced the new LPC8N04, NFC-enabled MCU. We will be demonstrating the board at ARM Techcon in San Jose, and the lucky first 100 visitors to the NXP booth can exchange their business card for a free board!


The Board will come pre-loaded with a demo, that can be used with Android phones (iPhone version to follow), and when the product is fully released in January, the full set of source code will be available at NXP's site. Boards will also be available for sale at that time. Until then, if you are lucky enough to get a board from the show, please see the attached Getting Started Guide.



You may be interested to know that we recently released a new set of debug firmware and Windows 7 drivers for our boards that feature the LPC11U3x MCU as a debug probe (so all the "MAX" boards). The new firmware can be found under the Software & Tools tab of the board page you are using (where xxxxx is the board part number, such as om13071, om13097, etc.


The intention is for this firmware to be used instead of the Mbed-based firmware and driver that has been used up until now, if you are not going to use Mbed (you can continue to use the Mbed version if you so wish however). Some reasons to consider the new firmware & driver:

  • The CMSIS-DAP implementation is newer, so a little more robust and faster
  • The VCOM / serial port driver supports autobaud, with speeds up to 115200
  • The VCOM driver has a cleaner installation (mbed serial port driver needs board to be plugged in to install, which is a little unusual)
  • The firmware auto-detects if a target serial port connection is present and enumerates a driver if they are.
  • The new firmware gives a unique ID per board, allowing multiple board connections at once.


Downloading the package will give you a driver for Windows 7 & 8 (not needed for Windows 10, MacOS or Linux), plus the debug probe firmware image. Follow the firmware update instructions for your board to update - its a simple delete then drag and drop operation.



For the low pin count and small memory footprint LPC800 family, NXP offers free LPCOpen Driver Code and Example Code Bundles. 


The LPCOpen Driver Code for LPC81x/82x/83x series, is an Application Programming Interface (API) base. For users who are not too concerned with overall code size, LPCOpen provides the ease of use without diving into details of each peripheral registers, and it is easy to migrate from LPC8xx to LPC11xx family. 


Link to LPC8xx LPCOpen:


However given LPCOpen is no longer the supported platform, and future LPC8xx devices will not have LPCOpen Driver code.


For the LPC800 family, NXP also offers a basic, complete working Example Code for each peripheral, giving 8/16 bit microcontroller users fast transition to the 32bit LPC800.


Example code is the fastest, simplest way for user to learn how to program each peripheral before progressing to more advance features of the peripheral. New users of LPC800 can step through the Example Code like a tutorial. Concise and accurate explanations in Readme files and comments in source files help the user to start/debug quickly.


The Example Code Bundles work right out of the box for the LPC800 LPCXpresso-MAX boards. It’s easy to read how the peripherals registers are setup /access without going through many levels of APIs. They have register level peripheral access, and direct correspondence between software and memory maps in the chip User Manuals. The Example Code Project and source code directory structures are kept simple, flat, and consistent (as much as possible) between LPCXpresso/MCUXpresso IDE, Keil, and IAR tools. 


The system base on Example Code is smaller in code size,  with much simpler code vs LPCOpen for a similar task (For example, >25% code size reduction for a simple Blinky). This can be crucial in applications where the code size is close to the device flash limit. 


All new LPC800 devices will have a supporting Code Bundle.


To try the Example Code,  please go to the related LPC800 product pages and Select the Software download tab.

Direct Links :-

Example Code Bundle for LPCXpresso

LPC812 Example Code Bundle LPCXpresso

LPC812 Example Code Bundle Keil and IAR


LPC824 Example Code Bundle LPCXpresso

LPC824 Example Code Bundle Keil

LPC824 Example Code Bundle IAR


LPC834 Example Code Bundle LPCXpresso

LPC834 Example Code Bundle IAR

LPC834 Example Code Bundle Keil



Nice project from Kevin Townsend showing off capabilities of LPC824 with it's state configurable timer to drive Neopixel and IR distance application.


LPC824 NeoPixel IR Distance Sensor

I love seeing how our LPC community uses our microcontrollers ... keep sharing what you create and let's continue to support and invest in each other.  


Pokitto LPC11U68 Game Gadget on Kickstarter - EB sold out soon!

Hi LPC fans,


We have very good news to share with you today.

As you know, one of the major roadmap for LPC this year is the LPC546xx release.

And it will be coming soon~~~, as you all expected.

For this new and hot product, the LPC SE team has prepared a serial of training slides covering almost every peripheral and aspects of LPC546xx.

Hope these material can help you a lot on this new product and make it successful together.


Here is the list of all the topics .

Attached are the training slides package and hands-on example packages.

  1. "hot_mcuxpresso.7z" is also hands-on example package, but these examples are based on the MCUXpresso IDE
  2. "HOT_examples.7z" contains examples based on Keil

Hope you like it, and all feedbacks are welcome.


Original Attachment has been moved to:

Original Attachment has been moved to:

Original Attachment has been moved to:

LPCXpert V3.4 is the latest release of a freeware expert tool for the CORTEX-M based LPC families of microcontrollers. This tool simplifies the selection of a MCU device, speeds up the creation of application code and initialization code and supports generation of an application specific schematic Symbol. This version supports more than 410 different CORTEX-M based micro controllers from NXP.


LPCXpert supports all phases of a development. During the MCU selection phase LPCxperts supports selection of a target MCU by providing selection features in the "MCU Select" tab. During the software implementation phase LPCXpert provides a graphical user-interface to configure the pinout (Pin-MUX) and the peripheral interfaces of the target device. LPCXpert then also generates projects providing a framework of reference applications. These applications configure the Clock Generation Unit (CGU) and the on-chip peripheral interfaces of the device to test and demonstrate the setup.


New and enhanced features include support for LPCopen software package from NXP. Features also include generation of a Schematic Symbol for the ALTIUM Designer and the CADSOFT EAGLE V6.2 and generation of projects for the NXP LPCXpresso and MCUxpresso IDE, IAR Embedded Workbench (EWARM), Keil µVision and GNU C-Compilers, as well as links to Internet Sites for additional information.

Using LPCXpert it is possible to set the pins of each peripheral (i.e. for SPI, CAN., I2C, EMC, ETH, ...) and to configure the features of each pin (Pull-Up, Pull-Down, ...). In addition LPCxpert V3.4 also supports configuration of pre-built demo code for the LPC8xx and LPC54xxx Families of MCUs.


Based on the configuration LPCXpert may generate a C-Code Project or a Schematic Symbol. In addition LPCxpert saves up to 8 different pin-mux configurations and restore from up to 10 different configurations. Additional Information and the download is available from the following Web-Site:


Back in Austin TX after a fun trip to Nürnberg, Germany.


I am humbled and energized after spending a week with 30,000+ engineers at this year’s Embedded World!


Nürnberg, Germany

Amazing.  That’s the only way to describe the passion and enormity of our LPC FANS across Europe.  LPC is deep-rooted in the hearts of many and I am lucky to be a part of this inspired, tightknit community.    Embedded World has a strong place in the heart of LPC. 


My personal highlights from the event .... LPC FANS, What's Popular, MCUXpresso & Geoff.



My favorite experience of the event was standing proudly at the LPC pedestal shaking hands with 1000s of LPC FANS.  I enjoyed connecting with each of you, hearing about your success, ideas and future needs.  Everything begins with great people … and we will continue to learn and find inspiration from you.  Thank you for your guidance as we build our next generation of differentiated microcontrollers!


  • What's Popular?  LPC800 & LPC54000 demos & give-aways!

The 8-bit MCU market is moving to the 32-bit world and we are excited to show off the cool features of the LPC800 series, but EW was really more focused on the LPC54600 family.  High performance and integration for power-sensitive applications.  We showed off a variety of demos and partner solutions at the pedestal.  Stunning, low-power, cost effective GUIs made easy with Embedded Wizard and TouchGFX.


Longtime NXP partner, Embedded Systems Academy showcased the dramatic improvements the LPC5461x family of CAN-FD controllers can make in various industrial applications.

With our partners, we gave away tons of LPC boards, from our power-optimized, full speed USB enabled LPC54114 board, to our newest LPCXpresso54608 platform.  And over 200 engineers & students left on the final day with an LPC800 DIP boarda very fun platform to experience what everyone is talking about ... LPC800!  Much more to come this year, stay tuned!

  • MCUXpresso.

NXP spent a year working on a unified development experience and Embedded World was the near final step in our MCUXpresso roll-out.  Erich Styger & Andy Beeson did an unbelievable job showing our new tools, read more at Erich's blog.

  • Geoff Lees

#1, LPCFANS and I both loved seeing Geoff engaged and interacting with numerous customers, fans and partners.  Many of you commented how "cool" it was to see Geoff approachable and engaged throughout the event. Year after year, his commitment to the industry and his visible presence at Embedded World is inspiring.  I am not sure where he finds his energy!


#2, Geoff stole the show (like only Geoff can do). Check out Junko Yoshida's article in EETimes, where Geoff   "unveiled a sweeping plan to broadly migrate design and production of general-purpose processors and microcontrollers from CMOS nodes to the FD-SOI" ... all-in on 28 FD-SOI.  Get ready for our next generation of breakthrough processors and microcontrollers.


Thank you to the NXP team and valued partners for your hard work making this event a huge success!  


And to our LPC FANS, thank you for continuing to believe ... until next time!