A Keyboard Interface For Your SInclair ZX

The SInclair ZX 8-bit computers of the early 1980s were masterpieces of economy, getting the most out of minimal hardware. The cassette tape interface was a one-bit port, the video was (on the first two models anyway) created by the processor itself rather than a CRT controller, and the keyboard? No fancy keyboard controllers here, just a key matrix and some diodes between a set of address lines and some data lines. The ZX80 and ZX81 were not very fast as a result of their processors being tied up with all this work, but it ensured that their retail price could break the magic £100 barrier in the British market, something of a feat in 1980.

A host of hackers still devote their time to these machines, and among them [Danjovic] has updated that ZX keyboard by producing an interface between that matrix and a PS/2 keyboard. As you might expect it uses a modern microcontroller board, in this case an Arduino Nano but it doesn’t stretch the imagination to think that a USB equipped board might perform the same task. It sits upon the relevant lines, and performs the necessary logical connection between them depending upon the serial input from an attached PS/2 keyboard. The project goes into some detail on PS/2 to ZX mappings, but perhaps of most interest is its explanation of the bus timings involved. The Arduino makes use of the ZX WAIT line to hold the Z80 and ensure that there is enough time for it to perform its task, it would be interesting to note whether or not this has a visible impact on BASIC program timing.

We are more used to seeing ZX keyboards being attached to PCs, rather than this way round.

ZX Spectrum image: Bill Bertram [CC BY-SA 2.5].

11 thoughts on “A Keyboard Interface For Your SInclair ZX

  1. Very interesting project because the keyboard is the weakest link in all ZX computers and very prone to fail over time. Even the third-party keyboards from the era were not very good.

    1. My attempt at attaching a “real” keyboard to my TS 1000 killed it.
      Last month I purchased another TS 1000, but its keyboard “ribbon” cables have broken from brittleness,
      _IF_ the TS 1000 works, this would be “A Good Thing” (TM) for me to implement.

    1. Many microcontrollers with USB host support can do that for ages, no need for the latest hyped hobbyist fad.

      And obviously, USB interface chips exist, such as the one you can find on something enigmatically named “USB Host Shield” and clones, with a matured Arduino library and many examples available.
      Now with all the complex work already done, documented and simplified, if only you could try to do it yourself…

    1. Didn’t Venus de Milo have arms originally? IIRC, they were folded in front of her to protect her modesty.
      And then some teenager came along, and just wanted to take a peek…

  2. I’ve been thinking about adding a proper keyboard to my Jupiter Ace (similar to ZX81 but runs native Forth). I bought it after the company folded, and the one I have is just the fully-populated board with rubbery keyboard moulding, but without a case so it’s difficult to use as the rubber doesn’t stay in place. I gave up trying to use it after a short time.

    My half-baked plan was to use a multiplexer chip (‘251 or similar) to select one address line and use the output to enable the output of a register on the data bus. Both would be controlled by a micro (prob Arduino) which reads the real keyboard and translates the key pressed into row and colum data for the Ace. I hadn’t got as far as looking at timing

    This project does something similar and is more fully thought-out. It also mentions the Jupiter Ace so I may give this a go.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.