Oli's old stuff

Tinkering with retro and electronics

Sep 20, 2020 - 8 minute read - sinclair electronics retro hardware zx81

ZX81 hardware hacking - Homebrew ZX8-CCB

ZX81 Hardare Hacking - Homebrew ZX8-CCB

In my last post I talked about the problems associated with the video signal that the ZX81 outputs. There are various mods that can correct this, with one of the leading ones being the PokeMon ZX8-CCB.

In this post I’ll explore a homebrew hack that aims to recreate the ZX8-CCB for fun and educational purposes.

DISCLAIMER

This is not endorsed or associated with the original ZX8-CCB project in any way. It is an imperfect recreation of the original for my own learning purposes.

Please go out and support Karl (PokeMon) by buying some of his items on SellMyRetro when he’s back in action!

The Problem

I have two ZX81’s, an Issue 3 with ULA version ULA2C184E and an Issue 1, which also has a ULA2C184E ULA.

ZX81 Issue One - Main Run

Unfortunately the ULA in both my machines is missing the “back porch” in the composite video signal which causes a very washed out signal on my LED TV.

ZX81 Picture

I have already built the ZX81 video conditioning circuit from zx.zigg.net and installed it inside my modulator can of the Issue 3 machine. This wasn’t so popular with the more hardcore retro conservatives as it removed the modulator board, so for the Issue 1 machine I decided to have a go at a different approach.

It would have been perfectly reasonable to have installed the zx.zigg.net circuit inside the main case of the ZX81, but I felt that this time around I wanted to take a look at the PokeMon ZX8-CCB. Unfortunately for me, COVID-19 has meant that Karl (PokeMon) has closed his shop for a bit, meaning a ZX8-CCB is out of reach for the time being.

I decided to use this as an opportunity to learn something new, so set about recreating the ZX8-CCB at home.

ZX8-CCB Features

The ZX8-CCB comes in a couple of variants; the original and the ‘sync’ version which ensures great display from the ZX80/ZX81 even in fast mode.

The version we’ll be looking at here will:

  • condition the signal to ‘acceptable’ voltage ranges
  • inject a ‘back porch’ into signal after the sync pulse
  • provide an optional picture inverter

My last post talked about how the ZX8-CCB actually works, so this time around we’ll go about designing a layout that can be created at home on perfboard.

Schematic

The original schematic is available for the ZX8-CCB.

Some people like their schematics to show the real, physical connections - I prefer mine to be more concise as I find it makes it a little more readable.

ZX81 ZX8-CCB Redrawn schematic

I redrew the schematic in KiCad to remove some of the clutter from the wires. The act of redrawing it also helped me understand how things were connected which helped the layout phase.

Bill of Materials

The original parts used are SMD packages which aren’t really perfboard friendly; so I reworked it for through-hole. Unfortunately this meant moving up to DIL packaged logic chips too, which meant we need more space on the board but also that we end up with quite a few unused gates.

I decided to source LS logic ICs too instead of the LVC parts used on the original. One side effect of this choice bit me when debugging - the output logic levels of LVC are 3.3v, but LS are about 4.5v. This meant I had to adjust a few resistance values in the final mix-in - I haven’t got them perfectly right, but they’re good enough for my purposes.

Here’s the parts that I used to build this:

Designator Qty Desc Value Note
C1, C2 2 Ceramic Capacitor 10uF
C3 1 Ceramic Capacitor 1uF
R1, R2 2 Variable Resistor 5K
R3, R4 2 Resistor 10K
R5 1 Resistor 22R The original uses 220R here
R6 1 Resistor 330R The original uses 390R here
D1, D2 2 Small Signal Diode 1N4148 The original uses a double-diode SMD package here
D3 1 Small Signal Schottky Diode BAT42
SW1 1 Small SPDT Switch Used for the colour inverter. You can make this permanent by using a wire link
IC1 1 74 ‘XOR’ logic IC SN74LS86AN
IC2 1 74 ‘AND’ logic IC SN74LS08N The original used 2x single AND ICs, but this has 4 gates
S1, S2 2 DIL socket 14-pin This is optional, you can skip this if you don’t want to socket your ICs

