Amruta (talk) 19:22, 11 March 2015 (IST)


Sample Project for LPC1768

Let’s start with a simple LED blinking program.

Launch the Keil application and follow the steps below :


1. Go to the ‘Project’ menu from menu bar, select ‘Close Project’ option if there is already an open project.

This option will be available only if there is an open project.

Now select ‘New µVision Project’.


Keil 1.png


2. Select the folder where you want to create the project and give project name.

It’s better to create a new project in a new folder always.


Keil 2.png


3. To select the device as LPC1768 follow NXP -> LPC1768. You can see the device description in the right tab.


Keil 3.png


4. A window will pop up asking whether to add ‘Startup file’ to your project .

The ‘Startup file’ is required only when you want to go with C programming.

So, here we will click ‘Yes’ as we will be coding with C.


Keil 4.png


5. In the ‘Project’ tab if you expand ‘Target 1 -> Source Group 1’ you will see the ‘startup file’.

Click the ‘New’ tool located on toolbar.

A file with name ‘Text1’ will be created in editor. Write your code here.

Don’t forget to include lpc17xx header file and the function ‘SystemInit()’.


Keil 5.png


6. Save the file in the same directory where you created your project with the extension .c You can notice the colour and font changes in the file.


Keil 6.png


7. Now we need to add this file to the project.

To do this, right click on ‘source Group 1’ and select the option ‘Add files to the Source Group 1’.


Keil 7.png


8. Add the .c file, say, LED_Blink.c

Also you should add system_LPC17xx.c file to your project.

You can find this file at “C:\Keil\ARM\Startup\NXP\LPC17xx”.

No need to copy this file to your project folder. Simply add the file by above procedure.


Keil 8.png


9. You can see both files under ‘Source Group 1’.

Now build the project by clicking ‘Build’ tool on toolbar.


Keil 9.png


10. You can see the errors in ‘Build Output’ tab (down) , if any. Remove the errors and rebuild the project.

After successful compilation following window will appear.


Keil 10.png


11. Keil doesn’t create image file until you specify the option.

For this click ‘Target Option’ on toolbar.

In the window ‘Options for Target’, under ‘Target’ tab give crystal frequency in MHz


Keil 11.png


In the ‘Output ’ tab check the option ‘Create Hex File’ and click OK.

Rebuild the project.


Keil 12.png


12. You can see that hex file is created.

It will be in the your project folder.


Keil 13.png