Preview

8255 INTERFACING

Satisfactory Essays
Open Document
Open Document
386 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
8255 INTERFACING
8255 INTERFACING

1 of 6

http://what-when-how.com/8051-microcontroller/8255-interfacing/

Subscribe what-when-how In Depth Tutorials and Information

SECTION 15.2: 8255 INTERFACING
Chapters 12 and 13 detailed real-world interfacing of LCDs, sensors, and ADC devices. In this section we show how to interface the 8255 to LCDs, stepper motors, and ADC devices, then program it using 8051 instructions.
Stepper motor connection to the 8255
Chapter 17 will detail the interface of a stepper motor to the 8051. Here we show stepper motor connection to ^
8255 and programming. See Figure 15-9.
MOV A,#80H /control word for PA=out
MOV R1,#CRPORT ;control reg port address
MOVX @R1,A ;configure PA=out
MOV R1,#APORT /load PA address
MOV A,#66H /A=66H,stepper motor sequence
AGAIN: MOVX @R1,A /issue motor sequences to PA
RR A /rotate sequence for clockwise
ACALL DELAY /wait
SJMP AGAIN

Figure 15-9. 8255 Connection to Stepper Motor

6/9/2013 2:13 AM

8255 INTERFACING

2 of 6

http://what-when-how.com/8051-microcontroller/8255-interfacing/

LCD connection to the 8255
Figure 15-10. LCD Connection

Program 15-1 shows how to issue commands and data to an LCD connected to an 8255. See Figure 15-10. In
Program 15-1, we must put a long delay before issuing any information (command or data) to the LCD. A better way is to check the busy flag before issuing anything to the LCD. This was discussed in Chapter 12. Program
15-2 is a repeat of Program 15-1 with the checking of the busy flag. Notice that no DELAY is used the main program in Program 15-2.

6/9/2013 2:13 AM

8255 INTERFACING

3 of 6

http://what-when-how.com/8051-microcontroller/8255-interfacing/

Program 15-1.

6/9/2013 2:13 AM

8255 INTERFACING

4 of 6

http://what-when-how.com/8051-microcontroller/8255-interfacing/

Program 15-2.

6/9/2013 2:13 AM

8255 INTERFACING

5 of 6

http://what-when-how.com/8051-microcontroller/8255-interfacing/

Program 15-2.
ADC connection to the 8255
ADC devices were covered in Chapter 13. The

You May Also Find These Documents Helpful