Initialization Steps of The Experiments: ESA51E ESA51E 80C51BH
Initialization Steps of The Experiments: ESA51E ESA51E 80C51BH
The microcontroller board used in this laboratory is ESA51E. The ESA51E board consists of 80C51BH
microcontroller from Intel. This board is connected to PC through a RS232C / USB cable which is
connected to COM / USB port of the board. The power is supplied to the microcontroller board by a power
supply.
Two softwares are required to perform the experiments with the ESA51E board. The software Keil µVision
is used to write the code in assembly language, compiling and generating the Intel Hex code from the
corresponding Assembly code and Win 51E is used to download and execute the Hex Code in the ESA51E
board.
The following write up shows you how to run the Keil µVision and Win 51E with the 80C51BH based
ESA51E board.
To open the software Keil µVision, double click on the desktop icon shown below:
After opening the software window, close any previously opened project by tapping the Project menu and
then select the Close project submenu.
Now to open a sample project, tap the project menu and select the open project submenu. After clicking
the open project submenu select the path of the project sample and open the project as shown below:
Here the path is D:\gr1\8051\sample. Replace "gr1" by your group number e.g. bt-10.
The project can be compiled by clicking the Rebuild all target files icon . The positions of the icon in
the µvision window is shown below :
The compilation results will be shown in the Build Output Window. Check that one hex file has been
created in the project directory.
This hex file is to be downloaded to the ESA51E board using Win51E software.
Generally the icon Win51E is kept in the desktop, otherwise it is available in the ESA Trainers program in
start > Programs menu.
The Win51E software window is shown below. The functions of each icon can be known by placing the
cursor on the icons. Some of which is shown below.
Now the HEX file already generated by Keil µvison is to be downloaded to the ESA51E board by clicking
the DOWNLOAD icon and selecting the path of the HEX file (in this case the path is D:\gr1\8051\sample).
Normally the other options in the Download window like memory, offset Address will remain unchanged.
There is a file named sample.hex in the project folder. Select the file and click OK. The HEX file will be
downloaded to the ESA51E board.
After downloading the HEX file in the ESA51E board, you can run the code in the board both in single step
execution mode or normal execution mode. Single step mode is preferable for the program debugging. In
single step mode execution only one instruction will be executed at a time when you click on single step
icon once. While the program is executed in this mode the value of registers, memory areas, which line is
being executed (disassembly window) is shown in different small windows in the WIN51E main window.
These windows can be opened by clicking the different icons e.g. to see the value of registers click the view
registers icon. The necessary windows which can be opened in single step execution are shown below.
Now set the PC to the starting location of the program (here it is 8100H) by Set PC icon and run the
program in single step mode by clicking Single Step icon . One click on the icon will execute one
instruction. During execution the value of the registers and memory locations can be seen in the different
windows shown above. Thus you can check how the register values are changing in the sample program.
Please do not make any changes in sample program.
Before starting a new project, a folder is to be created under “D:\ / E:\ <group name>8051”
subdirectory. It is desirable to give the name of the folder as the name of the project.
The Keil µvision4 software is to be invoked by double clicking the icon. Close any opened project and from
the Project menu select the New µvision Project submenu and the path of your new project. Give the
project name and save the project as shown below (here the project folder name is Exp1a and name of new
project is also Exp1a).
Then the output file format is to be set from the options for the target system by clicking the Option for
Target icon
The following window will open. You can check whether the proper device is selected or not by clicking the
Device button in this window. 80C51BH of Intel is to be selected.
Next click on the Output button and check the Create Hex File checkbox and then click OK.
You can now write your own assembly language code for your project. Click on File menu of the µvision
window and select New.
This will open a Text window in µvision. Write your own assembly code.
While writing your own code, provide three TAB from left.
The first line i.e. ORG 8100H and the last line END must be incorporated in the code as in the Exp1a
project.
After saving the code should be looks like this (code text is coloured):
Now you have to add this file Exp1a.A51 to the project Exp1a by clicking the icon .
After clicking the icon another window will appear named Manage Project Items.
Click on the Add Files button. Select the Files of type as All files and select the path of the file. Here the
path is D:\gr1\8051\Exp1a and then select the file (e.g. Exp1a.A51).
Add Exp1a.A51 to the project by clicking on Add button and press Close button.
Your file is added to the project. You can see that Exp1a.A51 is included in Files column then click OK.
Now you modify your code according to your experiment and after completion of editing, the project can be
compiled by clicking the Rebuild all target files icon , similarly as the procedure followed during the
compilation of sample project to generate the Hex file. Rest of the steps i.e. downloading the Hex file to the
8051 board and execution is same as the steps followed during sample project.