Programmable Peripheral Interface - 8255
Programmable Peripheral Interface - 8255
PERIPHERAL INTERFACE
-8255
• It is an I/O port chip used for interfacing
I/O devices with microprocessor system.
• It is device used to implement parallel
data transfer between processor and slow
peripheral devices like ADC, DAC,
keyboard, 7-segment display, lCD etc.
Features:
• It is a programmable device.
T T L compatible.
• 8255A has three ports
• PORT A
• PORT B
• PORT C
• Port A and Port B are 8 bit parallel
ports.
• Port C can be split into two parts, i.e.
PORT C lower (PC0-PC3) and PORT C
upper (PC7-PC4) by the control word
• These three ports are further divided into
two groups,
– i.e. Group A includes PORT A and upper PORT
C.
– Group B includes PORT B and lower PORT C
• These two groups can be programmed in
three different modes.
• Three operating modes :
– Mode-0(simple I/O port)
– Mode-1(Handshake I/O port)
– Mode-2(Bidirectional I/O port)
Mode 0
• In this mode, Port A and B is used as two 8-bit ports and
Port C as two 4-bit ports.
• Each port can be programmed in either input mode or
output mode where outputs are latched and inputs are
not latched.
• Ports do not have interrupt capability.
• Ports in mode 0 is used to interfaces LEDs, Hexa keypad
and 7 segment LEDS to the processor.
Mode 1
Computer Printer
DATA BUS
STB
ACK
Busy
A1 A0 Select
0 0 PA
0 1 PB
1 0 PC
Control
1 1
reg.
• RESET: This is used to reset the device. That
means clear control registers.
• PB0-PB7:Similar to PA
X X X BIT SET/RESET
1=SET
Don’t care 0=RESET
Bit select
0 1 2 3 4 5 6 7
0 1 0 1 0 1 0 1
B0 0 0 1 1 0 0 1 1
0 0 0 0 1 1 1 1
B1
BIT SET/RESET FLAG
=0 Active
B2
• PC0-PC7 is set or reset as per the status of D0.
• A BSR word is written for each bit
• Example:
– PC3 is Set then control register will be 0XXX0111.
– PC4 is Reset then control register will be
0XXX01000.
• X is a don’t care.
FORMAT OF I/O MODE:
The mode format for I/O as shown in figure
D7 D6 D5 D4 D3 D2 D1 D0
Group A Group B
Port C Upper
1=Input Port C Lower
Mode set
0=Output 1=Input
1-I/O mode
0-BSR mode Port A 0=Output
1=Input Port B
0=Output 1=Input
Mode selection 0=Output
00=mode 0 Mode selection
01=mode 1 0=mode 0
1x=mode 2 1=mode 1
• The control word for both mode is same.
• Bit D7 is used for specifying whether word
loaded in to Bit set/reset mode or Mode
definition word.
• D7=1=Mode definition mode.
• D7=0=Bit set/Reset mode.