In addition to this, both wire jumper links and insulated wire is required; I used 30AWG wire as I had some around.

Finally, a piece of stripboard of at least 23 columns and 15 rows is needed for this layout.

Layout

I used the rather excellent DIY Layout Creator to design the board here. It’s free, but if you do enjoy using it then please consider donating a coffee to the author!

Here’s the board I ended up with:

ZX8-CCB Perfboard layout

I designed this layout to be easy to assemble and tinker with - it was a homebrew hack project afterall. I’m sure that it’d be possible to create a much more compact design, especially if you’re willing to sacrifice the colour inverting feature.

The layout here is the result of a couple debug iterations; if I were to go back and rework it, there’s a few small changes I’d make - the main would be to remove the bodge wire that feeds the XOR switch. It’s no longer needed, but I left it in to stay true to what’s sat on the bench!

Results

ZX8-CCB Perfboard prototype

The final board size is 60mm x 43mm, so is definitely too big for the modulator can - but it’s a reasonable size to fit inside the case.

The white wire and second ground wire are intended for the RCA jack on the modulator. However I tested this directly by using crocodile clips onto the yellow AV cable to my tv (white wire to the centre pin, black wire to the outer shielding).

Wiring this into the ZX81 would mean following a similar procedure to that advised in PokeMon’s ZX8-CCB manual. Remove the power and signal to the original modulator, then connect the wires on the prototype board up to various points on the ZX81 main board.

ZX8-CCB Perfboard prototype - white picture

The normal picture has very nice contrast; the white is bright and the black is dark.

ZX8-CCB Perfboard prototype - inverted picture

The inverted picture is - quite frankly - stunning. I really like the black and high contrast of the white characters. I am definitely considering using this more.

One change I am considering is to put the SPDT switch on a pair of wires so that I can access the invert function outside of the case. The inverted picture is too good to not use, but I don’t know if I’d want it on permanently!

The signal

So what does the signal look like from this thing?

ZX8-CCB Perfboard prototype - bad, but working signal

Here’s the main parts:

  • Zero is at ~0.2v
  • White is ~1.8v
  • Voltage range is 1.6v
  • Black is ~1.5v
  • Difference between black & white is ~0.3v (!)

Frankly, it’s not very good. It’s a long long way from “ideal” and I’m surprised the TV deals with it as well as it does.

The back porch is irregular - sometimes it doesn’t even show in the trace. It is there, I can isolate it on the scope.

The cause of this is all down to the various “mix” levels of the signal parts not being in correct proportion. This is almost certainly due to the original ZX8-CCB being “tuned” for the 3.3v logic levels, whereas this board is operating closer to 5v (approx 4.5v).

There’s a few things we can do here:

  • Remove one of the diodes in the double configuration, this will cause less of a drop from the 5v input source
  • Change out the ICs from LS to lower voltage versions
  • Rebalance the resistors that perform the final mix

I’ve tried tweaking the latter on the board itself, but it’s hard to get that right where solder is involved.

ZX8-CCB Perfboard prototype - tweaks

The signal here is an attempt at fixing it with different resistor values; it looks fine, but it appears dark grey. This is due to the relatively high spike at the white level before the pixel burst. It also looks like the sync pulse and back porch aren’t mixed so well; it’s hard to tell if we’re looking at a long sync pulse and no back porch, or a tiny sync pulse and a back porch that’s disproportionate to the real “black” level.

The next steps for me will be to go back to the design and start figuring out the correct values using circuit analysis techniques. This will be new for me as I’ve had no formal training in electronics. Part of the joy of this hobby is learning new things, so it seems like a good next step for me to take with this.

Wrapping up

This was a fun build and results in a fantastic picture on the ZX81; I especially enjoy the ‘dark mode’ inverted picture feature.

The signal needs work to bring it closer to ‘correct’. The signal is clearly good enough for my TV; other TVs may not handle it though. But this board is good enough for my TV, which is really what this homebrew hack is about.

I would like to thank Karl (PokeMon) for his excellent work on ZX8-CCB. If you need a board, then go check out his shop on SellMyRetro, I’ll be looking to pick up a few items when he reopens it!

If you decide to have a go at my homebrew build or have any advice on where I can improve things - please let me know on twitter!