Difference between revisions of "LPC1768: Keil Project For Hex File"
Line 1: | Line 1: | ||
=Objective= | =Objective= | ||
In this tutorial we will see how to setup a keil project to generate .hex file for LPC1768<br><br> | In this tutorial we will see how to setup a keil project to generate .hex file for LPC1768<br><br> | ||
+ | [[File:00_Lpc7168_Keil.png]]<br><br> | ||
− | + | Open the Keil software and select the New Microvision project from Project Menu as shown below.<br> | |
− | + | ||
− | + | ||
− | Open the Keil software and select the New Microvision project from Project Menu as shown below. | + | |
[[File:Lpc1768_Keil_01.png]]<br><br> | [[File:Lpc1768_Keil_01.png]]<br><br> | ||
− | Browse to your project folder and provide the project name and click on save. | + | Browse to your project folder and provide the project name and click on save.<br> |
[[File:Lpc1768_Keil_02.png]]<br><br> | [[File:Lpc1768_Keil_02.png]]<br><br> | ||
− | Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP:LPC1768) and click on OK. | + | Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP:LPC1768) and click on OK.<br> |
[[File:Lpc1768_Keil_03.png]]<br><br> | [[File:Lpc1768_Keil_03.png]]<br><br> | ||
− | Select the controller(NXP:LPC1768) and click on OK. | + | Select the controller(NXP:LPC1768) and click on OK.<br> |
[[File:Lpc1768_Keil_04.png]] | [[File:Lpc1768_Keil_04.png]] | ||
Line 21: | Line 19: | ||
[[File:Lpc1768_Keil_05.png]] | [[File:Lpc1768_Keil_05.png]] | ||
− | Create a new file to write the program. | + | Create a new file to write the program.<br> |
[[File:Lpc1768_Keil_06.png]] | [[File:Lpc1768_Keil_06.png]] | ||
− | Type the code or Copy paste the below code snippet. | + | Type the code or Copy paste the below code snippet.<br> |
[[File:Lpc1768_Keil_07.png]] | [[File:Lpc1768_Keil_07.png]] | ||
<html> | <html> | ||
Line 30: | Line 28: | ||
</html> | </html> | ||
− | After typing the code save the file as <b>main.c</b>. | + | After typing the code save the file as <b>main.c</b>.<br> |
[[File:Lpc1768_Keil_08.png]] | [[File:Lpc1768_Keil_08.png]] | ||
Line 36: | Line 34: | ||
[[File:Lpc1768_Keil_09.png]] | [[File:Lpc1768_Keil_09.png]] | ||
− | Add the main.c along with system_LPC17xx.c. | + | Add the main.c along with system_LPC17xx.c.<br> |
[[File:Lpc1768_Keil_10.png]] | [[File:Lpc1768_Keil_10.png]] | ||
− | Build the project and fix the compiler errors/warnings if any. | + | Build the project and fix the compiler errors/warnings if any.<br> |
[[File:Lpc1768_Keil_11.png]] | [[File:Lpc1768_Keil_11.png]] | ||
− | Code is compiled with nor errors. The <b>.hex</b> file is still not generated. | + | Code is compiled with nor errors. The <b>.hex</b> file is still not generated.<br> |
[[File:Lpc1768_Keil_12.png]] | [[File:Lpc1768_Keil_12.png]] | ||
− | Click on <b>Target Options</b> to select the option for generating .hex file. | + | Click on <b>Target Options</b> to select the option for generating .hex file.<br> |
[[File:Lpc1768_Keil_13.png]] | [[File:Lpc1768_Keil_13.png]] | ||
− | Set IROM1 start address as 0x0000. | + | Set IROM1 start address as 0x0000.<br> |
[[File:Lpc1768_Keil_14.png]] | [[File:Lpc1768_Keil_14.png]] | ||
Line 58: | Line 56: | ||
[[File:Lpc1768_Keil_16.png]] | [[File:Lpc1768_Keil_16.png]] | ||
− | Check the project folder for the generated .hex file. | + | Check the project folder for the generated .hex file.<br> |
[[File:Lpc1768_Keil_17.png]] | [[File:Lpc1768_Keil_17.png]] | ||
<br><br><br><br> | <br><br><br><br> |
Revision as of 00:29, 26 March 2016
Objective
In this tutorial we will see how to setup a keil project to generate .hex file for LPC1768
Open the Keil software and select the New Microvision project from Project Menu as shown below.
Browse to your project folder and provide the project name and click on save.
Once the project is saved a new pop up “Select Device for Target” opens, Select the controller(NXP:LPC1768) and click on OK.
Select the controller(NXP:LPC1768) and click on OK.
As LPC1768 needs the startup code, click on Yes option to include the LPC17xx Startup file.
Create a new file to write the program.
Type the code or Copy paste the below code snippet.
After typing the code save the file as main.c.
Add the recently saved file to the project
.
Add the main.c along with system_LPC17xx.c.
Build the project and fix the compiler errors/warnings if any.
Code is compiled with nor errors. The .hex file is still not generated.
Click on Target Options to select the option for generating .hex file.
Set IROM1 start address as 0x0000.
Enable the option to generate the .hex file