Wednesday, February 27, 2019

ZX-Key, External Keyboard For ZX81s and Other Micro Computers: Part 2

This blog entry I'll take a quick look into the ZX-Key Expansion interface required to get the ZX-Key Keyboard working with a ZX81.

ZX-Key ZX81 Keyboard Interfacte Card
Final Production ZX-Key Expansion Interface

The ZX-Key Expansion Interface for the ZX81


Primarily the expansion board is based on Wilf Rigters' designs. Changes I've made along the way have been minor, and don't on the whole modify how the original design works. Best refer to Wilfs article for an excellent account and explanation. It's enough to say that there are two 74HC245 ICs that handle the decoding of the ZX81s BUS and afford the implementation of a matrix keyboard.

The modifications I've ended up making to the original design have been necessitated by the desire to use the Keyboard component of the project with ZX81s, the RC2014, (or other mircos) and PCs via USB.

First Iterations

Initially I breadboarded a portion of the circuit for some basic testing, just for a bit of satisfaction. Unsurprisingly that worked perfectly fine, so went ahead and built up a prototype PCB version.

Breadboard Test
For the PCB I added a +5v rail for powering an Arduino Pro Micro which is located on the keyboard PCB and also broke out the ZX81s reset line. In addition diodes used on the row lines have been moved from the Interface to the Keyboard PCB (See the Keyboard Blog Entry - Coming in Part 3).

All seemed to work just fine (after a stupid layout issue and a bit of trace cutting), however on deeper inspections I ran into a major problem when using the popular ZXpand SD card reader in conjunction with the keyboard. The ZXPand would often not read an SD card, or if it did would load corrupted applications or files.

This seemed to be a power related issue, as powering the Arduino Micro via USB instead of through the ZX81 mostly resolved the problem. Removing the Arduino entirely completly solved the issue, with the keyboard working normally. In summary while the decoder interface worked fine, it didn't in combination with the enhanced keyboard.

Testing the ZX-Key Prototype Keyboard and Interface with a ZX81
The First Iteration: Well it seemed to work fine, but a ZXPand looms in the background.

Second Iterations 

To resolve the power problems I added voltage regulator, this takes power from the +9v rail supplying both the interface and the attached keyboard. Additional diodes on the column lines were also added to the keyboard PCB.  Thankfully these changes solved all the niggling issues with the ZXpand.

Due to the additional diodes on the Keyboard increasing the voltage drop, the CMOS 74HC245 ICs were replaced with 74HCT245 ICs, the TTL level equivalents. TTL signals provide an extended logic level voltage range counteracting the voltage drop in the signals coming from the Keyboard.

Interestingly, the changes made to the keyboard and the changes made to the interface both worked independently. So I've managed to solve the problem twice.


ZX-Key Expansion Card Schematic


See more entries for this project: Part 1Part 2Part 3Part 4Part 5


Wednesday, February 13, 2019

ZX-Key, External Keyboard For ZX81s and Other Micro Computers: Part 1


Ever dreamed of a decent external keyboard for your ZX81? Ever thought you needed the perfect keyboard to use with ZX81 emulators on the PC or a Raspberry Pi? Or how about a keyboard to compliment the RC2014 or perhaps another 8bit hobby project? Well I desired all these things in one convenient package, now finally after a little hard graft I have just such a keyboard.

ZX-Key Keyboard Connected to a ZX81 via expansion interface
Near final design of the ZX-Key, the keyboard connected to my ZX81 via expansion card.
Over the next few blog entries I'll attempt to detail the construction of what would become the ZX-Key, a keyboard Designed to be used on multiple projects.

Starting Out

I've been flipping between several small projects recently, and all these have required a keyboard of some sort. I really desired a keyboard that would be usable by all of these builds. Of course you could argue that a USB keyboard would be good enough, but then there is no fun in that at all, plus what would a blog called ZX81 Keyboard Adventures be if the keyboard didn't work with a humble ZX81 as well.

The idea behind the ZX-Key came from two sources. Initial inspiration came from Chris Oregan of The Sausage Factory fame (although for Retro Asylum at the time) and live steam featuring his ZX81 setup which includes an original Memotech Keyboard. I'm not afraid to admit I was quite jealous of Chris's keyboard. Secondly Spencer Owens Universal Micro Keyboard for his RC2014 would from the starting point of the ZX-Keys design.

Chris Oregan's ZX81 with Memotech Keyboard
Spencer designed his RC2014 Micro Keyboard around the layout and configuration of the ZX Spectrums, which by more than coincidence is near identical to that of a ZX81s. With the use of an Arduino Pro Mini his keyboard can be connected to a PC via USB oa TTL Serial to the RC2014. Allowances are also been made for direct connection to a Micro Computer, such as the ZX81.

As I've built a number of USB keyboard interfaces designed to work with Sinclair related keyboards before, including the whole reason for this blog site the AZ15, borrowing from the ideas behind the RC2014s Micro Keyboard seems a natural fit. Talking to Spencer this idea has come a little full circle as we've both taken inspiration from Dave Curran's (Tynemouth Software) projects.

With the basic idea of the keyboard at hand, I needed a way to connect it to a ZX81. For this there are two options, either connect directly into the heart of the machine replacing the existing membrane keyboard, or build an external expansion interface card for ZX81 and keyboard. The cleanest option being the second. I'm certainly not the first person to want a quality external keyboard and therefore not the only person ever to build an expansion card. Back in 2004 Wilf Rigter published the schematic of his ZXKBD v3 ZX81 keyboard expansion and it is this design that would form the core ZX-Key's expansion card.

That about wraps up the starting point of the project, next time I'll take a look into the core of the keyboard, it's layout and some of the choices made for the final design.

Before I move on, here is a quick YouTube video preview into the (near) final product working with both an emulator running on a Raspberry Pi and then connected to a ZX81 via the expansion card.


See more entries for this project: Part 1Part 2Part 3Part 4Part 5