Guide To Installation And Use Of Keil Μvision2 Software
Guide To Installation And Use Of Keil Μvision2 Software
Your Project / Working Directory Use to set location and create new folder
{
while(1) /*------------------------------------------------
Note that an embedded program never exits (because
there is no operating system to return to).
It must loop and execute forever. So, "while(1)" loop.
------------------------------------------------*/
{
P0=0xaa; // Sends High and Low on alternate Pins of Port 0
P0=0x55; // Sends High and Low on Port 0 in reverse order
}
}
Program is written. All text between ‘/*’ and ‘*/’ or followed by ‘//’ is
not part of the code and is just comments / documentation
Now save the file from: File Menu Save as File Name
Note that the file name must be written with dot c (.c) extension
Note:
In case the Program is written in assembly language,
the file must be saved with dot asm (.asm) extension.
Also note that the moment we save the Text* file (with
“.c” or “”.asm” extension), the code in the file gets a
standard colour scheme
Now click on ‘+’ sign of folder “Target 1” shown in
“Project Window” on the left side of IDE
Click to
Open
Project Window
A “Source Group” folder will appear containing no
source code file as shown
We have created a project named “First” and also
written a program in C language (LEDs.c in this
example) and saved it with dot c extension, but both
Project and source code files exist separately. As
shown by empty Source Group folder.
So, we have to add source code file into the Project
Right Click on: Source Group
Click: Add files to Group “Source Group 1”
Right
Click
A window showing source code files will appear.
Select , Add and Close.
The added file will be shown in “Source Group” folder
in Project Window
Click to Open
Now go to Project Menu Options for Target ‘Target 1’
or simply right click “Target 1” in Project Window
Options for Target ‘Target 1’
Right Click
In Options for Target Window, under Target Tag
a) Edit Xtals Freq. to 11.0592 MHz (replacing 24.0)
b) and Code Rom Size to Small program 2K, or less
Similarly, under Output Tag Check (√) the
Create Hex File Check Button
Click to
Check
Now Project is complete with all necessary settings
and is to be built (Compiling and Linking Process)
So, Project Build Project or Use Short-cut
See the result of Build target command in the Output
Window
Output Window