29 May 2019

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

Leave a Comment

The Full Case For ZX-Keys

I've been promising a full keyboard case for the ZX-Keys ZX81 keyboard for a while, now at long last it is (almost) complete. Complete enough that have in my hands a freshly minted case fresh from Shapeways, and it looks gorgeous.

The Full Case builds on the Starter Case covered in the previous blog post, adding the top half and a bottom plate. As mentioned previously only the Starter case is really required, but for some smart good looks the top half is a must have. Of course for the sake of competness a bottom plate may also be attached.

Exploded Viw of the ZX-Keys Case Components
 The top half of the case is really where all the action takes place. The ZX-Keys mode indicator LEDs and reset switch are slightly recessed at the back, with some nice speed lines running either side, lending a retro 80s feel. A small hole is left open to the right of the case allowing a USB lead to be plugged in when using the keyboard with a PC or MAC. At the rear of the case the IDC connectors for serial out and direct connection the ZX-Key expansion interface are nicely flush.

The Rear of the ZX-Keys Keyboard Case, Showing the Flush Mounted IDC Headers.
The whole unit is help together with 3mm diameter case bolts. A 6mm bolt and nut hold the centre of the base plate to the keyboard, all other bolts are 8mm in length and may be screwed firmly into to case holding the unit tightly in place.

Right of the ZX-Keys Keyboard Case, with cutout for micro USB Access.
Attached to the inside of the top case is a sprew containing two Switch Cover components for mounting on the keyboards reset switch. The exact Switch Cover to be fitted on assembly depends on the micro switch found on the ZX-Keys PCB. A hollow stemmed version for use with long barreled micro switchs, or a flat bottom variety if shallow micro switch is in place. The Switch Covers should be placed inside the top shell the before assembly.

ZX-Keys Base Plate and Mounting Bolts.
The only real issue I have with the beta case print is with the base plate. I found the plate to be a little flimsy, and it'll need to strengthening it before general release. Notably the grill like pattern on the base will be removed and made solid. Additionally the riser bars along inner sides will be widened to add a little extra rigidity.

My ZX81, pictured with the complete ZX-Key Case and ZX-Keys Interface Card.
The ZX-Keys itself is for sale on Sell My Retro, At the time of writing there is one unit available, never fear more are on their way very soon. The Starter Case can be found on Shapeways., and the Full Case will be made ready for purchase there very soon.

Once I've completed work on the Full Case design a DIY Beginners Case for home 3D printing will also be made avaliable. The Beginners case will be based on the Starter Case design, although it will not be full compatible with the complete case units. All will be announced ASAP.

Update: All Case Parts are now avaliable for order from my Shapeways Shop.


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

Read More

10 March 2019

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

Leave a Comment
Some of you may have noticed that a batch of ZX-Key units went up for sale on Sell My Retro over the weekend. This has been a great achievement and would not have been possible without some much valued help. When I started this project I'd only intended to make a keyboard for myself but soon found a lot support and others desiring a modern mechanical keyboard implementation for 80s micro computers.

To that end I would very much like to thank Spencer Owen of RC2014 fame for his contributions and ZXkim81 for embracing the idea so fully that he's about to test out the first DIY kit version of the ZX-Key.

Now onto some more about the project so far.

Sundry ZX-Key Design Decisions 

This post is primarily centred around some design decisions on the Case for the Keyboard and the Selection of Key Switches.

Mechanical Key Selection

Selecting the right Mechanical switches for the keyboard was a slightly more difficult task than you might imagine; in the end I chose Gateron Yellows, a firm to medium weight linear switch. The reason for this is twofold, and all to do with how the ZX81 registers key presses.

The ZX81 can be somewhat sluggish in registering keystrokes. While this is normally quite fine when entering text with the membrane keyboard, moving to a mechanical keyboard makes this lack of speed somewhat more noticeable. This is the reason behind the use of a linear switch, over a clicky one such as MX Blues. While a real keyboard is far more tactile, the use of a clicky switch would give an undue impression that a ZX81 had actually registered the key press when in reality it hadn't.

Gateron Yellow Keyswitch, the Perfect Match for a ZX81 Keyboard

Related to the above;  the use a firm linear switch adds a certain amount of weight, possibly unconsciously slowing down the natural typing rate, bringing key strokes more into line with what a ZX81 expects. On testing I found Gateron Yellow switches a nice match to requirements, and the main reason for not going with the firmer MX black was in keeping the typing experience pleasant, particularly for people not used to (overly) heavily weighted switches.

A Case to Start

All keyboards need a case of some sort. The trouble here of course is that all bespoke keyboards require a very specific case, one that can end up being quite the expense. For the ZX-Key keyboard case my main goal was to first make it relatively affordable, and secondly I desired a design that could be upgraded over time.

Essentially the Starter case I came up with is more of a keyboard frame than a full case. The ZX-Key keyboard is screwed in place with some 3mm diameter 6mm long case bolts. Provision on the base has been made for standard 12 x 12mm rubber feet to stop the keyboard from sliding around on a table.
ZX81 Mechanical Keyboard in Case
The ZX-Key Keyboard Mounted on the Prototype Keyboard 'Starter' Case
Also of note, the case has a gentle 2 degree slope from front to back for an easy typing angle. A higher angle felt a little exaggerated on such a small keyboard.

I've been using the initial prototype for some time now, and have found it provides quite a good level of rigidity. I did make a few errors on the original, mostly around spacing, and in the height of the lip around the keyboard PCB. All issues have been addressed and the fully revised version of the ZX-KEY Keyboard 'Starter' Case has been made  made available on Shapeways.

Bottom of the Prototype Keyboard 'Starter' Case
As alluded to, there will be 2 more case parts designed, a simple backing for underneath the keyboard and a somewhat more elaborate top half styled to suit a Sinclair product. However I felt it important to make these components entirely optional, particularity as larger 3D printed objects can become quite expensive.

Of course the case as a whole is entirely optional, and if you make your own then I would welcome seeing pictures.

Final Production Ready ZX-KEY Keyboard 'Starter' Case as Found on Shapeways

I will be releasing the complete set of case parts to Shapeways in the coming month or so, if you would rather wait for the complete unit.

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


Read More

7 March 2019

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

2 comments

The main goals of the ZX-Key project has been to build a mechanical keyboard usable on real ZX81s, PCs (particularly in emulators) and on the RC2014 or other computers with serial keyboard inputs. This entry we'll go over a couple of the details relating specifically to the Keyboard component of the build.

Final prototype ZX-Key ZX81 Keyboard
The ZX-Key Keyboard

The ZX-Key Keyboard

The keyboard layout is based around the 8x5 matrix format found on the Sinclair ZX81 and ZX Spectrums, which makes sense as that's what it's designed to be used with.

The main keyboard circuit is also almost identical to a ZX81s, with the addition of a Arduino Pro Micro enabling the ZX-Key to be used as a regular USB PC keyboard. Connection to the ZX-Key ZX81 expansion interface is facilitated by  a 16 pin IDC header.

Additional diodes have been added to the 5 row lines, these  prevent some issues found when testing the prototype keyboard with a ZXpand expansion card. When the ZXPand read an SD card, its current draw caused some instability with the Arduino. This problem was also addressed on the ZX-Key interface card by proving it with an independent voltage regulator.

A reset line has been brought out from the ZX-Key interface card, and is presented on the 16 IDC header so there is no need to turn the ZX81 off an on to restart the computer. Similarly the 6 pin IDC connector provided for TTL serial communication also provides a reset line broken out for using the keyboard in conjunction with a RC2014 micro.

The pull down 100k Resistor on Column 8 allows the Arduino to detect the presence of a ZX81. As the Arduino powers on or when reset it first tests the status of this column to determine what mode it should start in, either Standard USB / PC or ZX81 mode.

ZX-Key Keyboard Schematic

The Arduino Bit

While connected to a ZX81 the Arduino is essentially dormant, only handling some minor LED visual indicators. However when not connected to a ZX81 the Arduino Pro MIcro takes control, turning the keyboard into a fully functional USB HID (device).

In ZX81 mode with the ZX-key interface connected via an IDC ribbon cable, the ZX-Key will behave as a standard ZX81 keyboard, except with a much improved typing experience. When the keyboard is unconnected, plugged in via USB or serial port the keyboard will start in Standard PC mode.

Keyboard modes and selected layers are indicated by a cluster of three LEDs on the right hand side of the keyboard. There are three keyboard Layers, Standard, Emulator and ZX81. You can switch between Standard and Emulator layers by holding down SHIFT, FUNCTION (ENTER), and GRAPHICS (9) key combinations. The Standard layer has 3 main modes and each of these has a SHIFT layer, this gives access 98% of the keys to be found on a normal USB keyboard.

LED States
Layer & Mode Selected
ON
OFF
OFF
STANDARD
OFF
ON
OFF
STANDARD - FUNCTION
OFF
OFF
ON
STANDARD - GRAPHICS
ON
OFF
ON
EMULATOR
ON
ON
ON
ZX81 - INTERFACE CONNECTED
Standard Layers: Keyboard Mode and Function Selection
NormalNormal mode. All keys are in Standard US Keyboard configuration.
SHIFTWhen in Normal Mode: Symbols in Red are selected. Where these red keys are commands, for example 'EDIT or SLOW' they have been replaced by another symbol. All common symbols are present on the keyboard. Note that SHIFT keys effects vary in each of the other modes
SHIFT,FUNCTIONChanges to Function mode. This selects upper case characters. Pressing the SHIFT key in this mode will select symbols as normal.
SHIFT,GRAPHICSAll the number keys are now there equivalent 'Fx' key, ie. '1' becomes 'F1'. All Letter keys become 'CTRL Letter'. Holding down the SHIFT key in Graphics mode changes the letter keys to 'ALT Letter', number keys '1' and '2' become 'F11' & 'F12'.
Emulation Layer: For use with ZX81 or ZX Spectrum Emulators
SHIFT, FUNCTION, GRAPHICSKeyboard will enter the emulation mode. All Standard Layer mode functions are disabled. This allows Emulation packages to detect key presses as using a standard USB / PS2 keyboard.

You can go back to the Standard layers at any point for entering program Emulator menus with 'F' keys for example.
ZX81 Layer: For use with a real ZX81 plugged into the ZX-Key Interface
Auto DetectionThe ZX81 layer is selected automatically if the keyboard is connected to a ZX81 using the ZX-Key Interface. You can't deselect this mode.

Next time: I'll finalise with the 3D printed case, attach the software and more.

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


Read More

27 February 2019

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

Leave a Comment
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.

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


Read More

13 February 2019

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

4 comments

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


Read More