Egghead.page Logo

How the Sinclair ZX80 Handled Membrane Keyboard Input

The Sinclair ZX80, released in 1980, utilized a cost-effective membrane keyboard that relied on direct CPU scanning rather than a dedicated controller. This article explores the matrix scanning technique employed by the Z80 processor, the software routines used to decode key presses, and the limitations inherent in this minimalist design approach.

The Hardware Matrix Design

To keep manufacturing costs low, Sinclair omitted a dedicated keyboard controller chip, which was standard in more expensive contemporaries. Instead, the membrane keyboard was wired directly to the Z80 CPU through a simple matrix arrangement. The keys were organized into rows and columns, where each key press completed a circuit between a specific row line and column line. This hardware simplicity was crucial for achieving the ZX80’s groundbreaking price point, but it shifted the burden of input processing entirely onto the software.

Software Polling and CPU Scanning

Because there was no hardware interrupt generated by a key press, the ZX80 handled input through continuous software polling. The ROM contained a routine that constantly scanned the keyboard matrix during idle moments in the CPU cycle. The processor would output a signal to select a specific row and then read the state of the columns to determine if a circuit was closed. If a connection was detected, the software interpreted the coordinate pair as a specific character or command. This scanning process had to be carefully timed to ensure it did not interfere with the generation of the television video signal, which was also handled directly by the CPU.

Limitations and User Experience

This direct CPU scanning method introduced several limitations regarding responsiveness and accuracy. Since the keyboard was only scanned when the processor was not busy generating video or executing user programs, key presses could sometimes be missed during heavy computational loads. Furthermore, the membrane technology combined with the matrix wiring made the keyboard susceptible to ghosting, where pressing multiple keys simultaneously could register false inputs. The lack of mechanical travel also meant users had to rely on tactile feedback from the printed overlay rather than a physical click, requiring a deliberate touch to ensure the circuit layers made contact. Despite these constraints, this input method defined the user experience of early home computing and demonstrated how software could compensate for hardware minimalism.