You are on page 1of 6

8255 (Programmable Peripheral Interface)

The 8255 is a general purpose programmable I/O device designed for use with Intel
microprocessors. It consists of:

 Three 8-bit bidirectional I/O ports (24 I/O lines) that can be configured to meet different
system I/O needs. The three ports are PORT A, PORT B & PORT C.
 Port A contains one 8-bit output latch/buffer and one 8-bit input buffer.
 Port B is same as PORT A .
 However, PORT C can be split into two parts PORT C lower (PC0-PC3) and PORT C upper
(PC7-PC4) by the control word.
 The three ports are divided in two groups Group A (PORT A and upper PORT C) Group B
(PORT B and lower PORT C).
 The two groups can be programmed in three different modes.

The 8255 is contained in a 40-pin package, whose pin out is shown below:

 Port A (PA7-PA0) :8 pins


 Port B (PB7-PB0) :8 pins
 Port C (Pc: Upper: PC7-PC4) : 4 pins
 Port C (Pc: Lower: PC3-PC)) : 4 pins
 Data Bus (D7-D0) : 8 pins
 Control signals : 6 pins
 VCC and Gnd : 2 pins

 PA0 – PA7 – Pins of port A  RD’ – Read input


 PB0 – PB7 – Pins of port B  WR’ – Write input
 PC0 – PC7 – Pins of port C  CS’ – Chip select
 D0 – D7 – Data pins for the transfer of data  A1 and A0 – Address pins
How many ports are there in 8255 and what are they?
Ans. Basically there are three ports in 8255, viz., Port A, Port B and Port C, each having 8
pins. Again Port C can be divided into Ports C and Port Clower—each having four pins upper
i.e., a nibble. Thus 8255 can be viewed to have four ports—Port A, Port B, Port Cupper and
Port Clower.
MODES OF OPERATIONS:
To know in which mode the interface is working we need to know the value of Control word.
Control word is a part of control register in 8255 which specify an I/O function for each port. This is
format of control word 8255.

If the most significant bit of control word or D7 is 1 then 8255 works in I/O mode else, if it’s
value is 0 it works in BSR mode.
1. BSR Mode – When MSB of the control register is zero(0), 8255 works in Bit Set-Reset
mode.in this only PC bit are used for set and reset.
2. I/O Mode – When MSB of the control register is one(1), 8255 works in Input-Output
mode.it is further divided into three categories.
3. Mode 0 – In this mode all three ports (PA, PB, PC) can work as simple input function or
output function also in this mode there is no interrupt handling capabilities.
4. Mode 1 – In this either port A or port B can work and port C bits are used as Handshake
signal before actual data transmission plus it has interrupt handling capabilities.
5. Mode 2 – In this only port A works and port B can work either in Mode 0 or Mode 1 and
the 6 bits of port C are used as Handshake signal plus it also has to interrupt handling
capability.

Operational modes

i) I/O modes (M0,M1,&M2)


If MSB of control word (D7) is 1, PPI works in input-output mode. This is further divided into
three modes: Mode 0, Mode 1 and Mode 2.
ii) Bit Set/Reset mode (BSR mode)
If MSB of control word (D7) is 0, PPI works in BSR mode. In this mode only port C bits are
used for set or reset.
Example: A CPU wants to transfer data to a printer. In this case since speed of processor is
very fast as compared to relatively slow printer, so before actual data transfer it will send
handshake signals to the printer for synchronization of the speed of the CPU and the
peripherals.
ii) BSR (Bit set/Reset) mode

BSR mode stands for Bit Set Reset mode. The characteristics of BSR mode are:

 BSR mode is selected only when D7 = 0 of the Control Word Register (CWR).
 Concerned with bits of port C.
 Individual bits of Port C can either be Set or Reset.
 At a time, only a single bit of port C can be Set or Reset.
 Is used for control or on/off switch.
 BSR control word doesn’t affect ports A and B functioning.
Example: Obtain the control word when the ports of 8255A are to be used in mode 0 with port-A
as output port and port B as input port and port C as output port.
Solution. The control word for this case is given as:

Hope this discussion on control word format for 8255A , cleared your concept.
Explain how the different ports and control words are selected for 8255.

Ans. The two address lines, along with ̅̅̅̅ signal, determine the selection of a particular port or
control register. This is explained below:

You might also like