30-09-2016, 09:14 AM
1456912421-80512edhardlab12.doc (Size: 26.5 KB / Downloads: 6)
OBJECTIVES:
To program the timer interrupt of the 8051.
To program the serial interrupt of the 8051.
To program the hardware interrupt of the 8051.
REFERENCE:
Mazidi and Mazidi, “The 8051 Microcontroller and Embedded Systems,” Chapter 11.
MATERIALS:
8051 trainer
8051 assembler
Square wave generator
ACTIVITY 1
Write an 8051 program to get data from one port and send it to another port continuously while an interrupt will do the following: One of the timers will toggle the PX.Y bit every 100 microseconds.
ACTIVITY 2
Write an 8051 program to get data from a single bit of P1.2 and send it to P1.7 continuously while an interrupt will do the following: A serial interrupt service routine will receive data from a PC and display it on one of the ports. (Either connect LEDs to this port to examine the data coming in or display the received data on an LCD).
ACTIVITY 3
Write an 8051 program to get data from one port and send it to another port continuously while an interrupt can do the following: Connect the INT0 (or INT1) pin to a normally high debounce SW and any time the switch is pressed, a single LED is turned on.
ACTIVITY 4
Write an 8051 program to get data from one port and send it to another port continuously while an interrupt will do the following: A square wave is connected to the INT0 (pin 3.2) and any time a H-to-L pulse comes in a single LED is turned on. The rate of "On" and "Off" is the rate of the square wave. In this activity you can also use INT1.