The ZX Spectrum versus modern legislation

Last week, I finished my article on an uncharacteristically cruel cliffhanger. Before I let the results slip, I should qualify them a little. I have already said that we’re giving this ZX Spectrum a head start, firstly by disabling the TV modulator, and then by allowing the test setup to exclude a TV, cassette recorder, and associated cabling, as would normally be required by the rules.

December’s snow handed our test subject a third advantage. Traffic accidents caused by bad weather cost us two hours in the test chamber, and we were able to take only a reduced set of readings. Six complete frequency sweeps were taken, at three angles around the equipment in horizontal and vertical polarisations, with the antenna at a height of 1.5 metres.

This is the first stage of a radiated emissions test to EN55022. The next would require us to focus on the five most problematic-looking frequencies, determine the angle, antenna height, and polarisation for which these have maximum strength, and ensure that the signal is still beneath the pass line. This accounts for the isolated red crosses on last week’s graph. Such a test would take a couple of hours for us to perform completely.

What do we already know about a ZX Spectrum’s RF performance? Anecdotally, there are a couple of causes for concern. The first is that we can actually hear the machine chirping at us when it’s switched on. Here’s a recording of it (hosted off-site), with the computer loudspeaker playing a suitably Kamikaze tune before the computer resets itself. This demonstrates how horrendously loud this chirping is, and also how it modulates during reset.

The chirping is caused by the circuitry that generates the −5V power rail for the RAM chips. It works by switching current through a transformer coil several thousand times per second. Because we can hear this, the switching frequency is too low to cause much hassle at radio frequencies. However, it implies that corners have been cut. The transformer has been wound fairly crudely and hasn’t been potted to prevent acoustic noise, and the control circuit changes its switching frequency to compensate for the fluctuating load when the RAM starts working. In fact, the whole system is likely to be amplifying and feeding its own mechanical vibrations, generating extra nastiness. No expense spent.

A bigger concern is that, when we look at the screen, we can clearly see the chip’s clock breaking through, manifesting as vertical stripes in the background of the image. This possibly occurs in the ULA chip whose purpose is to glue the screen, memory, cassette sockets, and processor together. It’s producing a fluctuation of a few tens of millivolts on the video signal, and this doesn’t look promising for signal integrity.

The circuit board has two layers, and ‘plated through’ holes that selectively join them together – an unusually exacting specification in the early Eighties, but outdated practice today for a board like this. There is no internal copper plane for the power or ground connections as there would be now, so signal current must flow and return along tracks arranged in wide loops. Large loops are bad from a radiation point of view, because they constitute resonant systems.

It doesn’t seem great so far. As any engineer who knows this computer would suspect, it doesn’t measure very well either:

Final readings could easily be 10dB or more above the peaks on this graph, so it’s not just a failure; it’s an abject one. Even that fuzz just above 100MHz might prove problematic when we connect more cables and look more closely.

One of the two most problematic frequencies, 42MHz, we could have predicted. It is the third harmonic of the main crystal. The fundamental frequency of 14MHz finds its way into all sorts of places: it’s divided by four to generate the microprocessor’s master clock (3.5MHz); it paints pixels onto the television (14MHz / 625 PAL lines / 25Hz frame rate = 896 clock cycles per line); generally it also couples into large parts of the circuitry.

The 48.8MHz peak is attributable to a different problem. When the emissions were being measured, we observed that quite a lot of the radiation was vertically polarised. Because PCB tracks and components are horizontal, electromagnetic radiation that originates from the circuit board has hardly any vertical component. Vertically-polarised energy is an indicator that the power supply cable is radiating. The Spectrum’s cable is exactly 1.5m long, which causes it to resonate fairly effectively at about (0.95 × c)/(1.5 × 4) = 48MHz. This 48.8MHz peak is an upper harmonic of the PAL colour clock (4.4336MHz × 11) that just happens to hit the resonant frequency of the power cable. If the cable were a different length, it would just pick out a different harmonic, moving the spike upwards or downwards.

A: Invalid argument

I can’t simply slaughter a piece of computing history on a rotating altar and walk away. Let us perform a proper autopsy. How and why does the Spectrum fail, and what might we do today to improve its RF performance?

It’s a hard question to answer, firstly because I don’t want to test my computer destructively to find out; secondly because we just wouldn’t design a computer in the same way today. In 1982, Sinclair Research worked miracles in compressing the functionality of a home computer into just four main chips plus RAM.

As we have seen, though, the first thing we would have to change is the rather fishy power supply and cable.

As with almost every computer power supply today, its replacement would have to have a ferrite, and both conductors would run through a hollow shield to reduce radiation. Sinclair power supplies are moulded shut and I don’t want to destroy mine, but it is likely that this single step would provide a good deal of radio attenuation: perhaps ten or twenty decibels.

