8255 Interface Notes
8255 Interface Notes
A1 A0 Select
0 0 PA
0 1 PB
1 0 PC
Control
1 1
reg.
Function of pins:
• RESET: This is used to reset the device. That means clear
control registers.
• PB0-PB7:Similar to PA
Group A
Group A: PA0-PA7
PC4-PC7
Group B: PB0-PB7
PC0-PC3
Group B
Figure 3:
Control Word
• Can be accessed when A0=1 and A1=1
• Cannot be accessed for read operation
• Steps to communicate with 8255
– Determine the addresses of port A,B and C and
control register according to CS and A0 ,A1
– Write control word in control register
– Write I/O instruction to communicate with
peripheral through A,B and C
Control Word
Mode 0: Simple Input or Output
Figure 9:
8255 PIA: Example
• Solutions:
– Port Address :
• It is actually an I/O memory map.
• When A15 is active high, Chip Select signal is activated.
• Assuming all don’t care signals are at logic 0, therefore ports’
address are as follows:
8255A Programmable Peripheral Interface
• Solution:
– Control Word:
8255 PIA
• Solution: ???
Program:
MOV AL, 83H
MOV DX, 8003H
OUT DX, AL
IN AL, 8001H
OUT 8000H, AL
IN AL, 8002H
SHL AL,4
OUT 8002H, AL