8255 A
8255 A
8255 A
Programmable Peripheral
Interface
Pin Diagram
40 pins
Consists of three 8 bit ports
named Port A(PA) ,Port
B(PB) and Port C (PC)
The ports A,B,C can be
programmed as input or
output ports
Pin functions
Data bus(D0-D7):
These are 8-bit bi-directional buses, connected to 8086 data
bus for transferring data.
CS:
This is Active Low signal. When it is low, then only this chip is
enabled.
RD:
This is Active Low signal, when it is Low read operation will
take place.
WR:
This is Active Low signal, when it is Low Write operation
will take place.
CS(A -A A1
A0
Selected entity
Address
0
1):
0 are used
0
A and control
These pins
to0select thePort
ports
register.
0
0
1
Port B
0
Port C
Control register
RESET:
This is used to reset the device. That means clear control
registers.
PA0-PA7:
It is the 8-bit bi-directional I/O pins used to send the
data to peripheral or to receive the data from peripheral.
PB0-PB7: Similar to PA
PC0-PC7:
This is also 8-bit bidirectional I/O pins. These lines are
divided into two groups.
PC0 to PC3 (Lower Groups)
PC4 to PC7 (Higher groups)
and
Address Decoding
The NAND gate output should be 0 , which is
connected to CS pin of 8255 in order to enable chip
When the address lines A7 to A3 and A0 have the following
bit status, and that is when the chip gets selected/enabled.
MODES OF OPERATION
Three modes
Mode 0: Basic input/output
Mode 1 : Strobed input/output
Mode 3 : Bi-directional bus
Mode 0 :
This is the simplest and most widely used mode .
Two 8 bit ports A and B ,and the 4 bit ports Port C upper
and Port C lower ,may be used independently .
Data is simply taken in from an input port or given to an output
port .
The specifications of this mode are
i) Two 8 bit ports and two 4 bit ports
ii) Any port can be input or output
iii) Outputs are latched
iv) Inputs are not latched
v) 16 different input/output combinations possible
Example:
Q) Design the control word to configure the ports of an
8255 chip in mode 0 ,with ports B and Port C upper (PCU)
as inputs and Port A and Port C lower (PCL) as outputs.
Solution:
Mode 0: I/O mode ,D7=1
D7
D6
D5
D1
D0
1 0 0 0 1 0 1
D4
0
D3
D2
Mode 1:
This is the handshaking mode .Handshaking implies
data transfer in which the communicating devices
exchange request and acknowledge control signals.
For 8255 operating in this mode ,Ports A and B pins are
used for data transfer ,while 4 bits each of Port C are
used for generating the handshaking signals
Specification
i) Each group contains one 8 bit port and one 4 bit port
.The 4 bit port is used for handshaking.
ii) The 8 bit port can be either an input or an output.
iii) Input and output are latched.
iv) The 4 bit port is used for control and status of the 8 bit
data port.
v) Interrupt logic is supported.
Mode 2:
This is the bidirectional mode.
Only Group A can use this mode .Here Port A is used for
transmitting as well as receiving data.
Handshaking signals generated by the upper 4 bits of
Port C maintain bus discipline for proper flow of data in the
required direction.
Basic functional definitions of this mode is
i)Used in Group A only.
ii) One 8-bit, bi-directional bus port (Port A) and a 5- bit control
port
(Port C).
iii) Both inputs and outputs are latched.
iv)The 5-bit control port (Port C) is used for control and status
for the 8- bit, bi-directional bus port (Port A).
Fig: BSR
control word
format
Example
Q) Write the BSR control words for the following cases.
i)PC0 to be set
ii) PC7 to be reset
iii)PC1 to be set
Solution: