8255 Function
8255 Function
8255 Function
General
The Intel 8255A Programmable peripheral interface (PPI) is a general purpose programmable I/O device
which is designed for use with all Intel and most other microprocessors. Its function is that of a general
purposes I/O component to Interface peripheral equipment to the microcomputer system bush. The
functional configuration of the 8255A is programmed by the systems software so that normally no external
logic is necessary to interface peripheral devices or structures.
It provides 24 I/O pins which may be individually programmed in 2 groups of 12 and used in 3 major
modes of operation. It can interface any TTL-compatible I/O device to microprocessor.
The 8255 is a 40 pin integrated circuit (IC), designed to perform a variety of interface functions in a
computer environment. The high performance and industry standard configuration of the 82C55A make it
compatible with the 80C86, 80C88 and other microprocessors.
Ports A, B, and C
The 8255A contains three 8-bit ports (A, B, and C). All can be configured in a wide variety of functional
characteristics by the system software but each has its own special features or personally to further
enhance the power and flexibility of the 8255A.
Port A. One 8 bit data output latch/buffer and one 8-bit data input latch.
Port B. One 8-bit data output latch/buffer and one 8-bit data input buffer.
Port C. One 8-bit data output latch/buffer and one 8-bit data input buffer (no latch for input). This port
can be divided into two 4-bit ports under the mode control. Each 4-bit port contains a 4-bit latch and it can
be used for the controls signal outputs and status signal inputs in conjunction with ports A and B.
Groups
The 8255 I/O Pins are divided into ports and are programmed as groups.
Group A Connection
consist of Port A (PA7 – PA0) and the upper half of Port C (PC7 – PC4).
Table 1-1 shows the I/O ports assignments used for programming and access the I/O Ports. In the personal
computer the 8255 or its equivalent is decoded at I/O Ports 60H – 63H.
A0 A1 Function
0 0 Port A
0 1 Port B
1 0 Port C
1 1 Command Register
Table 1-1
Features:
* 24 Programmable I/O Pins
* Fully TTL Compatible
* High Speed, No “Wait State” Operation with 5MHz and 8MHz
1
* Direct Bit Set/Reset Capability
* Enhanced Control Word Read Capability
* 2.5mA Drive Capability on All I/O Ports
* Low Standby Power (ICCSB) . . . . . . . . . . . . . . . . . 10mA
PIN configuration
This 3-stable bi-directional 8-bit buffer is used to interface the 8255A to the systems data bus. Data is
transmitted or received by the buffer upon execution of input or output instructions by the CPU. Control
words and status information are also transferred through the data bus buffer.
The function of this block is to manage all of the Internal and External transfers of both Data and Control
or Status words. It accepts inputs from the CPU Address and Control business and in turn, issues
commands to both of the Control Groups.
RD: Read
A “low” on this input pin enables 82C55A to send the data or status information to the CPU on the data
bus. In essence, it allows the CPU to “read from” the 82C55A.
WR: Write
A “low” on this input pin enables the CPU to write data or control words into the 82C55A.
2
These are the data input/output lines for the device. All information read from and written to the 8255
occurs via these 8 data lines.
RESET
A “high” on this input initializes the control register to 9Bh and all ports (A, B, C) are set to the input
mode. “Bus hold” devices internal to the 82C55A will hold the I/O port inputs to a logic “1” state with a
maximum hold current of 400µA.
The control word register can be both written and read as shown in the “Basic Operation” table.
When the control word is read, bit D7 will always be logic “1”, as this implies control word mode
information.
Block diagram
3
Two control groups, labeled group A control and group B control define how the three I/O ports operate.
There are several different operating modes for the 8255 and these modes must be defined by the CPU
writing programming or control words to the device 8255.
The line group of port C consists of two 4 bit ports. One of the 4 bit group is associated with group A
control and the other 4 bit group with group B control device signals. The upper 4 bits of port C are
associated with group A control while the lower 4 bits are associated with group B control.
The final logic blocks are read/write control logic and data bus buffer. These blocks provide the electrical
interface between the Z80 and the 8255.
The data bus buffer buffers the data I/O lines to/from the Z80 data bus. The read/write control logic routes
the data to and from the correct internal registers with the right timing. The internal path being enabled
depends on the type of operation performed by the Z80. The type of operation can be I/O read or I/O write.
If bit 7 of the control word is a logical 1 then the 8255 will be configured.
If bit 7 of the control word is a logical 0 then each bit of the port C can be set or reset.
4
Bit definitions of the 8255 control register to modify single bits of port C
Examples:
If you want to set/reset bit 0 of port C then set D3 to D1 to 000.
Bit 1 of port C will be set/reset if you code 001 to D3 to D1.
Bit 6 of port C is set/reset if D3 to D1 is 110.
Mode of 8255:
There are three basic modes of operation that can be selected by the systems software:
When the reset Input goes “high” all ports will be set to the Input mode (i.e., all 24 lines will be in the high
Impedance state). After the reset is removed the 8255A can remain in the input mode with no additional
Initialization required. During the execution of the systems program any of the other modes may be
selected using a single output Instruction. This allows a single 8255A to service a variety of peripheral
devices with a simple software maintenance routine.
This functional configuration provides simple input operations for each of the three ports. No
“handshaking” is required data is simply written to or read from a specified port.
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.
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 (bi-directional bus I/O). “Handshaking” signals
are provided to maintain proper bus flow discipline in a similar manner to MODE.
5
MODE 2 Basic Functional Definitions
When the 8255A is programmed to operate in mode 1 or mode 2, control signals are provided that can
used as interrupt request input to the CPU. The interrupt request signal generated from port C, can be
inhibited or enabled by setting or resetting the associated INTE flip-flop, using the bit set/reset function of
port C.
This function allows the Programmer to disallow or allow a specific I/O device to interrupt the CPU
without affecting any other device in the interrupt structure.