NXP Semiconductors Development Boards

Introduction

NXP Semiconductors is a global semiconductor manufacturer headquartered in Eindhoven, Netherlands and has its origins in the semiconductor division of Philips Electronics, a Dutch multinational conglomerate. It is one of the world's largest semiconductor companies, specializing in the development and production of a wide range of semiconductor products used in various industries and applications. NXP is known for its expertise in embedded systems, particularly in the development of ARM-based microcontrollers and processors. The company's microcontrollers are widely used in automotive electronics, smart appliances, industrial automation, and other embedded systems applications.

Please check out this page to learn about the various NXP boards I have come across. The various images on the page can be downloaded from the bottom of this page should you want a better look at them.

mbed NXP LPC1768

The mbed NXP LPC1768 development board is part of the NXP LPC1700 series, selling for about £50 ($63) - they can be picked up quite cheaply second hand though -, featuring a 32-bit ARM Cortex-M3 core based NXP LPC1768 microcontroller clocked at 96MHz, along with 512KB flash, and 32KB RAM, with support for USB Host, CAN, SPI, I2C, ADC, DAC, PWM, as well as six dedicated analog inputs. The board has a blue status LED below the USB connector and at the bottom of the board there are four blue user LEDs, feedback can also be obtained over the serial port via the USB mini connection. You can find the board's product page at:

https://os.mbed.com/platforms/mbed-LPC1768/

The page includes the board pinout, an example program, and links to schematic, user manual, data sheet and other documentation. Unfortunately, at the time of writing this article, the links under NXP LPC176x MCU weren't working.

