How to Create a Project in Keil Microvision Software?
Last Updated :
24 Mar, 2022
A Keil Microvision software is an IDE for executing assembly language programs and embedded c programs you can create a hex file in Keil Microvision software, that's why it is the best software for creating projects that are related to hex files such as LCD Interfacing, Stepper motor interfacing, traffic light system and projects related with robotics because in all of these projects we need a hex file of programs, after loading this hex file in IC and by inserting this IC in hardware kit you can run your project. in this article, you are going to create a demo project step by step in Keil Microvision software.Â
Creating a Project in Keil Microvision Software
Let's create a traffic light system project step by step:
Step 1: Open your Keil Microvision software, click on project select new Microvision project.

Step 2: Give a proper name to your project and save it with extension .c  because in this demo project we are using embedded c language.

Step 3: Now select a microchip AT89S52 and click on ok.

Step 4: A project window will get open on the right side you will see target 1 click on that and then double click on source group 1, then select your previously saved file and add it to the source group and close it.Â

Step 5: Now double click on the file that is visible below the source group 1, a plain text area will get open.

Step 6: Type your program in the plain text area and then click on build for checking errors then click on rebuild.
 Here is the source code for the traffic light system. This source code is in embedded c language
C
// C program for traffic light system
#include<reg51.h>
void delay(int);
void delay(int itime);
void main()
{
P0 = 0x00; //Clears content of port0
P1 = 0x00; //Clears content of port1
while(1)
{
P0 = 0xDB; //First route is open for traffic flow
P1 = 0xDE; //First route is open for traffic flow
delay(1000); // Long delay
P0 = 0xDD; //First route switching for traffic flow
P1 = 0xDE; //First route switching for traffic flow
delay (100); // short delay
P0 = 0xF6; // Second route is open for traffic flow
P1 = 0xDE; // Second route is open for traffic flow
delay(1000); // Long delay
P0 = 0xEE; // Second route is open for traffic flow
P1 = 0xDE; // Second route is open for traffic flow
delay(100); // short delay
P0 = 0xDE; // Third route is open for traffic flow
P1 = 0xDB; // Third route is open for traffic flow
delay(1000); //Long Delay
P0 = 0xDE; // Third route is open for traffic flow
P1 = 0xDD; // Third route is open for traffic flow
delay(100); // Short Delay
P0 = 0xDE; // Fourth route is open for traffic flow
P1 = 0xF6; // Fourth route is open for traffic flow
delay(1000); // Long Delay
P0 = 0xDE; // Fourth route is open for traffic flow
P1 = 0xEE; // Fourth route is open for traffic flow
delay(100); // short delay
}
}
void delay(int itime)
{
int i,j;
for(i = 0; i < itime; i++)
for(j = 0; j < 2000; j++);
}
Step 7: Click on debug start debug section, for checking your code is running or not click on peripherals select input-output ports that you use in your program.
 Step 8: Click on debug and run the program you will see some changes in the ports that you selected which means your code is correct and running perfectly.

Step 9: Now click on the project select option for targets,Â

Step 10: Write the Xtal frequency as 11.0592Â

Step 11: Now click on the output for selecting the folder for keeping your hex file, select folder, and then click on create HEX file and press ok.

Step 12: Again build and rebuild your program, you will get a message creating a HEX file.

