Welcome to this series of tutorials. Hope you enjoy learning something new here.
This tutorial discusses setting up the environment and getting ready to start writing the code for ARM. The procedures to run the code and uploading the code to the microcontroller will be covered in the successive parts of the tutorial.
What am I using?
- LPC2148 mini board (ARM7)
- FT232 Breakout Board (USB to serial converter)
- Keil uVision4
- Flash Magic
Starting a new project
- Open Keil uVision4
- Click on Project -> New uVision Project…
- Enter project name and save
- From the opened dialogue box, select your controller. In my case: expand NXP and find LPC2148. Click OK.
- Click on Yes to add start up code. This file is necessary for booting the controller and executing the code we write. It contains certain necessary initializations.
- Now you are almost ready. We just need to add the source code/our program to the project.
- Right click on source group1 and Add files to group if you already have your C code ready.
- if you haven’t written the code yet, go to File -> New, type in your code and save with the ‘.c’ extension.
Setting the options for Target
- Right click on Target1 and click on options for Target.
- Check if the XTAL frequency matches the crystal frequency on the development board you are using.
- Click on the output tab and check the option, Create HEX file.
- Click on the linker tab and check, use memory layout from target dialog option and click OK.
- Now your ready to start coding!