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.

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.



Read More

25 July 2018

To TRS-80 COCO 2 Or Not To COCO

Leave a Comment

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

30 June 2018

A DIY ZX81 Keyboard Period Document

Leave a Comment
Are Looking to build an external ZX81 or Timex 1000 keyboard? Then I have just the 1982(ish) document to get you on your way.

As part of a recent Ebay acquisition of some ZX81 related books I received an additional surprise. Included in the parcel was a rather good period document from the company 'Mule Electronics' which outlines how to attach and build an external keyboard for a Timex 1000/ZX81. As far as I can tell the text originates from the USA, unfortunately there is no further indication of the Companies address or the exact date the document was produced.

Converting Your Sinclair Keyboard: Loose leaf pages from a great little text.
The document 'Converting Your Sinclair Keyboard' provides some still very useful information on exactly how the ZX81s keyboard works and what to look for when building your own external keyboard modifications. Certainly worth a read in conjunction with the other documents out there on the subject.

The documents to good not to share and as such I've uploaded the complete text to the Internet Archive  so go and grab a copy before starting that keyboard project.


Read More

20 May 2018

Easy add-on Projects for Spectrum ZX81 & ACE (Redux): Part 3

Leave a Comment

Let There Be Light Pen

Now that we have a working Decoder Board from 'Easy Add-on Projects for Spectrum, ZX81 & Ace', it's time to get down to some projects. There are a couple in the book I've really been wanting to try out,  Project 2: Picture Digitser and Project 7: Light Pen. Despite our guide books numeric ordering, the Light Pen is by far the simpler build, so lets start there.

The Light Pen Project

As everybody from the 80s knows, the Light Pen is the control mechanism of the future, mice touch screens and keyboards all redundant when you have a light pen by your side, it's truly the wonder input device for the ages.

Typically light pens work with only on CRT monitors; as lines are drawn on a CRT screen a light pen detects the CRTs scan line once it reaches the pen. The time it takes for the light pen to detect the scan line allows the computer to pinpoint exactly where on the screen the pen is placed.

The light pen featured in Easy add-on Projects for Spectrum ZX81 & ACE does not work in the typical way. Essentially the projects light pen functions as a light detector that doesn't detect CRT scan line progression. Working out where the light pen is on the screen is left entirely up to our BASIC programs. As it turns out (thirty plus years on from the books publications) this simplicity is exceptionally beneficial for the projects light pen, marking it just as usable on LCD monitor as it is every was with a CRT.

Orginal Light Pen Circuit from Easy Add-on Projects for Spectrum, ZX81 & Ace
Building the Light Pen and Circuit is not a difficult. I constructed the majority of the circuit on a breadboard, which sits quite nicely just behind the ZX81's keyboard. The LDR is mounted in the tip of an old pen, with a cable running down through the centre of the x-writing implement.  I hot glued the cable and resistor legs to removable nib holder (is that what it's called?) and the cable again where it leaves the top of the pen. This hold everything together quite firmly.

ZX81 and Light Pen attached to the Decoder Board
I was forced to make some minor changes to the circuit as some components can be harder to come by than others. The local (read Australia) walk in Electronics supplier Jaycar don't stock the projects prescribed ICL7611 CMOS Op Amp. In order to get the Light Pen up an running with minimal fuss I substituted the ICL7611 for a general purpose LM741 Op Amp.

Modified Light Pen Circuit
The IC change also made the addition of a couple of resistors necessary. The Output of the Substitute LM741 Op Amp doesn't lower the voltage close enough to TTL logic levels when detecting variances between the light-dependent resistor and reference potential. Two resistors, a 10k and a 4.7k are added to the IC Output that's feed back to the Decoder Board.

ZX81 Light Pen Test Menu Application
Based on the books listings and general project information I wrote up a simple BASIC application to test out the new pen with my trusty ZX81. The light pens status is read by input 3 of the Decoder Board, lines 10 and 20 of the BASIC listing reflect this. Line 10 also stores the machine code routines required for a ZX81 to read the Decoder Board: Refer to Appendix A of  'Easy Add-on Projects for Spectrum, ZX81 & Ace' for how all that works.

Finally, I've added a short YouTube Video of the Light Pen and the BASIC program in action. As can be seen it's really quite effective for simple input tasks.




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


Read More

12 May 2018

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

Leave a Comment
A year ago I knocked up the ZeaMouse, a USB mouse interface for the ZXpand and ZX81. ZeaMouse is a USB to digital mouse expansion board built around an Adrunio USB host shield. A year on it seems like a good time to revisit the project and make some improvements.

Last time part of the fun was building a simple Arduino clone as part of the ZeaMouse. Unfortunately this kept the size of the end product much larger than it needed to be. This time an Arduino Pro Mini 3.3v has replaced the DIY Arduino, matching this with a USB Mini Host shield and some additional components on a home-brew shield sees significant reductions in interface size.

The USB Mini Host shield forms the core of the project and is designed to fit under an Arduino 3.3v Pro mini. The USB shield has all the abilities of it's bigger brother but does with some but comes with some power supply limitations. By default the combination of 3.3 volt Pro Mini and USB host  combination delivers 3.3 volts to an attached USB device. For some hardware the voltage may not be high enough, although all the USB mice (if a limited selection) I've tested have work without issue.

3.3v Arduino Pro Min, USB Shield and ZeaMouse V2 PCB.
The USB Host shield can be modified to deliver 5v to connected devices if required. Details of the conversion can be found on the Circuits@Home website. The modification bypasses the Arduino's 3.3v regulator, meaning that whatever is used to supply power to the RAW inputs must be rated a 5v or lower else you risk frying an attached USB device. The ZeaMouse is powered from the 5v lines on the digital joystick port, so the modification is fine for our purposes. (But check your Micro Computers Specs first).

I decided against using 4066 switching ICs on ZeaMouse V1 as it made designing the single sided PCB a lot simpler. This time, with design simplicity and ease of build-ability screams for the use of 4066s. With the Arduino Pro Mini operating at 3.3 volts and the ZX81 at 5 volts, 4066s provide a simple way of keeping these conflicting voltages separated.


ZeaMouse V2 Circuit Diagram
Although I got a couple of double sided test PCBs fabricated, the ZeaMouse boards are pretty much designed with home PCB making in mind. Only the bottom of the board really needs to be made up. There are a couple of via's must be connected with some straight wire on the top of the board should you choose to build a single sided PCB.

Building the interface is straight forward. The hardest part is probably soldering the Pro Mini and the USB shield together. Constructing ZeaMouse shield itself is a breeze, and will only take about 20 minutes maximum.

Other than two 4066s, the only other components required are pin headers and IC sockets, although all of these are optional. The Arduino and USB Host along with the ICs could be soldered directly to the shield PCB. The only required header is J4, used to enable or disable RS232 communication with the ZXpand. J4 should be left open if using the ZeaMouse on any micro computer other than a ZX81.

ZeaMouse v2 Shield completed.
The connection pads or pin headers on the far end of the shield board should be wired up to an Atari joystick cable or DB9 socket. I had a cable from a broken controller to hand; care needs to be taken re-purposing cables for fear of sending 5 volts down the wrong line. The TX serial out is the one non-standard connection, it's specifically for the ZXpand+, and should be routed to RX on the ZXpand+.

ZeaMouse v2 interface for the ZX81 & ZXpand / ZX81, the ZX Spectrum and other 8 bit micros
Next time I'll cover the firmware and take a look at the mouse in action. No need to wait until then if you're keen to get going; All the files and firmware required to build the interface are a already available on the ZX81 Projects and Programs to Download Page.

See more entries for this project: Part 1Part 2
Read More