Saturday , September 23 2017

Create Project using Keil uVision4 for LPC1768 Microcontroller

In this tutorial, I am going to show you how to create project using Keil uVision4 for LPC1768 Microcontroller. I believe you have already installed Keil µVision and Co-MDK Plug-in + CoLinkEx Drivers required for CoLinkEx programming adapter. If you are not yet then please follow previous tutorial.

This is probably first tutorial in this series where we’ll create fresh new project from scratch and program NXP LPC1768 Microcontroller. Lets get start to create new µVision project to blink LED by adding simple delay. First create a test folder on desktop to manage your project and related files. There would be several files to take care during whole procedure. Copy system_LPC17xx.c and main.c file into test folder. I will explain to you later on about what are those files?

Launch/Open “Keil µVision4” default workplace and then go to Project –> “New µVision Project and then browse your project into test folder on the desktop and give it name as blinky  and hit on save.

create-new-µVision-project
Create New µVision Project
give-name-to-uVision-project
Give Name to µVision Project

At this stage we get pop-up box onto the screen. There we have to select “LPC1768” from NXP and then hit on “ok”

Select Type of Microcontoller in uVision
Select Type of Microcontoller in uVision

Now it ask you to copy Startup_LPC1768xx.s and hit on Yes”

add-startup-file-to-uVision-project
Add Startup File to uVision Project

Now right click on Target 1 in project pane and click on Manage Project items…

manage-file-in-uVision4-project
Manage File in uVision4 Project

Here click on Add Files… and select system_LPC17xx.c and main.c file. Now we just need to hit on “Add” button and then Close that dialog box and hit on “Ok”

add-system-file-and-source-code
Add System File and Source Code

At this point we need to configure programming adapter CoLinkEx. So click on Options for Target on menu bar and then go to Debug” –> select “CooCox Debugger from drop down menu.

setup-coocox-programmer-to-uVision4
Setup CooCox Programmer to uVision4

then hit on Setting –> choose SYSRESETREQ from drop down menu –> hit on Ok

set-frequency-and-reset-parameter
Set Frequency and Reset Parameter

Now go to “Utilities” –> uncheck “Use Debug Driver” and then choose CooCox Debugger” from drop down menu.

set-utility-option-for-lpc1768-microcontroller
Set Utility Option for LPC1768 Microcontroller

Here again we have to go to “Setting” –> click on “Add” –> and choose “LPC17xx IAP 512kB Flash” from list and hit on “ok”

set-flash-memory-for-lpc1768-microcontroller
Set Flash Memory for LPC1768 Microcontroller

Finally we have done with all house keeping stuff for our project and the only thing left is to build and load output file into microcontroller. So after returning back to our workplace. Hit on Build icon on main menu and once we build successfully without any error. Then simply hit on Load”. And that’s it…!!!!

build-load-file-into-lpc1768-microcontroller
Build and Load file into LPC1768 Microcontroller

Now we can see that LED connected to P1.29 is blinking with delay. Download complete project by simply Click Here. I think this is enough for today. In next tutorial we would discuss more about program i.e main.c file and also will have little fun with setting different delay. I hope you will find this tutorial educational. I wish you great time and see you in next tutorial.

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

2 comments

  1. Thank you so much for the tutorial. Am actually using the KEIL uVision version 5, and facing a few problems. It would be great if you could help. The device option of “LPC17xx IAP 512kB Flash” does not exist in the settings option for Device debugger. What could the possible problem here?

Leave a Reply

Your email address will not be published. Required fields are marked *

Login

Register | Lost your password?