|
Z80 Build From Scratch |
|
|
PAGE 16: PPI Overview & LEDs |
|
|
82c55A PPI Overview:
The
82C55A Programmable Peripheral
Interface (PPI) is a highly versatile and popular integrated
circuit, often used to bridge the gap between a microprocessor (CPU)
and external peripheral devices like keyboards, displays, or A/D and
D/A converters.
It features 24 programmable I/O lines, organized into three 8-bit ports: Port A (PA), Port B (PB), and Port C (PC), which can be configured by the system software. Port C can be split into two 4-bit ports and can be combined with either Port A or Port B to form 12-bit ports if needed.
The 82C55A offers flexibility through three primary operating modes: - Mode 0 for simple input/output operations without handshaking - Mode 1 for strobed I/O with handshaking signals to synchronize data transfer between devices of different speeds
-
Mode 2
which configures Port A for bidirectional bus communication. For the LED bar graph display we'll use the simple Mode 0 operation.
We discussed using the 74138 back on Page 11 to select our I/O devices. Address $00 is used by the UART, address $08, etc., will be used by the PPI. I/O Addressing Logic (Click to enlarge)
To address each PPI port individually, addresses with a base of $08 will be assigned. As an example Port A will be $08, Port B will be $08 + $01 or $09, Port C will be $08 + $02 or $0A, and the CWRCfg configuration register will be $08 + $03 or $0B.
82c55A Expansion Board Below are the schematics and board design for expansion of our Z80 UART system to include a PCB containing the PPI and two circuits. - LED bar graph - 4 line by 20 LCD panel which we'll look at later We're going to test the PPI by outputting data on Port B to a LED bar graph.
PPI Expansion (Click to enlarge)
Below is a screenshot of the PPI_LEDs.asm file you can view or you can open the code itself.
PPI_LEDs.asm (Click to enlarge)
|
82C55A Pinout (Click to enlarge)
PPI Configuration Mode Definition Format for the Control Word Register (Click to enlarge)
PPI Basic Operation (Click to enlarge)
Short Video Demo (Click to enlarge)
|
Updated 2025-12-17