Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

8255 - Programmable peripheral interface

8255 is a popular interfacing component, that can interface any TTL-compatible


I/O device to a microprocessor. It is used to interface to the keyboard and a parallel
printer port in PCs (usually as part of an integrated chipset). It requires insertion of
wait states if used with a microprocessor using higher that an 8 MHz clock. It
consists of 40 pins and operates in +5V regulated power supply out of which 24
pins are for I/O that are programmable in groups of 12 pins and has three distinct
modes of operation.
Block diagram –
It consists of three 8-bit bidirectional I/O ports i.e. PORT A, PORT B and PORT C. We
can assign different ports as input or output functions. Port C is further divided into two
4-bit ports i.e. port C lower and port C upper and port C can work in either BSR (bit set
rest) mode or in mode 0 of input-output mode of 8255. Port B can work in either mode
or in mode 1 of input-output mode. Port A can work either in mode 0, mode 1 or mode 2
of input-output mode.
It has two control groups, control group A and control group B. Control group A consist
of port A and port C upper. Control group B consists of port C lower and port B.
Depending upon the value if CS’, A1 and A0 we can select different ports in different
modes as input-output function or BSR. This is done by writing a suitable word in control
register (control word D0-D7).
CS’ A1 A0 SELECTION ADDRESS

0 0 0 PORT A 80 H

0 0 1 PORT B 81 H

0 1 0 PORT C 82 H

0 1 1 Control Register 83 H

1 X X No Selection X

8255 Modes
There are three modes in which the device can be used.

 Mode-0
 Mode-1
 Mode-2

Mode 0 (Basic Input/output)

This functional configuration provides simple input and output operations for each of the three
ports. No “handshaking” is required, data is simply written to or read from a specified port.

MODE 1 (Input/output with handshake)

This functional configuration provides a means for transferring I/O data to or from a specified
port in conjunction with strobes or “handshaking” signals. In mode 1, Port A and Port B use the
lines on Port C to generate or accept these “handshaking” signals.

Mode 2 (Bi-directional Operation)

This functional configuration provides a means for communicating with a peripheral device or
structure on a single 8-bit bus for both transmitting and receiving data (bidirectional bus I/O).
“Handshaking” signals are provided to maintain proper bus flow discipline in a similar manner to
MODE 1. Interrupt generation and enable/disable functions are also available.

You might also like