Easy add-on Projects for Spectrum ZX81 & ACE (Redux): Part 3
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 ever was with a CRT.
Original 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.
The book Easy Add-On Projects for the Spectrum, ZX81 & Ace, can't be found at https://www.zx81keyboardadventure.com/search?q=Easy+add-on+Projects+for+Spectrum+ZX81&x=0&y=0 Now it can be found at https://archive.org/details/easy-add-on-projects-for-spectrum-zx-81-ace-owen-bishop/mode/2up
The book Easy Add-On Projects for the Spectrum, ZX81 & Ace, can't be found at
ReplyDeletehttps://www.zx81keyboardadventure.com/search?q=Easy+add-on+Projects+for+Spectrum+ZX81&x=0&y=0
Now it can be found at
https://archive.org/details/easy-add-on-projects-for-spectrum-zx-81-ace-owen-bishop/mode/2up
Thanks Alberto, I've updated the links.
Delete