The ZX81 Keyboard

The ZX81 keyboard is read in a typically economical manner. It reads from I/O addresses that have single address bit low. The address lines are connected to the keyboard via low-drop signal diodes. In this way they pull one side of a row of keys low. If any of these are pressed, they are read from a single input port.

As a cost-cutting exercise, a few diodes are very cheap. From an EMC point of view, it raises problems. The address lines are driven all the time, not just when reading the keyboard.

It is possible to alter the design to provide keyboard matrix driver signals which are only driven during keyboard reads. They can also be made open-collector so that the diodes are not needed.

The ZX81 reads the keyboard data from the I/O map, as 8 rows of 6 columns like so:

Address   Data
15 14 13 12 11 10 9. 8.   4 3 2 1 0
1 1 1 1 1 1 1 0   V C X Z SH
1 1 1 1 1 1 0 1   G F D S A
1 1 1 1 1 0 1 1   T R E W Q
1 1 1 1 0 1 1 1   5 4 3 2 1
1 1 1 0 1 1 1 1   6 7 8 9 0
1 1 0 1 1 1 1 1   Y U I O P
1 0 1 1 1 1 1 1   H J K L nl
0 1 1 1 1 1 1 1   B N M . sp

PS/2 Scan code to ZX81 Matrix conversion

Daniel Wallner has written a PS/2 to ZX81 matrix interface in VHDL. It does not have a FIFO buffer but then again these may be dispensible.