Where the DC jack enters the computer, we would add a common-mode inductor and some extra inductors and capacitors to clean up the power lines. We would need similar components to protect the TV and cassette cables. However, the data lines between chips probably don’t need slewing: presciently, the ULA included the facility for building suitable resistances into the chip itself. Given the high board density, even adding these few inductors and capacitors to fix individual radiation problems would entail a non-trivial redesign and there would be no guarantee of success. There is also the problem of cost: these components would probably add a pound to the material cost of the computer. By the time the customer saw it, though, the manufacturer, distributor and store would have added their margins, resulting in a retail price increase of three or four pounds. It doesn’t sound like much, but it would have made Sinclair’s eyes water: he sold millions of these based on low retail prices and high margins.

E: Out of DATA

As an epilogue, I shall consider what we might do if we were given a cleaner slate. Firstly, what would happen if we were asked to make a Sinclair-compatible clone that could legally be sold? Those RAM chips are now museum pieces and change hands for a few pounds each. The custom ULA, manufactured by Ferranti, is technically impossible to replace because Ferranti went spectacularly bust in the 1990s. Only the Z80 microprocessor and mask ROM remain obtainable in recognisable incarnations, but economies of scale nowadays render that kind of technology abysmal value for money.

The cheapest and safest solution would actually be to emulate the Z80 processor in software running on a more modern chip. Inside this chip, costing maybe £2.00 or less, would be encapsulated all the ROM and RAM that the Spectrum needs to function. The parts of the ULA that drive the screen and cassette would be designed around special input and output functions that are provided by these chips, although the video generation would still require an extra device of its own.

Meanwhile, the big heatsink and 7805 regulator (surrounding the loudspeaker in the bottom-right hand corner in the photograph above) would be replaced by a modern switch-mode regulator that dissipates barely any heat at all, and all that sheet metal would go. We wouldn’t need the -5V supply any more, and we wouldn’t fit a TV modulator: modern TVs cannot demodulate an analogue signal, and VGA or component video would suffice.

Using surface-mount technology, the circuit board would be shrunk to about a fifth of its existing area, so it would resemble a narrow strip along the back that holds the rear sockets, extra components for EMC, headers for the keyboard membrane, and the familiar edge connector which, if we were expecting our device to last for another thirty years, we might consider gold-plating.

The new design would require a four-layer board for electromagnetic reasons, increasing the cost slightly. If we were making enough of these devices, we’d be able to sell the whole thing for about fifty pounds assembled, with a printed manual – less than half of the actual cost of a Spectrum in 1982 without allowing for inflation, and about the same price as a reasonable second-hand specimen today. We may still make a modest profit.

But I’m considering emulation, and emulation is cheating. Nevertheless, it is the cheapest and quickest way to build a Spectrum today. There are other ways that purists would appreciate more – see, for example, the labour of love that is the Harlequin Project – but these require more complex chips and hence more cost. We may, as an ironic twist, use an ARM chip: these are cheap, powerful, and started life in the offices of Sinclair’s arch rivals at the time, Acorn Computers.

One troublesome question would remain: we’ve built a compatible, but what we could do with all the unused power? With the ROM now held in electronically erasable memory, we could offer operating system upgrades. We could turn the clock speed up and increase the memory practically for free, so why shouldn’t we? We might no longer limit ourselves to emulating a particular 8-bit processor, or to emulating a foreign processor at all. This would allow us to use greedier screen modes, and so provide enhanced graphics. We could change the ROM to allow ourselves to program in a more modern language, attach an SD interface to load and save games quickly and reliably, improve the sound capabilities and the tape modulation scheme, add serial ports and MIDI and USB, even imitate other computers. And so on.

The end of this train of thought always matches the beginning. We’re engineers. We love ideas, and we love experimenting with computers. Were we to reissue the Spectrum today with our vastly improved resources and a commensurately pioneering spirit, we’d create a computer that is nothing like the Spectrum. What we would end up would look more similar to a Raspberry Pi, which was conceived with a similar spirit and restrictions and followed a fairly similar path. If we insisted on affixing a keyboard and screen, it would resemble a small laptop.

More likely, though, if we wanted to be the true successors to Sinclair’s aesthetics and vision, our new device would resemble a smartphone. These shrink-wrapped products represent the leading edge of power, versatility, convenience, and style. Supported by a burgeoning industry of home-grown applications, phones rather than personal computers now excite and engage young people. Some just use them to consume, but others have discovered that phone applications can be written using free software and then distributed for free to the world. This has started to democratise computing again in the same way that Sinclair did thirty years ago.

Sir Clive now states in interviews that he doesn’t own a mobile phone. He might wrinkle his nose at the dominance of the Asian hardware consortia and giant American software companies that so swiftly ate his lunch in the Eighties. He might fear the collective infantilisation and lack of peace of a society in which everybody is glued to a telephone. But he must, surely, approve of the renaissance of home-made software.