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

29 April 2018

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

Leave a Comment

Building the Decoder Board

After several weeks of waiting the Decoder Board PCBs arrived just in time for a bit weekend assembly and testing. I'd ordered the other components required for the build a couple of weeks ago and had them laying around in anticipation.

Aside from the various electronics, I decided to use a ZX81XT extender board purchased some time ago from Sell My Retro. The ZX81XT is perfect for prototyping or just for swapping various project boards in and out without the need for multiple edge connectors.

ZX81XT extender and Easy Add-On Decoder Board PCBs

As my decoder board at its core is a part for part update on the original design as presented in the 'Easy add-on Projects for Spectrum ZX81 & ACE' book, I pretty much followed the general assembly instructions given in the text. This process was exceedingly helpful during the various testing phases outlined during the build procedure.

The major update in my version of the decoder board is the substitution of through hole components for SMD parts. Being the first time I've willingly used SMD parts I was expecting quite a challenge. The good news for anybody else finding themselves slightly apprehensive of incorporating SMD components into projects is that it's actually quite easy to use them. The most problematic parts I found to be the tiny resistors and capacitors. I managed to loose a couple of the minuscule resistors by simply dropping them into someplace never to be found again. Dealing with and soldering of the SMD ICs in comparison was all very straight forward.

Fully Built Decoder Board Ready for Testing

After about an hour and a half I had the decoder assembled ready for some final testing. This is where I hit a slight snag. The first project in the book, 'Pulse Detector' serves as the final assembly test for the board. Unfortunately I neglected to order the ICs required for the test project.

I figured it should be possible to conduct some testing with a simple 555 timer circuit. I did however wish to ensure that what ever it was I built would be genuine test of the decoder. Luckily the book had such a 555 timer circuit I could easily modify, 'Project 5, Beeper'. Simply removing the Beeper part of the circuit (which I also had no components for) and replacing it with an LED would prove the board worked.

LED 555 Test Circuit Connected and Working on a Spectrum Omni.

I first tested the Decoder Board on a ZX81. This requires entering a program listing appearing in the books appendix. The ZX81 has no built in BASIC commands to read or write to expansion BUS, the programs listed in the book addressed this absence. After entering an running the application I successfully blinked an LED, a positive right of passage for any micro controlled project. I then moved the decoder board across to my recently acquired ZX Spectrum Omni (deserving of it's own blog entry sometime soon). Again the LED blinked as expected.

All in all everything has worked as expected, time to pick up some extra electronics and build some of the books proper projects.

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

Read More

1 April 2018

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

Leave a Comment

Re-Design the ZX81 Decoder Board

In the previous blog entry I left off before starting design work on the Decoder Board. The board is an essential build before attempting any of the 'Easy add-on Projects for Spectrum ZX81 & ACE'. In reality it's the first project of the book, even if it's not fully described until Appendix A.

First up I needed to transfer the circuit diagram provided in the book into Fritzing and build up a new circuit board compatible with the ZX81. I really could have made life easier for myself simply by printing the circuit board designs included within the book. My plan however is to use surface mounted ICs' instead of through hole components, both modernising the design and shrinking the boards footprint.

Decoder Circuit as presented in Easy add-on Project for Spectrum ZX81 & ACE

My intention was also to follow the original Decoder Boards layout reasonably closely. Ensuring any projects described by the book would still be referential to the end product. My main concession was to design around the shorter ZX81 edge connector only. This does not prevent a ZX Spectrum from using the device as a Spectrums' BUS is compatible with all signals used by the board.

To make life somewhat easier I combined the top and bottom layers of the circuit board layout presented in 'Easy add-on Projects' pages 166-167 into one image. Using the composite picture as a guide I began the layout my board. I'm quite glad I took this route as I noticed a couple of minor errors I'd made in transcribing the circuit diagram. More interestingly however the described circuit didn't seem to match with the board layouts provided by the book.

Composite Image of top and bottom board layouts as taken from the book.

A couple of traces from IC2 to IC4 appeared to be different between the books board layouts and circuit diagram. This was more than a little confusing. I checked the Jupiter Ace board layout (also in the book) against the ZX81 / Spectrum boards, and the designs seemed consistent. I decided to go about about updating my circuit diagram, bring it in line with the book layouts.

After quite a bit of triple checking I now have a circuit board design ready to send off for fabrication. My new (mostly) SMD board is approximately half the size of the original design, good for keeping fabrication costs down. I've also added a few extra clarifications and helpful labelling to the silkscreen layers.

Now to order some parts, check the design again before sending it off and hope for the best.

Final design for the new Decoder Board

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

Read More