Saturday 26 November 2016

Building a Harlequin ZX Spectrum Clone

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

I've been working on a lot of ZX Spectrum and ZX Spectrum related items recently, and have now built a ZX Spectrum Clone.
The Harlequin is a clone of the ZX Spectrum using standard TTL parts. Based on Chris Smith's excellent book 'The ZX Spectrum ULA: How to Design a Microcomputer' which documents reverse engineering the Ferranti ULA within the Spectrum. The Harlequin is an implementation of that reverse engineered design, it has been around for a number of years, and currently seems to be fairly stably on revision G.
I've been tempted a few of times to buy one of the assorted bare PCB 'Harlequin' boards on ebay, but was never sure if they would work. I was then contacted by someone who had bought a kit of parts and a PCB and had built it and it didn't work, and they wanted me to fix it.
As a sweetener, also included was a second PCB and a partial set of parts they had bought intending to build a second one, but never completed. This was my fee for a successful repair, sounds like a deal to me.
The yellow board they had assembled looked OK to me, the soldering was good, the parts were all in the right place. I decided I should have a go at building the second one, so I had a reference to compare it to.
This second Harlequin, has a nice looking black PCB, and is supplied with the three surface mount parts already fitted, and a good set of instructions and a parts list. I don't normally like black PCBs, but I'll make an exception in this case, although it will make debugging difficult as you can't see the traces.
The design specified 74HC series chips, I don't normally keep those in stock. I think the original 74LS and modern 74HCT parts are better suited to repairs I do, but this is a complete unit, so the time to order a lot of 74HC chips. One part which was slightly unusual was a row of 2SA1175 'E-Line' packaged transistors, I couldn't find these from any of my usual suppliers, so had to resort to ebay. These little tester are great to check that what you have is actually a transistor, the pinout is right and the performance is approximately what it should be.
Construction was pretty straightforward, following the usual patterns of installing the smaller components first. I wanted to do this properly, so I went for decent quality new parts and turned pin sockets etc. and tried to keep things neat. I went for good old 4 band, 1/4W, 5% carbon film resistors as I have been doing those colour codes automatically in my head for over 30 years, whereas the blue 5 band ones I've always got to think twice to work out the value.
There are a few electrolytic caps on the board, and they were very specific about the lead pitch in the parts list, even two different pitch 220uF parts. I was concentrating on getting caps to fit those requirements, and ended up with ones that were the right spacing, but a bit too tall.
That's all the parts fitted now, other than the ICs. I had a good look around the board at this point to check for any missing parts or bad soldering. Yes, R37 is missing, it's optional (trimming for the tape load circuit). All OK, time to power it on. I checked around the board and the 5V rail was live, and the current draw minimal. OK, time to install all the chips.
I've gone for almost matching Texas Instruments chips all around, is that OCD? The EPROM is the one that was fitted to the other board, as this had ZX Spectrum Diagnostics on it. Time to bite the bullet and switch on.
Success! At this point I was trying not to feel smug. I failed. Smug mode on.
A quick check on the power supply, it was drawing around 116mA at 9V, looks about right, nothing getting hot.
I plugged in a keyboard and pressed 1, and let it run through the tests a few times. This was V0.32, V0.33 is now available from the ZX Spectrum Diagnostics site.
All looking good, time to switch over the Spectrum ROM chip. There are some copyright issues over the Spectrum ROM, so I have used an original chip salvaged from a dead board. With the Spectrum ROM installed, up came the normal (c) 1982 message, looks like we have a Spectrum.
Simple BASIC programs run fine, the picture is nice and clear, this is an LCD TV fed via composite video.
There is an RGB socket, but that required cutting the case and making up a custom lead, so I'll stick with the composite video for the moment.
I loaded a few games via tape and it seems to be a very good clone, everything worked as expected.
One of the reasons for building this is to test something I've been working on recently, pleased to say it ran well on the Harlequin board. More on that at a later date, for the moment I have to disguise it's identity, so I am writing this in an actors voice.
I'll need to get some alternate capacitors as the ones I fitted were too tall for the original rubber key 48K Spectrum case. For the moment, I have installed in it a Spectrum+ case and it is running very nicely.
I was planning to write up a separate blog article on repairing the other board, but it doesn't need it. The only part I had found that looked wrong was the resistor array, it was 680R, but the parts list said 470R. That shouldn't make much of a difference, so I changed it. It didn't make a difference.
It's worth noting the part number of the replacement 470R resistor array (centre) is 4116R. Not to be confused with the 4116 RAM chip (below) which would have been in the original Spectrum. I left it in as it seemed a nice touch to still have a 4116 in the Spectrum. Even with the more asthetically pleasing resistor array installed, it was still dead. There was 5V power all around the board, but no video output, and no CPU clock. I started back at first principles and check for the a signal on the 74HC04 which generates the clock.
That's a nicer clock than you would get in a real Spectrum, so that shouldn't be a problem. I traced it through the board, where it is dropped to 7MHz, and then to 3.5MHz, and checked along all the counters which generate the video sync pulses, all seemed to be fine. I checked the circuits which generate the characters, again, all looked good. By the time I got to the composite video connector, the signal was still looking fine. I turned the monitor on, and was greeted by a picture, (c) 1982 Sinclair Research Ltd.
Slightly confused, I turned off the power and swapped in the diagnostics ROM and switched it back on. Now it was dead again. I know that ROM was OK as I used it in the other board, so back to the oscilloscope. As soon as the probe touched the pin on the 74HC04, the speaker made a beep, and the diagnostics popped up on the screen.
This was repeatable, it wasn't a bad joint, it seemed the load of the scope probe was enough to get the oscillator running. I replaced the 74HC04 and tried again and it started itself and now runs fine, so all that was down to a flaky 74HC04 chip. That's packed off back to it's owner, and I'm back to playing Jet Pac on my Harlequin board.

