0% found this document useful (0 votes)
129 views12 pages

Initialization Steps of The Experiments: ESA51E ESA51E 80C51BH

The document provides instructions for initializing experiments using an ESA51E microcontroller board with an Intel 80C51BH microcontroller. It describes: 1. The required software (Keil μVision for writing/compiling assembly code and Win51E for downloading/executing hex files) and how to open them. 2. How to open and compile a sample project in Keil μVision to generate a hex file. 3. How to download the hex file to the ESA51E board using Win51E and execute it in single-step mode to debug the program. 4. The steps for creating a new project folder, opening a new project in Keil μVision, writing assembly code
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views12 pages

Initialization Steps of The Experiments: ESA51E ESA51E 80C51BH

The document provides instructions for initializing experiments using an ESA51E microcontroller board with an Intel 80C51BH microcontroller. It describes: 1. The required software (Keil μVision for writing/compiling assembly code and Win51E for downloading/executing hex files) and how to open them. 2. How to open and compile a sample project in Keil μVision to generate a hex file. 3. How to download the hex file to the ESA51E board using Win51E and execute it in single-step mode to debug the program. 4. The steps for creating a new project folder, opening a new project in Keil μVision, writing assembly code
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

INITIALIZATION STEPS OF THE EXPERIMENTS

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.

STARTING A NEW PROJECT

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).

** Different projects should be kept in different folders.


After saving it will ask to Select device for target. Here device means CPU of the target board. First select
the vendor [Intel] of the device and then select device 80C51BH and click OK.
Select No for the option of Copy Standard Startup Code and addition to the project.

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.

Before saving, the code looks like this :


Now save the code giving the file name extension .A51 (e.g. Exp1a.A51) in the project folder (e.g. Exp1a).

The filename extension of the code file must be “.A51”.

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.

This code file must be added to this project.


Although it is not mandatory, you can change the target name i.e. Target1 by double clicking on Target1 in
this window and edit the name of the target and click OK. (Here the target name is changed from Target1 to
ESA51E).
After adding the code file ( e.g. Exp1a.A51) to the project the Keil µVision window is shown as follows
(i.e. in Project window Exp1a.A51 file is included under Source Group 1):

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.

You might also like