Skip to main content
← All posts

Part 12: Programmable Peripheral Interface ICs: Architecture and Pin Configuration of 8255, 8259, 8254, 8251, and 8257

Md. Harun-Or-RoshidMar 1, 20264 min readArticle
Part 12: Programmable Peripheral Interface ICs: Architecture and Pin Configuration of 8255, 8259, 8254, 8251, and 8257

Bridging the CPU to the Physical World

A microprocessor in isolation is merely a fast mathematical engine; it requires specialized peripheral interface adapters to communicate with keyboards, display terminals, analog-to-digital converters, motor actuators, and disk drives. In this culminating installment of our 12-part series, we examine the architecture, pin configurations, operating modes, and control register formats of the classic Intel peripheral family: the 8255 PPI, 8259 PIC, 8254 PIT, 8251 USART, and 8257 DMA Controller.

1. Intel 8255 Programmable Peripheral Interface (PPI)

The 8255 is a general-purpose programmable I/O device configured into 24 I/O pins organized as three 8-bit ports (Port A, Port B, Port C) grouped into Group A and Group B:

8255 Operating Modes

  • Mode 0 (Basic Input/Output): Simple unlatched input and latched output on all 24 pins without handshaking signals. Useful for reading DIP switches and driving LED displays.
  • Mode 1 (Strobed Input/Output): Handshake data transfer. Port A and Port B function as 8-bit data ports, while pins of Port C generate handshake strobes (STB# Strobe, IBF Input Buffer Full, INTR Interrupt Request, OBF# Output Buffer Full, ACK# Acknowledge).
  • Mode 2 (Strobed Bidirectional Bus I/O): Supported exclusively on Port A. Port A acts as an 8-bit bidirectional data bus using 5 pins of Port C for handshaking. Enables master-slave peripheral communication.
  • BSR (Bit Set/Reset) Mode: Applies exclusively to Port C. Individual bits of Port C can be set or cleared with a single control word write without affecting the remaining Port C bits. Ideal for generating software pulses and motor control steps.

8255 I/O Control Word Format (Bit D7 = 1)

BitFieldValue = 1Value = 0
D7Mode Set FlagActive (I/O Mode)BSR Mode (when D7 = 0)
D6, D5Group A Mode00 = Mode 0; 01 = Mode 1; 1X = Mode 2-
D4Port A DirectionInputOutput
D3Port C Upper (PC7-PC4)InputOutput
D2Group B ModeMode 1Mode 0
D1Port B DirectionInputOutput
D0Port C Lower (PC3-PC0)InputOutput

2. Intel 8259 Priority Interrupt Controller (PIC)

The 8259 manages up to 8 vectored priority interrupts on a single chip, cascading up to 64 vectored interrupts across a master-slave configuration (1 Master 8259 + 8 Slave 8259s connected via cascade lines CAS0-CAS2):

Internal Registers

  • IRR (Interrupt Request Register): Latches pending interrupt requests on lines $IR_0 - IR_7$.
  • ISR (In-Service Register): Tracks which interrupt level is currently being serviced by the CPU.
  • IMR (Interrupt Mask Register): 8-bit mask register; setting a bit masks (disables) that specific interrupt line.
  • Priority Resolver: Hardware logic that selects the highest-priority unmasked pending interrupt.

Programming Words

Configured via Initialization Command Words (ICW1–ICW4) to set base vector addresses, edge/level triggering, single/cascade mode, and 8085/8086 mode. Runtime priority updates are managed via Operation Command Words (OCW1–OCW3), including End of Interrupt (EOI) commands.

3. Intel 8254 Programmable Interval Timer (PIT)

The 8254 contains three independent 16-bit counters (Counter 0, 1, 2) that decrement from a preloaded count down to zero at clock input frequencies up to 10 MHz. It provides six programmable operational modes:

  • Mode 0: Interrupt on Terminal Count (Output drops LOW upon mode load, goes HIGH when counter reaches zero).
  • Mode 1: Hardware Retriggerable One-Shot (Generates clean one-shot pulse on GATE trigger).
  • Mode 2: Rate Generator (Frequency divider; outputs a single-clock-wide pulse once every $N$ input clock periods).
  • Mode 3: Square Wave Generator (Outputs continuous 50% duty cycle square wave; used for PC system timers and baud rate generators).
  • Mode 4: Software Triggered Strobe (Outputs low strobe pulse upon counter completion).
  • Mode 5: Hardware Triggered Strobe (Outputs low strobe triggered by rising edge on GATE).

4. Intel 8257 / 8237 Direct Memory Access (DMA) Controller

When bulk data must be transferred at high speeds between memory and high-throughput peripherals (hard drives, network interfaces, graphic framebuffers), routing every byte through CPU registers creates an unacceptable bus bottleneck.

The DMA Controller solves this by taking direct mastership of the system buses:

  1. The peripheral asserts a DMA Request (DREQ) to the 8257.
  2. The 8257 asserts the CPU's HOLD pin.
  3. The CPU completes its current bus cycle, floats its address, data, and control pins into high-impedance state, and asserts HLDA (Hold Acknowledge).
  4. The 8257 takes control of the system bus, asserts DACK (DMA Acknowledge) to the peripheral, outputs the physical memory address, and asserts simultaneous MEMR# and IOW# (or IOR# and MEMW#), transferring data directly between memory and peripheral in a single bus cycle without passing through CPU registers.

Series Conclusion & Next Horizons

Congratulations! You have completed the comprehensive 12-part masterclass on Microprocessor and Microcontroller Architecture. From the microscopic physics of 4-bit PMOS silicon to pipelined x86 processing units, Harvard embedded microcontrollers, and multi-chip peripheral bus arbitration, you now possess a unified, rigorous engineering understanding of the foundational engines that power modern digital computing.

Share:
Share on X
Share on LinkedIn
Share on Facebook
Share on Reddit
Share on WhatsApp
Share on Telegram
Copy link

Related reading