Skip to main content

Learning about 8051 simulator like keil micro-vision.

Aim: 

To study about Keil simulator.

Apparatus: 

A computer loaded with Keil Microvision2 or higher version.

Procedure: 

   
                   If we want to develop embedded system program for 8051 using Keil software, we need to follow these steps.   
1. Create work directory.
2. Create a new project.
3. Create source files(.alp or .c).
4. Add files to project.
5. Compilation and error checking.
6. Debugging and output verification.
7. Creation of HEX file.
8. Burn the project(HEX file) into ROM of the target device.

1. Create work directory:

  • Go to my computer.
  • Open local disk: D.
  • Create a new folder.
  • Rename with the desired name.
  • That is our work directory. 

2.Create a new project:    

  • Go to project menu in Keil. Select new project.   
  • Click on Atmel.
  • Select AT89C51 or AT89C52 or AT89S51 or AT89S52.
  • Select ok.
  • Next press yes.
NOTE: Give the project name and work folder path properly.
                                                                   Keil Environment

3. Creation of source file:    

  • Go to file menu.
  • Select new.
  • Write the program.
  • Save with the desired name(.ASM or .C).
 Example program

#include<stdio.h>
#include<reg51.h>
main()
{
while(1)
{
if (P0==0X00)
P2=0X5A;
else
P2=0XF0;
}
}

4. Add files to project.

  • In project workspace window, Right click on souregroup1.
  • Select add files to sourcegroup1.
  • Select the source file.
  • Press ok.
  • Now the tree is added to our project.
NOTE: At a time two source files are not compiled.

5. Compilation and error  checking:

  • In workspace window right click on the source file.
  • Select build.
  • In output window errors and warnings are shown.
  • If no errors and no warnings, Go ahead.
  • Else re-edit the program.

6. Debugging and output verification:

  • Go to debug menu.
  • Select start/stop debug session.
  • Open required peripherals in the peripheral menu like ports, counters, timers etc,. 
  • By using debug controls like the stepin, stepout, run or go etc,. , you can see the output. 
  • If you satisfied with the output, Go ahead else repeat editing.

7. Creation of HEX file:

  • Click on the option for the target.
  • Give clock frequency of 11.0592MHz.
  • In the output, select create HEX file option.
  • Press ok.
  • Rebuild target.
  • The HEX file is created in work directory.
  • If you want to see, open with notepad or WordPad.
  • By using an emulator like flashmagic or iprogrammer or unipro, we can burn HEX file into target device to see the output on the hardware device.  

Result: 

Studied about Keil simulator.           

Comments

Popular posts from this blog

8 bit addition in all addressing modes

Aim:  Write an assembly language program to perform two 8 bit numbers addition using immediate, direct, indirect and register addressing modes. Apparatus: A computer loaded with Keil or edsim51. Program: Immediate mode: ORG 0000H LJMP MAIN MAIN: MOV A,#50H ADD A,#30H END Note: Observe 'Acc' for the result. Direct mode: ORG 0000H LJMP MAIN MAIN: MOV 40H,#50H MOV A,#30H ADD A,40H END Note:  Observe 'Acc' for the result. Indirect mode: ORG 0000H LJMP MAIN MAIN: MOV 40H,#50H MOV 41H,#30H MOV R0,#40H MOV R1,#41H MOV A,@R0 MOV B,@R1 ADD A,B END Note:  Observe 40H, 41H locations, R0, R1 registers and A, B for intermediate results. Observe 'Acc' for the final result. Register mode: ORG 0000H LJMP MAIN MAIN: MOV 40H,#50H MOV 41H,#30H MOV A,40H MOV R0,41H ADD A,R0 END Note:  Observe 40H, 41H locations, R0 register and A for intermediate results. Obs