Saturday 19 November 2016

TS1000 Multiregion Composite Video Modification

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

Following on from the previous post on ZX81 composite video modifications, the same can also be done on the Timex Sinclair 1000. The TS1000 is basically a ZX81 with a bit more shielding and a different TV modulator.
I don't have a TV with an NTSC tuner, but most can display NTSC composite video, so this one is getting a composite video conversion as well.
They use the same PCB as the issue 3 ZX81 with very few changes. As you can see from the side view, the modulator output is on the other end of the modulator box. The spring clip contacts the inner metalisation of the TS1000 case for shielding.
Inside the modulator is a different layout, if anything a little easier to work with. This does not have the filtered power pass through, so I just desoldered the three wires and pushed them back into the modulator, folding them down under where the new PCB will go.
I soldered some wire tails onto a composite video buffer amplifier PCB from TFW8B and poked them through the appropriate holes. The new PCB has no connections on the back, so will just sit on top of these.
The top pad on either side are for audio pass through, not used here, and the 0V are all connected together. I used two here for physical support only. The other connections are as follows:

Audio inAduio out
5V in0V
Video inVideo out
0V0V
The power and video in need to be switched around as they are the other way around outside the modulator. The video out connects to the phono connector, and the 0V wires are soldered to the side of the modulator.
I've added some kapton tape to the lid but it is not touching. There is also a big gap under the video input wire which isn't clear from the photos.
The TS1000 can now output NTSC composite video, again a nice sharp and clear picture.
The third connection on the original modulator went to a switch on the rear of the PCB, this selected two different TV channels for the NTSC market. This is redundant now. I did think of making this a power switch, but it's not going to be rated for the job.
The ZX81 can generate either PAL or NTSC. If R30 is fitted, it's NTSC mode, if it's missing, it's PAL. Since the channel switch is now redundant, I have repurposed it to disconnect R30, turning it into a PAL/NTSC switch. To do this I have cut the track from 5V to one side of the switch, and the connection from R30 to ground. The centre of the switch is now wired to the previously grounded end of R30, so in 'Channel 3' position, it grounds R30 and sets the ZX81 into NTSC mode.
The green bodge wires are more obvious against the red solder mask. This one has also had the 7805 replaced with a switching regulator, so there is no heatsink and you can see the earthing strap spring clip.
I've updated the label on the back to show this is a multiregion TS1000/ZX81. With the switch set to NTSC, the output is NTSC composite video.
In the left position (previously 'Channel 2') R30 is disconnected and left floating, which puts the ZX81 into PAL mode. You can see the slight difference in picture size on the NTSC version, the number of pixels in the display is the same, it is just the borders are smaller as it is 525 lines not 625 as in PAL.

ZX81 Composite Video Modification

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

