The Islamia University of Bahawalpur
Faculty of Engineering & Technology
Sir Sadiq Institute of Technology
LAB MANUAL Embedded System 5TH Semester
LAB EXPERIMENT # 01
Introduction and Installation of Keil µVision
Student Name: Roll No:
Lab Instructor Signatures: Date:
OBJECTIVES:
Introduction to arm’s Keil µVision
Download and installation of Keil µVision
How to use Keil for Assembly Language
1. Introduction to arm KEIL µVision
Keil µVision 5 is an integrated development environment (IDE) specifically designed for ARM
microcontroller development. It is part of the Keil MDK (Microcontroller Development Kit)
and provides a comprehensive set of tools for writing, compiling, and debugging embedded
software.
Embedded Systems Developers: Keil µVision 5 is primarily targeted at developers
working on embedded systems, especially those using ARM-based microcontrollers. It
supports a wide range of ARM Cortex-M and Cortex-R processor families.
Integrated Development Environment (IDE): µVision 5 serves as an all-in-one
solution, incorporating a code editor, compiler, linker, debugger, and simulator. This
integration streamlines the development workflow and facilitates a seamless transition
between coding, building, and debugging.
ARM Cortex-M Support: It provides robust support for the ARM Cortex-M processor
series, which is widely used in microcontroller applications due to its energy efficiency
and performance.
ARM Compiler: µVision 5 comes with the ARM Compiler, which is optimized for
generating efficient code for ARM architectures.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Debugger: The integrated debugger allows developers to set breakpoints, examine
variables, and step through code for effective debugging. It supports both source-level
and assembly-level debugging.
Device Simulation: The IDE includes a simulator that allows developers to test their
code without the need for physical hardware. This is beneficial during the early stages of
development for logic verification and testing.
Peripheral Configuration: µVision 5 supports easy configuration of on-chip
peripherals, such as GPIO, timers, UART, and more. This simplifies the process of
interfacing with the hardware.
Project Management: Developers can organize their code and configuration settings
using project files. This facilitates managing multiple source files, libraries, and project
settings.
Real-Time Operating System (RTOS) Support: For projects requiring real-time
capabilities, µVision 5 supports the integration of various real-time operating systems
(RTOS).
Community Resources: Keil has an active user community where developers can find
support, share knowledge, and discuss challenges related to ARM microcontroller
development using µVision.
Vendor Independence: While primarily associated with ARM, Keil µVision 5 supports a
variety of microcontroller vendors, providing flexibility in choosing hardware platforms.
1.1 For Assembly Language:
Level of Abstraction:
In the context of assembly language programming, Keil µVision 5 allows developers to write
low-level code that directly corresponds to the machine code instructions of the target
microcontroller. It provides access to registers and allows precise control over hardware
resources.
Instruction-Level Debugging:
The debugger in µVision 5 provides capabilities for debugging at the assembly language
level. Developers can step through instructions, examine register values, and observe the
direct impact of each assembly instruction on the microcontroller.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Device-Specific Details:
Peripheral Configuration: Assembly language programming often involves direct
manipulation of device registers. Keil µVision 5 facilitates the configuration of specific
hardware peripherals through assembly code, allowing fine-grained control over the
microcontroller's features.
1.2 For C Language
High-Level Abstraction:
When using C in Keil µVision 5, developers benefit from a higher level of abstraction. They
can write code that is more portable and easier to understand compared to assembly
language. C abstracts away many low-level details, making it suitable for a broader range of
applications.
Compiler Optimizations:
The ARM Compiler integrated into µVision 5 is capable of generating optimized code from C
source files. Developers can take advantage of higher-level constructs while still achieving
efficient execution on the target microcontroller.
Code Portability:
Code written in C is generally more portable. Keil µVision 5 allows developers to write C code
that can be compiled for different microcontroller architectures with minimal modifications,
provided the necessary hardware-specific libraries are available.
Ease of Debugging:
Debugging C code is often more straightforward in Keil µVision 5. Developers can use the
debugger to step through C source code, set breakpoints, and inspect variables at a higher
level of abstraction.
Library Support:
Keil µVision 5 often includes C-based peripheral libraries, making it easier for developers to
interact with on-chip peripherals without delving into low-level assembly instructions.
Multitasking and RTOS:
For projects requiring real-time capabilities and multitasking, developers can integrate real-
time operating systems (RTOS) with C code, allowing for the development of complex
embedded systems.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
2. Download and Installation of Keil µVision
Step 1: Go to https://www.keil.com/download/product/ –>Download –> Product
Downloads –>Hit on C51 Setup. Enter your contact information with valid address, phone
number and email. Fill in all fields of form. Download is free for evaluation version.
Step 2: Then click on C51V954A.EXE and Download it on your computer.
Step 3: Next step is to run setup file C51V954A.EXE and then we’ll get pop-up box, hit on
Next and Proceed Installation.
Step 4: Read license agreement, check I agree to all the terms…., and click Next.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Step 5: Select Destination folder where you want to install Keil or default destination is
already there. And hit on Next.
Step 6: Fill up required fields with all relevant information and click on Next.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Step 7: Wait for installation completes and hit on Next.
Step 8: Tick on show release notes, deselect remaining (as per your choice) and click
on Finish.
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
3. How to Use Keil for Assembly Language
PROJECT > NEW µVISION PROJECT
Give some name and click SAVE
when prompted, select proper device that you're using (i-e ATMEL > AT89C51)
When prompted, select YES
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Click NEW button and write your code (Assembly or C language)
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
SAVE the file with proper extension as above
The code you have written gets highlighted
The Islamia University of Bahawalpur
University College of Engineering & Technology
Department of Cyber Security and Digital Forensics
LAB MANUAL Embedded System 5TH Semester
Right click SOURCE GROUP 1 as shown
Add the code you have written into the Project workspace