Programming the LPC1114FN28

Created 19 Dec 2012, last modified: 14 May 2013

 

The LPC1114FN28 is a breadboard friendly MCU that most hobbyists will like and a great chip to get started in ARM embedded development.

It is sold in a DIP package and has a Bootloader installed, so programing it is very easy, requiring virtually zero supporting components.

Unlike most 32 bit MCUs this one can be easily placed in a breadboard, PCB or Perfboard without having to use any special tools or equipment.

Plugging it in for programming

You don't need a fancy development kit to test your code: a simple breadboard and a USB to TTL adapter will be enough as only 5 pins are necessary for this task

LPC1114 connections

Pins 21 and 22 should be connected to your power source, usually a voltage regulator, possibly a LM117, or your USB to TTL adapter 3.3V pin.

Pins 16 and 17 should be connected to your UART pins TX and RX respectively; RX on the MCU should be connected to TX on the UART and TX to RX.

Pin 24 should be connected to GND. When the MCU boots, this pin is tested and, if it is connected to GND, the program in flash memory will run. Connecting it to GND makes the chip run the boot-loader, allowing a program to be written to the MCU internal Flash memory.

Example program

Download and unzip the file vilaca.eu.lpc1114_102_led_blink.

This file is an example program that can be uploaded to the LPC1114 using the previous circuit.

It is a very simple program that uses PWM to blink a led on pin 18 every second. The led stays ON for exactly 1/2 second.

Once you upload it to the LPC1114 you can switch to the circuit bellow to run the program.

You can also download the full Keil project for this example.

Uploading the program with Flash magic

Flash magic is a free and easy to use tool that can upload program files to a large variety of microcontrollers.

Flash magic screenshot

Make sure you select the correct COM port where the USB to TTL UART is connected in your computer. In the screenshot above COM 5 is selected.

Flash Magic can only handle files in the .hex format and can be downloaded from: http://www.flashmagictool.com/

If you're using Linux there's a very good article on how to program this MCU using open tools at http://www.meatandnetworking.com.

Simple circuit for blinking led

The following is a simple circuit to make a led blink.

Since the MCU already has an internal oscillator very few parts are needed

LPC1114 circuit

Pins 18 is connected to a generic Led and resistor. I used a 330 Ω resistor for this setup.

Pins 22 and 23 should be connected to your power source.

This setup is enough to run a program blinking the LED and you can adapt it to your needs.

In this example pin 18 was selected because it is one of the timer output pins. In the sample program we set timer to do PWM with a cycle length of around 1HZ, that is one blink per second.

LPC1114 Pin reference

PINGPIOADTimersSPII2CUARTOther
1PIO0_8CT16B0_MAT0MISO0
2PIO0_9CT16B0_MAT1MOSI0
3PIO0_10CT16B0_MAT2SCK0SWCLK
4PIO0_11AD0CT32B0_MAT3
5PIO0_5SDA
6PIO0_6
7VDDA
8VSSA
9PIO1_0AD1CT32B1_CAP0
10PIO1_1AD2CT32B1_MAT0
11PIO1_2AD3CT32B1_MAT1
12PIO1_3AD4CT32B1_MAT2SWDIO
13PIO1_4AD5CT32B1_MAT3WAKEUP
14PIO1_5CT32B0_CAP0RTS
15PIO1_6CT32B0_MAT0RXD
16PIO1_7CT32B0_MAT1TXD
17PIO1_8CT16B1_CAP0
18PIO1_9CT16B1_MAT0
19XTALOUT
20XTALIN
21VDD
22VSS
23PIO0_0RESET
24PIO0_1CT32B0_MAT2CLKOUT
25PIO0_2CT16B0_CAP0SSEL0
26PIO0_3
27PIO0_4SCL
28PIO0_7CTS

LPC1114 Pinout Diagram

LPC1114 pinout

Useful downloads

If you haven't already, you can go to the NXP website and download a free version of the Keil environment and start coding: http://www.keil.com/dd/chip/6526.htm

To upload your finished program to the MCU you can use: http://www.flashmagictool.com/

External links

NXP product page for LPC1114FN28/102 http://www.nxp.com/products/microcontrollers/cortex_m0/lpc1100_x_l/LPC1114FN28.html


Copyright © 2013 João Vilaça