0% found this document useful (0 votes)
13 views3 pages

Lab 7A Downloading A C Program To 8051 Trainer: Lab Manual For "The 8051 Microcontroller ."

Download as doc, pdf, or txt
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 3

LAB 7A

DOWNLOADING A C PROGRAM TO 8051 TRAINER


OBJECTIVE:
To toggle and test the 8051 Trainer and its ports using C program.
REFERENCE:
Mazidi and McKinlay, The 8051 Microcontroller. Chapter 7
www.MicroDigitalEd.com
MATERIALS:
MDE8051 Trainer
8051 Keil C Compiler
MDE8051 Trainer tutorial
You can buy the MDE8051 Trainer from vendors shown on
www.MicroDigitalEd.com. We will use this 8051 Trainer in all subsequent
labs. The user guide and tutorial is available on the above site. It shows how
to connect the 8051 Trainer to the x86 PC and make sure the trainer boots
up. After that you are ready to download a toggle program shown in the
activity 1.
ACTIVITY 1
To test the operation of the ports of your MDE8051 Trainer you can
download the C program for Toggling LEDs on P2 from the following site:
http://www.microdigitaled.com/8051/Hardware/sample.htm
A) For you Compiler, make sure the hex option in the Link is checked
so the hex file for the above program is produced.
B) Now, follow the steps shown in the tutorial to download the hex file
into the 8051 Trainer.
C) Move the Slide Switch to RUN position and press the reset button
to run the test program.
D) Use a wire to connect the LED to each pin of the P1 and P2 and
observe the LED toggles on and off.
The above test program toggles the P2 of the 8051. Use a logic probe
or the LEDs of the 8051 Trainer to watch the bits of the ports toggle on and
off. Change the time delay in between the "on" and "off" states but make
sure the time delay is long enough that you can observe the LED going on
and off.

Lab Manual for The 8051 Microcontroller.

LAB 7A
WORKSHEET

Name:

Date:

Class:

1. To create a loop of 10,000 iterations we need data type of (unsigned char,


unsigned int).
2. To create a loop of 200 iterations we need data type of (unsigned char,
unsigned int).
3. What is the opposite of 0x55?
4. What is the opposite of 0xAA?
5. In the toggle program reduce the size of the delay to point in which the LEDs looks to be on all
the time(no longer toggling) . How many millisecond is that?

6. List all ports of 8051

72. In this Lab, which ports were tested?

8. Give the pins of P3 used for TxD and RxD.

9. Which ports of the 8051 have internal pull-up resistors?

Lab Manual for The 8051 Microcontroller .

LAB 7A
DOWNLOADING A C PROGRAM TO 8051 TRAINER
10. Which ports of the 8051 require the connection of external pull-up
resistors in order to be
used for I/O?

Lab Manual for The 8051 Microcontroller.

You might also like