Professional Documents
Culture Documents
Experiment 6
Experiment 6
Experiment 6
OBJECTIVES:
(a) To study the environment of Keil μVision 4.
THEORY:
The μVision4 IDE is a Windows-based software development platform that combines a
robust editor, project manager, and makes facility. μVision4 integrates all tools including
the C compiler, macro assembler, linker/locator, and HEX file generator. μVision4 helps
expedite the development process of your embedded applications by providing the
following:
Full-featured source code editor
Device database for configuring the development tool setting
Project manager for creating and maintaining your projects
Integrated make facility for assembling, compiling, and linking your embedded
applications,
Dialogs for all development tool settings,
True integrated source-level Debugger with high-speed CPU and peripheral
simulator.
Advanced GDI interface for software debugging in the target hardware and for
connection to KeilULINK
Flash programming utility for downloading the application program into Flash
ROM,
Links to development tools manuals, device datasheets & user’s guides.
The μVision4 IDE offers numerous features and advantages that help you quickly and
successfully develop embedded applications. They are easy to use and are guaranteed
to help you achieve your design goals.
The μVision4 IDE and Debugger is the central part of the Keil development tool chain.
μVision4 offers a Build Mode and a Debug Mode. In the μVision4 Build Mode you
maintain the project files and generate the application.
In the μVision4 Debug Mode you verify your program either with a powerful CPU and
peripheral simulator or with the Keil ULINK USB-JTAG Adapter (or other AGDI drivers)
that connect the debugger to the target system. The ULINK allows you also to download
your application into Flash ROM of your target system. The figure below shows the Keil
μVision4.
Fig. 6.1 Menu Commands, Toolbars, and Shortcuts
The menu bar provides you with menus for editor operations, project maintenance,
development tool option settings, program debugging, external tool control, window
selection and manipulation, and on- line help. The toolbar buttons allow you to rapidly
execute μVision4 commands. A Status Bar provides editor and debugger information.
The various toolbars and the status bar can be enabled or disabled from the View Menu
commands. The following sections list the μVision4 commands that can be reached by
menu commands, toolbar buttons, and keyboard shortcuts. The μVision4 commands
are grouped mainly based on the appearance in the menu bar:
File Menu and File Commands
Edit Menu and Editor Commands
Outlining Menu
Advanced Menu
Selecting Text Commands
View Menu
Project Menu and Project Commands
Debug Menu and Debug Commands
Flash Menu
Peripherals Menu
Tools Menu
SVCS Menu
Window Menu
Help Menu
Creating Applications
This part describes the Build Mode of μVision4 and is grouped into the following
sections:
Create a Project: explains the steps required to setup a simple application and to
generate HEX output.
Project Target and File Groups: shows how to create application variants and
organized the files that belong to a project.
Tips and Tricks: provides information about the advanced features of the
μVision4 Project Manager. Create Project File Folder and Specify Project Name
To create a new project file select from the μVision4 menu Project – New – μVision
Project. This opens a standard Windows dialog that asks you for the new project file
name. You should you use a separate folder for each project. You can simply use the
icon Create New Folder in this dialog to get a new empty folder.
THEORY:
PROGRAM DEVELOPMENT PROCESS
First, create a new project named first with extension “.Uv2”.We will select the device
from NXP (founded by Phillips) family. The board available with us is LPC 2368. So we
will select every time this hardware. After giving the name adds the startup code of LPC
2300.S to the project file. After that the source codes save as text1.C. Add this file to the
Source Group 1. Build the project and Debug the project in simulator by selecting the
option for target 1. You can see the contents of user registers while running the program
step by step.
SAMPLE PROGRAM:
#include<stdio.h>
int main()
{
int a=1, b=2;
int c;
c=a+b;
}
OUTPUT:
OUTPUT:
MODIFICATION:
Write a program to perform subtraction and division on two numbers.
#include<stdio.h>
int main()
{
int a=10,b=3;
int c,d;
c=a/b;
d=a-b;
}
OUTPUT:
CONCLUSION:
In this experiment, we learnt about the keil μVision IDE. We understood various
features provided by the IDE. We also executed a basic embedded C program for LPC
2368 microcontroller. While executing we observed that μVision Compiler and
Assembler work together to perform the given program. Thus, writing a program in high
level language like C can reduce the work of the programmer by a huge margin as
compared to writing the same program in assembly language.
EXERCISE:
(1) What is significance of disassembly window?
Ans: Disassembly window is helpful to observe how user defined C code has been
mapped to the basic assembly program by assembler. We can also observe opcodes
for those assembly code instructions.
(2) What is significance of memory window? How to open it and modify it?
Ans: With the help of a memory window, we can observe the data stored at any
location in code memory or internal memory. To open it, click on View > Memory
Windows > Memory 1. The IDE allows a total of 4 memory windows to be opened at
once. In order to modify any of the content, double click on the memory address and
modify it.