KEIL uVISION3
- Go to the start up menu and click on the KEIL uVISION3 or click on the shortcut of KEIL uVISION 3 on desktop.
2. The following window can be seen on the screen.
- Now we need to make a new project. For that, we click on the Project→New Project.
- As you click on the new project a window will open. Select a location for saving your project in a newly created folder. Here we name the folder ‘Test’.
5. We now create another folder named ‘Toggle’ in the ‘Test’ folder.
6. Now, we create a new file, named blink in the ‘Toggle’ folder and we save it as shown below.
7. As we save the blink file, a new window opens where you have to choose the target microprocessor as I have chosen a Philips LPC2129.
8. As we click on our chosen processor, a new dialog box opens, we click Yes.
9. Now a window is opens, now click on the NEW(Ctrl+N) and write the code in the window . As I wrote this code:
/* ……………. BLINKY.C: LED Flasher
#include <LPC21xx.H> /* LPC21xx definitions */
#include “Timer.h”
extern long volatile timeval;
void wait (void) { /* wait function */
unsigned long i;
i = timeval;
while ((i + 10) != timeval); /* wait 100ms */
}
int main (void) {
unsigned int j; /* LED var */
IODIR1 = 0xFF0000; /* P1.16..23 defined as Outputs */
init_timer();
while (1) { /* Loop forever */
for (j = 0×010000; j < 0×800000; j <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */
IOSET1 = j; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = j; /* Turn off LED */
}
for (j = 0×800000; j > 0×010000; j >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */
IOSET1 = j; /* Turn on LED */
wait (); /* call wait function */
IOCLR1 = j; /* Turn off LED */
}
}
}
If you have written code now save it with Ctrl+s and name it main with extension ‘c’. This will be saved in toggle.
The screen will show like this.
10. Now, we add main.c to Target 1. This Target 1 will be shown on left upper part of the display. Now go and right click on target 1 →Source group 1→Add Files to Group ‘Source Group 1’.
11. Now, since we are using the setup for the first time, we need to do the settings of the complier and linker. Now right click on the Target1→Manage components→ Folder /extension.
To select GNU, add GNU compiler and write “arm-uclibc-“ in the GNU –prefix tool. There is a Cygnus tool which provides LINUX environment for our compiler.
12. We now make settings for linking our program to compile tools. For this we have to right click on the TARGET 1→Options for Target ‘Target 1’.
The new window will appear like this.
The menu bar of this new window can be seen as Device, Target, Output, CC, Assembler, Linker, Debug, Utilities.
We need to do the settings for each menu bar as shown below:
OUTPUT
Check and click on Create Executable, Debug Information, Create HEX file.
LISTING
Check and click on Assembler Listing & Linker Listing with all their respective sub menu such as High level sources, Symbols, Memory Map etc.
CC
Check and click on Enable APCS and Support calls between ARM & THUMB instruction set.
ASSEMBLER
Check and click on Enable ARM/THUMB interworking.
LINKER
Check and click Enable Garbage collection & browse the Linker Script File in the following order.
Check and click on the option shown in figure. Now we have to link the file of Linker script File. Click on the browse button and follow the order.
C Drive→KEIL→ARM→GNU→BOARD→KEIL→MCB2100→BLINKY→Flash ld
DEBUG
Check and click the following tabs.
UTILITIES
Check and click on the Use External Tool For Flash Programming.
13. Now when all this setting is done, we build our file.
First build up is used to check on C syntax not the Logic of your program and third Rebuilt save our Target and create HEX file. To built our Program we must first check our c syntax and then build the program by clicking on the “Rebuilt all the Target file”.
If the output window shows that TARGET NOT CREATED, then you must check settings of TARGET→OPTION FOR TARGET 1 & MANAGE SETTING properly.
14. Now as we check our program logic, we start our debugging.
15. After starting the debugging process, we should go to the peripherals and select the device that we have used in our program. For example, as per my program I have to see IO port 1, hence I choose Peripherals → GPIO → PORT 1.As we click here, a window will open as shown in the picture.
Now click on the Step into icon to run your program step wise.
16. This is the procedure to use KeiluVision3 with GNU compiler for simulating ARM instructions.
I was reading through some of your articles on this website and I believe this website is really informative ! Retain posting.