8255 PPI: Architecture, Modes 0/1/2 & Control Words
24 I/O pins across Ports A, B, C, I/O configuration vs BSR modes, handshaking signals, and peripheral interfacing.
Knova editors12 min readQuick checkSources
The 8255 Programmable Peripheral Interface (PPI)
The Intel 8255A is a widely used, general-purpose programmable I/O device designed to interface parallel peripheral equipment (keyboards, displays, ADC/DAC units, printers) to the microprocessor system bus without requiring external discrete logic circuits.
Housed in a 40-pin Dual In-Line Package, the 8255 provides 24 programmable I/O pins organized into three 8-bit ports.
Internal Architecture and Port Organization
The internal structure of the 8255 contains two groups of ports managed by independent control logic:
- Port A (8 Pins, ): 8-bit data output latch/buffer and 8-bit data input latch.
- Port B (8 Pins, ): 8-bit data input/output latch/buffer and 8-bit data input buffer.
- Port C (8 Pins, ): 8-bit port divided into two 4-bit nibbles:
- Port C Upper (): Controlled by Group A logic. In strobed modes, these pins serve as handshaking status/strobe lines for Port A.
- Port C Lower (): Controlled by Group B logic. In strobed modes, these pins serve as handshaking lines for Port B.
Port Addressing and Bus Interface Logic
The 8255 connects to the CPU address lines and to select internal registers, while chip select () enables the device:
| Bus Operation / Selected Register | |||||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | Read from Port A into CPU Data Bus |
| 0 | 0 | 1 | 0 | 1 | Read from Port B into CPU Data Bus |
| 0 | 0 | 1 | 1 | 0 | Read from Port C into CPU Data Bus |
| 0 | 1 | 0 | 0 | 0 | Write from CPU Data Bus into Port A |
| 0 | 1 | 0 | 0 | 1 | Write from CPU Data Bus into Port B |
| 0 | 1 | 0 | 1 | 0 | Write from CPU Data Bus into Port C |
| 0 | 1 | 0 | 1 | 1 | Write Control Word into Control Register |
| 0 | 0 | 1 | 1 | 1 | Illegal Condition (Control register cannot be read) |
| 1 | X | X | X | X | Tri-stated / Chip Deselected |
Operating Modes of the 8255
The 8255 operates in two primary functional modes programmed via its Control Register:
1. Bit Set/Reset (BSR) Mode ()
The BSR mode operates strictly on individual bits of Port C. It allows software to set or reset any single Port C pin without affecting the remaining seven pins:
| 0 | X | X | X |
Bits select the pin (). Bit determines state ().
2. I/O Mode ()
Configures the data direction and handshaking across the ports. I/O mode is subdivided into three operational modes:
- Mode 0 (Basic I/O): Simple unlatched data transfer. Outputs are latched; inputs are unlatched buffers. Ports A, B, and C can be independently configured as input or output. No interrupt or handshaking lines are used.
- Mode 1 (Strobed Handshake I/O): Data transfer is synchronized using handshaking signals allocated from Port C pins:
- Input Handshake Pins: (Strobe Input from peripheral), (Input Buffer Full output to peripheral), and (Interrupt Request output to CPU).
- Output Handshake Pins: (Output Buffer Full output to peripheral), (Acknowledge input from peripheral), and (Interrupt Request).
- Mode 2 (Strobed Bidirectional Bus I/O): Port A becomes an 8-bit bidirectional data bus. Handshaking is managed by 5 dedicated lines of Port C (), allowing simultaneous high-speed input and output transactions. Only Port A supports Mode 2.
Intel 8255 PPI Control Word Generator
Toggle between I/O Configuration and Bit Set/Reset (BSR) modes, configure Group A and Group B ports, and observe the live generated 8-bit hex control register byte.
MVI A, 80H ; Load control wordOUT 83H ; Send to 8255 Control Register