A neat feature of the board is its small size of 54x26mm, and the 40-pin 2.54mm (0.1") DIP package form, allowing it to easily be placed into breadboard, speeding up prototyping; it's also supported by the Application Board, please see the dedicated section on this page. When bought new the kit came with the board, USB-A to mini-B cable, a printed quick start guide, and two business cards that contain a life-size pinout diagram for the board.

The board can be powered either via the USB mini connector or by supplying 4.5-9V to the VIN pin.

First Steps

I got my first mbed NXP LPC1768 from an eBay job lot, when I plugged the board into my Surface pro the board's blue LED came on and a drive called MBED with a capacity of 1.96MB appeared in Windows explorer. If Windows reports that there is a problem with the drive (as was the case for me) you should be fine to ignore as long as you can access the MBED drive. Since I got the board second hand there were already various files on the MBED drive including MBED.HTM and a .bin file.

As a test I downloaded the Hello World! binary from:

https://os.mbed.com/handbook/mbed-NXP-LPC1768-Downloading

And copied it to the MBED drive - there is no need to delete any existing .bin files as the board will use the most recently copied .bin file. While the file is being copied, which takes only seconds, I saw that the board's status LED flash. Then I pressed the reset button and the bottom left blue LED constantly flashed, which is what the Hello World! program is supposed to do.

Before going further it's a good idea to update the board's firmware, see this page for instructions:

https://os.mbed.com/handbook/Firmware-LPC1768-LPC11U24

Note that the firmware file has a .IF extension and is to be copied to the MBED drive - any user programs may be wiped. After the file is copied the board must be unplugged from your computer and replugged. After a few seconds the status LED will flash rapidly and then the board will be ready to use again - in my case the test program I had put on the board continued to run, and Windows detected the board as CMSIS-DAP and installed it.

Writing Programs

There are instructions on creating a program at:

https://os.mbed.com/handbook/Creating-a-program

Note: that the online compiler is called Keil Studio Cloud (the button on the linked page is top right). Keil Studio Cloud superseeds Mbed Online Compiler.

You will need an Arm/Mbed account, you can sign up for free, however, it supposedly takes up to 5 days to verify the details you supplied to set up the account but for me it was quick.

For downloadable (offline) version of ARM MBED COMPILER, Mbed Studio see:

https://www.mmu.ac.uk/about-us/professional-services/itd/software/software-download-centre/arm-mbed-compiler

However, you still have to sign in with an account.

I started with trying out Mbed Studio, when you first run it you are greeted with the sign in screen:

At this point you need to either sign in with your details or click the link to create a Mbed account. After signing in you can start developing, here is the screen you are greeted with:

It’s a good idea to get familiar with the IDE by following the Blinky tutorial at:

https://os.mbed.com/docs/mbed-studio/current/getting-started/index.html

When creating a new program you can select from a number of examples, or an empty mbed OS program, in the case of the tutorial, the Blinky example:

There are versions of the examples for different versions of MBED OS, the tutorial recommends to use the most recent, MBED OS 6. After adding the example program it will be opened into the workspace:

Note that the main program is in main.cpp.

You can plug in your LPC1768 board and Mbed Studio will detect it and you can choose it as an active selection:

Since I've connected the board I can just click the Play button to build and run, which will build the project and flash it to the board. The compile took about four minutes and there were a lot of files listed during the process, showing how more complicated the board can be to run even a simple program:

Note that there were a lot of warnings, mostly about issues with C++11, but the build was successful. Unfortunately, even after pressing the board's reset button the Blinky program wasn't running and I had to close Mbed Studio and reopen for the Play button to be reenabled. Looking online it would appear that others were having issues with getting the LPC1768 to work correctly with Mbed Studio:

https://forums.mbed.com/t/cannot-debug-with-nxp-lpc1768/8987

Supposedly LPC1768 isn't supported by Mbed Studio; if you click the Target drop-down in Mbed Studio and search for LPC1768 you will see no results, further confirming indeed the board isn't supported. This just means we can't program it directly or debug the board, instead for programming we can click Build program button (looks like a hammer) to build the program and copy the generated bin file to the MBED drive to program it. Note that the difference between the Play and Build buttons is that Play (Run) will enter debug mode after programming the board, which is perhaps why the Play button 'freezes' because it can't communicate with the board.

In the case of the blinky example I copied the generated bin file (mbed-os-example-blinky.bin) from the project sub folder (\BUILD\LPC1768\ARMC6) to the MBED drive. However, after pressing the board's reset button I found there was still no blinking LED, which was not expected. Looking online I found a site that gives the reason why:

https://github.com/ARMmbed/mbed-os-example-blinky/issues/271

So I created a new program in Mbed Studio but this time I chose mbed-os-example-blinky-baremetal as the example to open, which added it to the workspace. I built the project (which was very quick) and copied the generated bin file mbed-os-example-blinky-baremetal.bin to the MBED drive. Then I pressed the board's reset button and the board's LED was flashing on/off every .5 sec. In Mbed Studio, clicking on the _mbed LPC1768 tab I saw the following displayed:

This is the bare metal blinky example running on Mbed OS 6.17.0.

This is outputted from the program using printf() in main(). If you press the board's reset button the message will appear again.

If you wanted to for example change the blink rate then you would need to modify WAIT_TIME_MS which is normally set to 500 for 500ms; if you wanted to change it to 2 seconds then you would need to set it to 2000. Then you can build the project and copy the bin file again to the board, pressing the board's reset button and noting the LED now flashing on/off every 2 seconds.

Next I looked at the online compiler, Keil Studio Cloud, which replaces Mbed Online Compiler. The URL is:

https://studio.keil.arm.com/

You'll need to sign in with your MBed account details. It will take a few moments to see up the environment, the compiler looks very similar to Mbed Studio:

Note: I used Google Chrome, all majot browsers should be supported.

We can create a new project by clicking on the New project box, which like Mbed Studio, lets you select an example project if you want to. So I selected mbed-os-example-blinky-baremetal. I unchecked Initialize this project as a Git repository, then clicked Add project button. Here is the blinky example opened:

I noticed that my board hadn't been automatically detected. I clicked on the arrow in the Connected device area to the left of the window, which gives the Add Device option, clicking on that brought up a window with Microcontroller written, clicked on that and then the Connect button, which was successful, adding it to the list of devices. Hovering over the device gives information about it:

Next, I clicked on the Explorer button (far left) and then the Build target drop-down, searching for LPC1768 I could see it was a compatibe target and could be selected. I tried clicking on the Play (Run Project) button but after building I got the error:

usbConnect error: Failed to execute 'open' on 'USBDevice': Access denied.

I found other people with the same issue:

https://forums.mbed.com/t/usb-access-denied/20207/7

Which suggested it might be a firmware issue, so I updated the board and back in Keil Studio Cloud I added the device again, which now showed as MBED CMSIS-DAP. However, when I clicked the Run Project button I got the same usbConnect error with the IDE continually saying 'it's flashing...'. I also tried in Edge (the nice thing about using the online compiler is your projects are available across browsers and devices) but got the same usbConnect error after clicking Run project button. If you search on:

https://www.keil.arm.com/boards/

The LPC1768 doesn't show up and thus isn't a supported device but you would think you should at least be able to flash it from the online IDE.

Returning to Mbed Studio (having closed the online IDE) I tried the blinky example again, clicking the Run button after adding the board as a device. This time the board's status LED rapidly flashed as if being programmed, and pressing the board's reset button caused the user LED to flash. The debug text was displayed (This is the bare metal...) in the IDE's serial monitor as before, and the Run Project button wasn't disabled so updating the board's firmware at least allowed the board to be flashed from Mbed Studio. Note that Mbed Studio appears to write directly to the board rather than copying a file that you can inspect with a file explorer but of course the generated .bin file is in the project folder anyway. Debug, however, still wouldn't work for me, it wouldn't break into the debugger even if I added a breakpoint.

Tips


Mbed OS 6 full API list

A full API list for Mbed OS 6:

https://os.mbed.com/docs/mbed-os/v6.16/apis/index.html

Additionally, toward the bottom of the page it details the deprecated APIs from the previous version.


Outputting a floating-point value to the serial port.


Say for example we wanted to output the pot 1 value of the Application Board (or some other value, doesn't have to be specific to the Application Board) to the serial port, you can use the following code:


while(1) {

printf("%f \n" , pot1.read());

        thread_sleep_for(1000);

}


However, instead of getting the value you may instead see %f printed instead using Mbed OS 6+. This is because by default printf operates in a minimal form and we have to enable floating-point support in either the online or offline IDE:

Click the Project root in the Explorer

File->New File

Enter mbed_app.json as file name.

The file will automatically open for editing. Add:

{

    "target_overrides": {

        "*": {

            "target.printf_lib": "minimal-printf",

            "platform.minimal-printf-enable-floating-point": true,

            "platform.minimal-printf-set-floating-point-max-decimals": 2

        }

    }

}

Then click the Run program button. Now you should see actual floating-point values in the serial monitor once the board is reset.

Application Board

The mbed Application Board is essentially a breakout board for the mbed LPC1768 development board while packing in a lot of additional features into a small space, allowing users to try out a wide range of applications. It retails for about £40 ($51) and in summary provides the following:

128x32 backlit LCD

3-axis accelerometer

Four-direction joystick with press witch

Mini-USB connector for peripherals

Miniature loudspeaker

RGB LED

RJ45 Ethernet connector

Temperature sensor

Two 3.5 mm audio jacks for analog in/out

Two standard R/C servo motor headers (RS 781-3058 and 781-3046 are suitable, for example)

Two potentiometers

USB-A connector for flash drives, Bluetooth and GSM Modem

Xbee Zigbee/RN-XV Wi-Fi module compatible socket headers

The application board can be powered either from its mini USB, DC jack (6 - 9VDC, 1.3mm, centre positive), full size USB, or the mbed board's USB mini connector.

The correct way to insert the LPC1768 into the Application Board's headers is with the LPC1768's mini USB port on the same side as the Application Board's full size USB ports and LCD. Handily, even with the LPC1768 inserted in the Application Board there are two extra headers for accessing every pin of the LPC1768. Note that the LPC1768 covers the speaker on the Application Board but the speaker can still be heard quite well - the Application Board is crammed with features so no doubt placement of the speaker was a tricky choice.

When using the LPC1768 with the Application Board you plug the mini USB from your PC into the LPC1768 as normal, drop the bin file on the MBED drive and then press the reset button on the LPC1768 to start your program.

I got an Application Board with my second LPC1768 from an eBay job lot and to test out the Application Board I tried out the examples found at:

https://os.mbed.com/users/4180_1/notebook/mbed-application-board-hands-on-demos/

The site has downloadable bin files that can be copied to the mbed board. Note that the featured Blink LED demo doesn't require the Application Board. The demos that follow that one are for the Application Board, and include 'Bubble Level', which makes use of the on board accelerometer to move a circle on the LCD, 'Temperature Alarm' which displays the board temperature and sets off an alarm if the user chosen temperature is reached, and RTOS demo that runs multiple threads to carry out multiple tasks 'at once'. The Internet Clock demo also ran flawlessly, after transferring the program I plugged an ethernet cable into my router and the other end into the Application Board's ethernet port, pressed reset on the main board and after it obtained the IP address the LCD showed the date and time updated every second. Unfortunately the Websockets for Sensor Data demo didn't work as at the time of trying (2024) as sockets.mbed.org server, which is required to view the sensor data, has been discontinued. This is confirmed on this page:

https://os.mbed.com/cookbook/Websocket-and-Mbed

For accessing the source code you will find that the Import program button will take you to a page announcing that the Mbed Online Compiler has been retired and clicking on the Try Keil Studio Cloud button will take you to a page where you can open Keil Studio Cloud but it won't actually load the project. Instead, what you need to do is click on a project's link (e.g. app-board-Bubble-Level) and you will be taken to another page, select the Home tab if not already selected, and click on either the zip or gz links to the right of 'Download repository:'. Once downloaded you can extract the file and open in Mbed Studio. There may be some tweaking needed as the examples were designed for Mbed OS 2 but Mbed Studio supports 5 and above.

Note: the Export to desktop IDE button will lead to a page error.

If you would rather use the online editor then click on the Import into Keil Studio button and it will load into the online IDE. Even if your board won't work with the online editor, as was the case for me, simply select the Build target as 'mbed LPC1768' and click the Build project button. After building you will be able to download the bin file, which you can save to the mbed board, press the board's reset button and the program will run. Unfortunately, you won't be able to get serial output from the board if it doesn't work with the online IDE but you can use Mbed Studio to see the serial data as long as it detects the board then you can press reset and the serial output will appear in the IDE's serial monitor.

Another page with examples for the Application Board can be found at:

https://os.mbed.com/components/mbed-Application-Board/

Note: some of the projects have not been finished at the time of writing this article.

There are no downloadable bin files but you can access the source code in the same way mentioned for the previous site. The page also has a link to the Application Board schematic.

I will go over the examples I tried out and any issues I had:

Joystick (app-board-Joystick - main.cpp)

A very simple test of the Application Board's joystick, pressing in one of the four directions causes the corresponding LED to light on the mbed board, pressing the joystick button causes all four leds to light at once.

Analog Out (app-board-AnalogOut - main.cpp)

Plays a tone through headphones plugged into the Out headphone socket, the frequency adjustable by Pot 1. While this demo will build fine in the online IDE, if you try to build it in the offline IDE you may have issues with wait() being deprecated, as it was removed in Mbed OS 6. One solution is to create an empty Mbed OS 5 program and copy the code into main.cpp. If you want to use Mbed OS 6+ then you will need to swap wait() for ThisThread::sleep_for() for C++ programs and thread_sleep_for() for C programs. Keep in mind, however, that wait() takes a float representing time in seconds whereas sleep_for() and thread_sleep_for() take an uint32_t for the time in ms.

Analog Out (AppBoard_Waveplayer)

The main page for the demo can be found at:

https://os.mbed.com/users/4180_1/notebook/application-board-waveplayer-demo/

To be able to play a wav file you need to copy such a file to a flash drive (a file is provided for download called sample.wav), the drive needs to be inserted into the Application Board's full size USB port. Additionally, make sure the Application Board's two DIP switches (located near the mini USB connector) are in the on position to ensure USB host mode works. Then you can press reset on the mbed board and it will play the tune (sounds familiar...) but the speaker is very quiet and so also from connected headphones plugged into the Out socket - you can use an amplifier for higher volume. Press the board's reset button to play the tune again. Looking at the board's serial output you will see:

Hello, wave world!

Along with various lines about USBHost and the detected flash drive, which is handy for debugging.

RGB LED (app-board-RGB - main.cpp)

Cycles through a range of colours.


USB Host (mbed-App-USBFlash - main.cpp)

After downloading the program to the mbed board and pressing reset, after a few seconds the board's bottom left side LED will flash rapidly for 5 seconds while it's recording the pot1 value (it's a good idea to adjust it while this is happening to give it different values to record), then the LED will stay on when finished. You can then remove the flash drive, put it in a PC and inspect test.cv (you can import into Google Sheets, for example) and you should see values ranging from 0 to 1.

I wanted to try out a simple analog input test and found such a demo at:

https://os.mbed.com/teams/TVZ-Mechatronics-Team/wiki/Examples-of-analog-inputs-usage

These examples aren't geared toward the Application board necessarily but will work nonetheless.

The specific example I tried out was MAB_AnalogCommunication2 example, the code can be accessed as mentioned previously for the other two sites. The example outputs the current analog in value to the serial monitor every 1 second. Because it's outputting a floating-point value using printf() you may need to enable floating-point support for printf() - see the Tips section above. On the hardware side you will need a 3.5mm jack to plug into the In headphone socket, and a potentiometer (ideally at least 1K). Connect the pot's wiper to the audio plug's tip or ring connection (they are connected together on the Application Board) and one end of the pot to the audio plug's sleeve. Connect the other end of the pot to pin 40 (VOUT) of the mbed board, you can use the header pin to the right of the board. When you run the program, adjust the pot wiper and you should see in the serial monitor the value change between 0 and 1.

All content of this and related pages is copyright (c) James S. 2024