The ZX Spectrum Reverse Engineering and Clone Desgin Blog


A site dedicated to the reverse engineering of the ZX Spectrum and related projects.

< 51 of 68 >

Interfaces - The Beeper

Aug 27, 2007

The Speaker (beeper) is controlled via bit 4 of port 0xFE, and in a real Spectrum this ULA pin is connected directly to the analogue IO circuit. Altering the state of this bit (high or low) produces and alternating voltage which drives the Spectrum speaker coil. This alternating voltage may also be used to drive an external amplifier.

For the Harlequin, instead of driving a speaker we will drive the television audio input, using the same transistor buffering that we employed to drive the RGB inputs.

A standard TV SCART connector expects an input signal of 1v peak to peak. I used the same spreadsheet created for the RGB driver calculation to help me choose appropriate resistor values. I set the Drive out voltage to 1.0v and plugged some values in for ER1, ER2 and DR2. The output voltage required is approximately 1/5th of the input, so ER1 should be approximately 1/5th of ER2.

I started with ER1 = 1K, ER2 = 10K and DR2 = 2K7, which gave DR1 of 5126. This value is not in the normal E12 resistor value range, the nearest being 5K6 that will keep us within our 1v output limit. Using this gives an output voltage of 0.910v.

Dropping ER1 to 100R raises the output voltage to 0.992v, and does not significantly alter the current draw.

The output of the emitter-follower is connected to the TV SCART audio channel via a 100nf DC blocking capacitor. It may be fed into either left or right channels, or both - though I'd recommend using a capacitor for each channel instead of tying the channels together.

For a detailed look at emitter-follower design, see common-collector/emitter-followers.

When a ZX Spectrum is loading from cassette, because of the combined analogue IO circuitry, some of this signal is fed to the beeper, allowing us to monitor what is happening on the cassette. The same can be achieved in the Harlequin by routing some of the signal appearing at the Ear input A6 of the input latch U49, through a 120K resistor into the output DC blocking capacitor.

The sound interface can been viewed in the interfaces schematic version 1.15.