How To Simulate a Program on Keil MicroVision Software - Tutorial





Keil Microvision is an Integrated Development Enviornment (IDE) tool developed for students, embedded system designers and developers to make their programming easier. The keil combines project management, source code editing, program debugging and simulation of a program in one platform. Here i am going to demonstrate you on How to Debug or Simulate a program on Keil uvision software. I recommend you to read my previous post about How to Program a Microcontroller? [Basic Steps].
In order to simulate a program on keil microvision software (or any) you should have an Error and Warning Free source program. Here i am demonstrating you the simulation of a sample Led Blinking Program.

Program Code in C Language



#include<reg52.h> 
sbit en=P1^1; 
void delay(); 
void delay() 
int i,j; 
for(i=0;i<1000;i++);
for(j=0;j<500;j++); 
main()
while(1)
delay(); 
en = 0; 
delay(); 
en = 1; 
}


Steps to simulate a Program on Keil Microvision Software.

1. Open the Software Keil uVision 3 from the Desktop menu.


2. Select Project > New Project, name the project such as Example and Select your Processor from the list. (Here i am using At89S51)
Keil simulation steps



3. Now click File > New and enter the program in that window.



4. Save the program as .C or .asm, if the program is in C or Assembly language. (I am using led blinker.c)

5. From Target1 menu on the workspace, right click on the Source Group1 and choose, Add files to group Source Group1 and add the file that we saved (Led blinker).



6. Now you can see the file, led blinker.c on the work space under Source group1.

7. Go to Project > Build Target and you can see errors and warnings in the program, if it is zero you can go to the next step (#8)





8. Select Debug > Start/Stop Debug Session.



9. Again, click on Debug > Run, and it will start the Simulation.

10. To View the output (Logic of the Program), Simply Go to
Peripherals > I/O Ports > Port1. (Which is defined in the program)
There you can see the pin1 is blinking according to the program.

You may also Like:-
Fingerprint Based Security system using At89S52



Kindly Bookmark and Share it:



0 comments so far: