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 4


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 LED 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 4


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 4


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 3, Part 4


Read More

25 July 2018

To TRS-80 COCO 2 Or Not To COCO

2 comments

I've had a TRS-80 64K PAL Colour (not Color, it's an Australian version) Computer 2 laying around for a little while now. Purchased as an untested item and as such I presumed would have some issues to deal with. Thankfully I've finally I found some time (in amongst everything else)  to look into what issues if any there might be, and decide if it's worth going further and conducting a full restoration.

Plugging the computer in and turning it on revealed that there was indeed some life inside; but it's bit of a half life with a screen full of garbage characters. On the plus side the garbage is over a green background, green being the colour it's supposed to be. I was suspecting this was going to be a DRAM issue, a little bit of googling seemed to confirm suspicions. Time to open the COCO up.

First switch on of the COCO and a load of Garbage Characters on the screen.
From the awful amount of rust on the modulator it appears the computer has had a hard end of life.  It looks as if the COCO's spent some time in damp back sheds and garages. What we're looking for at this stage though is the DRAM. This is to be found on a plug in board hovering above the motherboard, with some cardboard shielding over it.

TRS-80 64K PAL Colour Computer 2 Motherboard
Arranged in a row on the plugin board, are eight 8k MB8264A DRAM chips, these provide the systems total of 64k. Unfortunately the DRAM is soldered onto the plugin board, these needed to be removed to find the problem ones. Rather than solder replacement DRAM back in directly I also took the opportunity to solder IC sockets.

Plugin DRAM Board, eight 8k MB8264A chips.
After some time consuming un-soldering a bit of snipping, re-soldering and finally mounting new DRAM, four ICs in total the Colour Computer came back from the dead. I now have the expected boot screen on a green background, this is a good start.

I'm not sure if it's the LCD TV, the computers modulator or something else, but the quality of the display is abysmal. Still now that I know the computer is essentially working I'm going to give the whole system a going over and full restoration.

Plenty more updates and some proper investigations into the world of TRS-80 Colour Computers to come.

And We have a Working Computer, Sort Of.


Read More

1 July 2018

ZeaMouse V2, USB Mice for the ZX81 & Spectrum Revisited: Part 2

Leave a Comment

The ZeaMouse version 2 firmware should take a USB mouse and have it function in a similar fashion to a Commodore 64s 1351 mouse. The 1351 had two modes of operation, an analogue mode and a digital compatibility mode. In digital mode a 1351s analogue movements are converted into digital signal for use on standard Atari style joystick port.

The trick to the converting an analogue like signal to a digital one is in the preservation of the proportional analogue mouse movement feel. Complicating matters is the host computer and the particular piece of software reading the joystick port at any given time.

In version one of the ZeaMouse I thought I'd got the mouse timings and movement about right. However at the time I only had a ZXPand equipt ZX81 for testing. Unfortunately what I though was working well was in reality only doing so for the ZX81. Thankfully I've acquired a ZX Spectrum Omni which has a Kempston compatible port, and so have been able to conduct more extensive testing this time around.

After about a month of testing I'm satisfied the mouse interface works just as well with the Spectrum (Kempston and Sinclair adapters) as a ZX81. Note that the Spectrums joystick ports should provide power on pin 5 else you'll need to power the mouse interface externally.

Proportional movement is simulated by keeping the joystick direction triggered for longer periods the more the mouse is moved in a constant direction. Getting the acceleration just right proved a little tricky. The mouse is also decelerated, but this happens at about twice the rate of acceleration.

The latest firmware ZeamMouse_V2_03.tar.gz is now avaliable for download, as always newer versions as they become avaliable are on the ZX81 Projects page.

To compile the ZeaMouse project a copy of the Circuits@Home Arduino USB Host Shield  library is also required. This is available from the Git Hub repository: https://github.com/felis/USB_Host_Shield


Using a USB Mouse in the 'The Artist 3'

See more entries for this project: Part 1Part 2

Read More