Like many machines of it's generation, the only output from the ZX81 is a UHF television signal. Analogue tuners in Modern TVs (if they even have them) don't like the approximation of composite video the ZX81 generates. Even more so the earlier version with the 2C184E ULA which is missing part of the signal. Results of this modification with that earlier ULA will depend on your monitor, some will still not like the signal - see this blog post on the Minstrel video output for more information on why modern LCD displays do not like the ZX80 and early ZX81 video output.
I've done composite modifications on ZX81 in various ways in the past, usually by fitting a transistor amplifier inside the modulator. Using through hole parts, bending the leads and soldering them to the appropriate place. I though I would try a neater approach. I had made some PCBs to make the same job on the Atari 2600 easier, on the left below.
I also had some boards from The Future Was 8 Bit (on the right), which were a bit smaller, and didn't have the holes in. They were a better fit here as there are no connections on the back of the PCB, so I can just rest it on the original modulator circuitry. You could remove the original modulator PCB if you like, but there is enough space to just leave it in place but disconnected.
I soldered some wire tails onto a composite video buffer amplifier PCB from TFW8B and poked them through the appropriate holes. The new PCB has no connections on the back, so will just sit on top of these.
The top pad on either side are for audio pass through, not used here, and the 0V are all connected together. I used two here for physical support only. The other connections are as follows:

Audio inAduio out
5V in0V
Video inVideo out
0V0V
The power and video in need to be switched around as they are the other way around outside the modulator. The video out connects to the phono connector, and the 0V wires are soldered to the side of the modulator. I disconnected the two original modulator connection wires inside the modulator, where they entered the PCB. The left hand one is the video signal, I replaced that with a longer piece, soldered to the same point on the ZX81 PCB. The right hand is 5V, fed through a bulkhead capacitor. I extended that wire inside the modulator. Those were soldered to the pads on the PCB.
The output of the modulator was desolderd from the phono connector and folded back to the board, and a new wire connected to the new PCB. Finally a ground wire was soldered to the modulator case. These wires also serve to support the PCB.
It does not touch the top of the case, but I added some kapton tape for insulation anyway.
The picture was very sharp and clear on the LCD TV. It works best with the 2C210E ULA, you can get good results with the 2C184E ULA, but it depends on your TV / Monitor (the older the better).
This was part of the 'upgrade all the stuff on my ZX81' package, so I also replaced the 7805 linear regulator with a switch mode version.
The original 1K RAM was swapped out for 16K internal RAM, and a new membrane fitted.
Time for the compulsory testing.
There is an accompanying blog post showing the same modification on the Timex Sinclair TS1000.

Thursday 17 November 2016

VIC20 Penultimate Cartridge Testing

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

The first batch of cased VIC20 Penultimate Cartridges are soon to be sent out by The Future Was 8bit. This is a limited run for the early pre-orders. The final version will be darker in colour, and have a textured finish (a 'sparked' finish, I'm told).
This should fit in well the the current range of Cartridges.
The main shape follows the standard Commodore VIC20 cartridge cases, but the styling around the label follows the breadbin case (and the Commodore 64 cartridges).
This is for both aesthetic and practical reasons. One design flaw in the original cartridges was that you couldn't read the label when it was inserted in the VIC20.
The Penultimate Cartridge label is still clearly visible when in use. The labels on the production versions will be die cut to perfectly fit the case moulding, this early sample is hand cut.
There are two buttons on the top of the cartridge. The one on the right is reset, which will reset the VIC20 to restart the current cartridge (if one was selected), or just perform a normal reset.
The one on the left lights up red, and when pressed brings up the Penultimate Cartridge menu.
When I was first building the uncased versions, I was individually testing them with each order. To automate this as the production runs increase, I've written a test program.
This is placed on an SD card, as the first file on there, in an SD2IEC drive. It can be started using the F8 key (shift + F7), which allocates all 35K of RAM and executes LOAD"*",8. The first test is to test the RAM, all bar the block the program is running from.
Once the RAM has been tested, it switches to testing the ROM images. It does this by selecting each one of the 64 8K ROM images in the cartridge and running a CRC check.
If there is a problem with the ROM switching, or the ROM image fails the CRC test, a failure will be reported.
All being well, it will print up 'PASS' in large, friendly letters.
These new cartridges have custom PCBs to make use of all the space within the cartridge case. I even get a name check in the top copper layer.
This looks a lot tidier than the original prototype board.
The case prototype was also very tasty.
The VIC20 Penultimate Cartridge is available to buy now from The Future Was 8bit, the first full run should be happening next month.
It is planned that they will also be selling the new empty VIC20 cartridge cases. The should fit most standard VIC20 cartridges, including those which make use of the rear PCB cutout such as the VIC-1112 IEEE-488 cartridge.
It will also fit the shorter style boards found in most cartridges, should you want to replace a damaged case. You will also be able to buy new 8K and 16K ROM PCBs to fit this case.
The VIC20 Penultimate Cartridge is certainly not the last product you will see designed by Tynemouth Software, produced and distributed by The Future Was 8bit. We have several projects running in parallel at the moment, so there might be quite a few new product announcements coming up soon.

2022 Update: The production version of the Penultimate Cartridge is now available from  The Future Was 8 bit