Department of Computer Scien
ce and Information Engineering
National Cheng Kung University, TAIWAN
HANEL
PROGRAMMING THE 8255Connecting 8031/51 to
(^8255) (cont’)
Example 15-3For Figure 15-5.(a) Find the I/O port addresses assigned to ports A, B, C, and thecontrol register.(b) Find the control byte for PA = in, PB = out, PC = out.(c) Write a program to get data from PA and send it to both B and C.Solution:(a)
Assuming all the unused bits are 0s, the base port address for 8255 is 1000H. Therefore we have: 1000H PA1001H PB1002H PC1003H Control register
(b)
The control word is 10010000, or 90H.