Department of Computer Scien
ce and Information Engineering
National Cheng Kung University, TAIWAN
HANEL
PROGRAMMING THE 8255Connecting 8031/51 to
(^8255) (cont’)
Example 15-2For Figure 15-4.(a) Find the I/O port addresses assigned to ports A, B, C, and thecontrol register.(b) Program the 8255 for ports A, B, and C to be output ports.(c) Write a program to send 55H and AAH to all ports continuously.Solution(a)
The base address for the 8255 is as follows:
(b)
The control byte (word) for all ports as output is 80H as seen in Example 15-1.
(^11)
xx
xx
xx
xx
xx
Xx
(^1) x
(^01)
XX
xx
xx
xx
xx
XX
(^1) X
(^10)
Xx
xx
xx
xx
xx
XX
(^1) X
(^00)
xx
xx
xx
xx
xX
xX
A15A14A13^1 X
A12A11
A10A9
A8A7
A6A5
A4A3
A2A1
A0 = 4000H PA= 4001H PB= 4002H PC= 4003H CR