Skip to content
Advanced Microprocessor

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, PA7−PA0PA_7-PA_0): 8-bit data output latch/buffer and 8-bit data input latch.
  • Port B (8 Pins, PB7−PB0PB_7-PB_0): 8-bit data input/output latch/buffer and 8-bit data input buffer.
  • Port C (8 Pins, PC7−PC0PC_7-PC_0): 8-bit port divided into two 4-bit nibbles:
    • Port C Upper (PC7−PC4PC_7-PC_4): Controlled by Group A logic. In strobed modes, these pins serve as handshaking status/strobe lines for Port A.
    • Port C Lower (PC3−PC0PC_3-PC_0): 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 A1A_1 and A0A_0 to select internal registers, while chip select (CS‾\overline{CS}) enables the device:

CS‾\overline{CS}RD‾\overline{RD}WR‾\overline{WR}A1A_1A0A_0Bus Operation / Selected Register
00100Read from Port A into CPU Data Bus
00101Read from Port B into CPU Data Bus
00110Read from Port C into CPU Data Bus
01000Write from CPU Data Bus into Port A
01001Write from CPU Data Bus into Port B
01010Write from CPU Data Bus into Port C
01011Write Control Word into Control Register
00111Illegal Condition (Control register cannot be read)
1XXXXTri-stated / Chip Deselected
Fig 8.1: Intel 8255 Programmable Peripheral Interface Internal Architecture & Ports
Fig 8.1: Intel 8255 Programmable Peripheral Interface Internal Architecture & Ports

Operating Modes of the 8255

The 8255 operates in two primary functional modes programmed via its Control Register:

1. Bit Set/Reset (BSR) Mode (D7=0D_7 = 0)

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:

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0
0XXXBit Select (B2)\text{Bit Select } (B_2)Bit Select (B1)\text{Bit Select } (B_1)Bit Select (B0)\text{Bit Select } (B_0)S/R‾S/\overline{R}

Bits D3−D1D_3-D_1 select the pin (000=PC0,…,111=PC7000 = PC_0, …, 111 = PC_7). Bit D0D_0 determines state (1=Set pin high,0=Reset pin low1 = \text{Set pin high}, 0 = \text{Reset pin low}).

2. I/O Mode (D7=1D_7 = 1)

Configures the data direction and handshaking across the ports. I/O mode is subdivided into three operational modes:

  1. 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.
  2. Mode 1 (Strobed Handshake I/O): Data transfer is synchronized using handshaking signals allocated from Port C pins:
    • Input Handshake Pins: STB‾\overline{STB} (Strobe Input from peripheral), IBFIBF (Input Buffer Full output to peripheral), and INTRINTR (Interrupt Request output to CPU).
    • Output Handshake Pins: OBF‾\overline{OBF} (Output Buffer Full output to peripheral), ACK‾\overline{ACK} (Acknowledge input from peripheral), and INTRINTR (Interrupt Request).
  3. 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 (PC7−PC3PC_7-PC_3), allowing simultaneous high-speed input and output transactions. Only Port A supports Mode 2.
Peripheral Interface Configuration

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.

Group A Configuration (Port A & Port C Upper)D6, D5, D4, D3
Group B Configuration (Port B & Port C Lower)D2, D1, D0
Computed Control Register Byte
80H
Binary: 10000000b
Bit-by-Bit Register Mapping
D7
1
D6
0
D5
0
D4
0
D3
0
D2
0
D1
0
D0
0
Assembly Usage:MVI A, 80H ; Load control word
OUT 83H ; Send to 8255 Control Register
Try it
8255 Control Word Decoding: To configure Port A as an Output in Mode 0, Port B as an Input in Mode 0, and Port C (both Upper and Lower) as Outputs in Mode 0, what hexadecimal byte must be sent to the control register?

Sources

  1. 1.Intel 8255 PPI Documentation · reference · Intel (opens in a new tab)

Was this chapter useful?

Editors read every answer.

Star this chapter

Each star goes once to every reader who improved this chapter.

Finished reading?

Mark it to keep your place in the course.