Create New Keil Project for ARM7 LPC2148

In previous tutorial, we have quickly gone through how to load or program HEX file onto LPC2148 MCU using Flash Magic. This post is all about how to Create new Keil project for ARM7 LPC2148 Microcontroller. We’ll cover each and every step one by one. To keep simplicity we’ve provided text as well as video. You can follow anyone according to your comfort. Installation of MDK-ARM Keil uVision4 is pretty straight forward. We just have to fill form and get setup file. Evaluation version of Keil for ARM is available to download click here.

Free Course Signup

MDK-ARM Keil µVision:

This is free software (evaluation version) which solves many of the pain points for an embedded system developer. This software is an Integrated Development Environment(IDE), which integrated text editor to write program, a compiler and it will convert your source code into HEX file. Here is simple guide to start working with Keil µVision which can be used for:

  • Writing programs in C/C++ or Assembly
  • Compiling and assembling programs
  • Debugging programs
  • Creating HEX, AXF and BIN file
  • Test program without real hardware

Here is step by step guide to create fresh new project for ARM7 LPC2148 Microcontroller using MDK-ARM µVision4.

  • Once we’ve installed Keil, click on Keil µVision4 icon. This will appear on desktop after installation Keil.
  • Click on Project menu, and then hit on New uVision Project
Create New Project Keil LPC2148
  • Create new project folder named as Blinky.
Give Name to New Keil Project
  • Select target Device vendor. In this case NXP (founded by Phillips)
Select Device in Keil
  • Expand NXP icon and select specific chip i.e. LPC2148 After this, a dialog box will pop-up on screen. This will ask you whether to copy startup code for LPC2148. Click on Yes.
Add Startup File For LPC2148
  • Then we’ll get basic workplace to get start with writing code in. When we expand Target1 in left project pane. We see Startup.s is already added which is necessary for running code in Keil.
Ready Workplace For LPC2148


code will not run without Startup.s file. Because startup code executes immediately upon reset of the target system and performs the following listed operations.

  1. Defines interrupt and exception vectors
  2. Configures the CPU clock source (on same device)
  3. Initializes the external bus controller
  4. Copies the exception vectors from ROM and RAM for systems with memory remapping
  5. Initializes other low level peripherals, if necessary
  6. Reserves and initializes the stack for all modes
  7. Reserves the heap
  8. Transfers control to the main C function
  • Now click on File menu and hit on New.
Create New File Keil
  • Write code to blink LED in C and FileName.c Save. NOTE:Don’t forget to save as with .c extension
Add C File To Keil Project
  • Once we save file as blinky.c. We’ll quickly get complete code with syntax highlighted.
Code Highlighted In Keil LPC2148
  • Now we can add blinky.c file by adding it to Group Source 1.
Add Source File To Project LPC2148
  • Add blinky.c file
Add File To Keil Project
  • Now right click on Target 1 and hit on Options for target “Target 1”
set_options_for _target_lpc2148
Set Options For Target LPC2148
  • In Options for target “Target 1”. In output tab, click on check box Create HEX File.
Set Output Keil LPC2148
  • Then go to Linker tab. Click on Use Memory Layout for Target Dialog
Setup Linker Option Keil LPC2148
  • Then hit on Rebuild All target files
Rebuild The Keil Project LPC2148
  • Now we can see Build output. If we check project directory at this point. We’ll find generated HEX file. Later on we’ll use it to load or burn into LPC2148 MCU using Flash Magic.
Build Output Keil LPC2148
HEX File Generated Using Keil LPC2148
The only part left here is to setup Flash Magic and load HEX file into LPC2148 Microcontroller. Here are some pictures or I recommend you to watch video on this post to see step by step configuration and final output.
Basic Setting FlashMagic LPC2148


setup_options for_flashmagic_lpc2148
Setup Options For Flash Magic LPC2148


Setup Hardware Configuration FlashMagic

STEP-4 Finally It’s Done….!!!!

FlashMagic Loading Finished LPC2148

We hope this post will provide you all information needed to create new keil project for ARM7 LPC2148.

Get Free Courses & Webinars
You'll receive only high quality learning material, tips & tricks
I agree to have my personal information transfered to MailChimp ( more information )
We respect your privacy

About Umesh Lokhande

Umesh Lokhande holds a Master degree in Scientific Instrumentation from University of Applied Sciences Jena, Germany. and has previously worked at Orbotech, Alere Technologies etc. Umesh is also a founder and first author of BINARYUPDATES.COM


Register | Lost your password?