Step 13: Check created hex file on the folder that you have selected previously you didn't understand anything in created hex file for giving this traffic light system project live you need to transfer this hex file to the microprocessor (8051) then you need to attach this microprocessor chip to the hardware kit of traffic light system.
Here is the source code for traffic light system:
Note: This source code is in embedded c language
C
#include<reg51.h>
void delay(int);
void delay(int itime);
void main()
{
P0=0x00; //Clears content of port0
P1=0x00; //Clears content of port1
while(1)
{
P0=0xDB; //First route is open for traffic flow
P1=0xDE; //First route is open for traffic flow
delay(1000); // Long delay
P0=0xDD; //First route switching for traffic flow
P1=0xDE; //First route switching for traffic flow
delay (100); // short delay
P0=0xF6; // Second route is open for traffic flow
P1=0xDE; // Second route is open for traffic flow
delay(1000); // Long delay
P0=0xEE; // Second route is open for traffic flow
P1=0xDE; // Second route is open for traffic flow
delay(100); // short delay
P0=0xDE; // Third route is open for traffic flow
P1=0xDB; // Third route is open for traffic flow
delay(1000); //Long Delay
P0=0xDE; // Third route is open for traffic flow
P1=0xDD; // Third route is open for traffic flow
delay(100); // Short Delay
P0=0xDE; // Fourth route is open for traffic flow
P1=0xF6; // Fourth route is open for traffic flow
delay(1000); // Long Delay
P0=0xDE; // Fourth route is open for traffic flow
P1=0xEE; // Fourth route is open for traffic flow
delay(100); // short delay
}
}
void delay(int itime)
{
int i,j;
for(i=0;i<itime;i++)
for(j=0;j<2000;j++);
}
Similar Reads
How to Create a Maven Project in Eclipse IDE?
Maven is a powerful project management tool that is based on POM (project object model). It is used for project build, dependency, and documentation. It simplifies the build process like ANT. But it is too much advanced than ANT. In short terms we can tell maven is a tool that can be used for buildi
2 min read
Blink LED in Arm Cortex Microcontroller using Keil software
The ARM Cortex-M4 is a 32-bit processor core that is widely used in microcontrollers for embedded systems. It is designed to be highly efficient, and low-cost. The Cortex-M4 architecture is based on the ARMv7 instruction set architecture and It's capable of handling up to 4GB of memory address space
6 min read
How to Create a Dynamic Web Project in Eclipse/Spring Tool Suite?
Eclipse is an Integrated Development Environment (IDE) used in computer programming. It includes a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development. Eclipse is written mostly in Java and its primary use is for dev
2 min read
Create custom post type in WordPress
The WordPress software is very handy and flexible to use as it allows not only the use of different posts and webpages but it also allows the use of the customized created post types with different types of users. The customizable post types in the WordPress software allow the user to normal and reg
5 min read
Creating Apps Using App Designer in MATLAB
MATLAB is a powerful, high-level programming language. Matlab is widely used for designing systems by engineers and scientists and we all know that the best way to represent any idea is by using a simple but effective GUI. Matlab app builder provides you the power to build different apps, to represe
3 min read
Arduino Integrated Development Environment (IDE) v1
Arduino devices are the new face of electronics engineering. The ability of Arduino to program electronic devices and integrate them into larger applications makes Arduino the most common choice of engineers in today's world. To work with Arduino, it is necessary to be aware of the construction of A
14 min read
How to Download and Install Autodesk 123D Design on Windows?
Autodesk 123D is computer software that is made for 1D, 2D, and for 3D graphical designing used by UI/UX designers or an engineer. It is free and open-source software that is capable of running on Windows, Linux, macOS, etc. The development credit goes to Autodesk. It was first launched in 2009. it
2 min read
App Building Components in MATLAB
MATLAB provides an easy-to-implement solution for your ideas. You can represent your ideas in a GUI-friendly way using the MATLAB App Builder. Matlab app builder is very simple to use, which consisted of two parts, i.e., designing and coding part. The best part of Matlab App Builder is its ready-to-
6 min read
What is LabVIEW?
Graphical Programming Technique is a technique where VISUAL BLOCK Connections are used to code instead of text which makes it easy for non-coders to implement algorithms.LabVIEW(Laboratory Virtual Instrument Engineering Workbench) is the first implementation of graphical programming to date, it cont
5 min read
How to Execute Assembly Language Programs in Keil Microvision?
An assembly language programs are the statements that are assembly language instructions from an instruction set or an assembler's directives. In this article, we are going to see how to execute these assembly language instructions or assembler directives in Keil Microvision software. Keil Microvisi
2 min read