The Dragon's video output has always been "a bit naff", and various people
have looked into ways of sorting that out. Probably the most successful is to
intercept the VDG, quantise its outputs and convert to RGB.
But I wondered if we could just generate composite video in a different way.
And given that both LM1899Ns and 4.433MHz crystals are getting harder to find,
it could be a nice bit of future-proofing. You know, assuming we get to the
other side of the Collapse with loads of composite video monitors lying
around...
You can still order 17.734MHz oscillators (4 × PAL colour subcarrier), so my
idea is:
Generate quadrature square waves from an oscillator
Low-pass filter them to get sine waves
Use available multiplier ICs to multiply the VDG's outputs by these sine waves
...
Profit!
Experimental PCB
So I had a PCB made up1. For what it's worth, this course of action seems
unlikely to lead to the final goal, but it's a laugh, isn't it?
It's designed to plug into the socket of the LM1889N, which provides access
to ±5V and the VDG's chroma signals (after they've been processed somewhat for
PAL). This socket doesn't have a convenient ground pin so I've made a
separate header to let me tap that off the motherboard.
Bottom-right is the oscillator. Between the rows of the board connector sit
2 × 2 D-type flip flop ICs. Only three of the four total are used to generate
the quadrature square waves. Two trim pots allow adjusting the attenuation of
those square waves.
Next, those waves enter the big array of discretes on the left side of the
board. In the middle of those is a single IC containing four pretty decent
op-amps. This lot applies a 3-stage low-pass filter to each square wave,
leaving us with nice looking sine waves. I used Analog Devices' Analog Filter
Wizard to design this.
Finally, to the right of the op-amp IC are two AD835 multiplier ICs.
They're quite expensive! This is not a cost-effective solution to the
problem! However, they're very simple to use:
Works with ±5V supply; many similar products require ±8V or more.
No ÷10 or similar scaling of inputs/outputs required.
Differential inputs, so the chroma signals can be provided directly as being relative to CHB.
Four-quadrant multiplier, so both inputs can be centred aroud 0V.
You can see I've tapped ground using a little test lead with a clip. It's
not the best ground in the world, but it suffices as a tribute. The R pin is similarly connected to the
CPU's RESET line. This is to
try and avoid any situation where the flip-flops are in an inconsistent state.
Y is jumpered to the second ground pin, provided on the header for this
purpose.
This experiment replaces the function of the LM1889N, sending its
output to the right pin to be mixed with luminance on the motherboard
in the same way as the original would have done.
Semigraphics test card
And here's the result. Shockingly good! Ok, that isn't the first result I
got. To begin with I connected the board's Y input to ground using another fly
lead, and the result there was a lot of noise. But once I jumpered it
so it was definitely at the board's local idea of ground and not acting as an
aerial, this was the result.
Amusingly (to me) it also eliminates a problem I was having with this
combination of motherboard and VDG, where my TV would constantly be confused
about whether black & white modes really were black & white,
or whether it should be trying to colour them in.
PAL mixing test screen
Here's it showing one of
Pere
Serrat's test graphics. This image exercises the alternate line colour
mixing of PAL to produce more colours than the base palette technically
supports. It's not really proving anything about the board - the PAL adaptation is
done on the motherboard before the signals even get to us - but I thought it
would be nice to see.
Experiment 2
How about if we use the summing input of the first multiplier to feed through the luminance signal? That's what the Y input on the board is for. To test this required
some doctoring of my motherboard:
Disconnected the common ends of R56 and R58 from the motherboard and wired
them up as the chroma board's Y input.
Clipped the common ends of R45 and C22.
Wired VOUT to the side of R57 that was previously common with
R56 and R58.
Second experiment
First result: nothing! Completely blank screen. Measuring on the scope I
see VOUT constant at 1V. Ah. I remember: the Dragon 64 has a
jumper that optionally offsets the bias by two diode drops. That's probably pushing it outside the range the multipliers can deal with. Flip the jumper.
Second result: way too bright! Ok, it's video, it has colour in
it, but everything's overamplified. I need to come up with a third experiment!
Next steps
So this turns out to be a good approach (quality-wise, if not cost-wise) to
chroma generation. It opens up some possibilities.
The chroma subcarrier frequency originates as a digital signal. This means
we could select between chroma frequencies using only logic. We tend to
already have a 4*NTSC oscillator in our systems, as that is the frequency that
is divided for CPU and VDG operation, so we could expose to software a switch
between PAL-I and NTSC colour modulation.
By shifting the PAL logic
to a CPLD, we can also control 50Hz/60Hz selection and whether the burst
phase is shifted on alternate lines, potentially allowing selection between
PAL-I, NTSC and PAL-M from software.
Some care would be required to ensure the phase of the carrier (relative to
the luminance signal) was correct for NTSC output to get the desired
cross-colour artefacts.
This experimental board was expensive, but traded off against the parts it
replaces, if the circuit formed part of an overall motherboard build it might
not amount to a significant portion of the cost.
I still need to do some work to see if the whole composite signal can be
generated this way (without too many extra parts).
Footnotes
PCB manufacture and assembly by the so far always-excellent JLCPCB. I'm not being paid anything to say that, and obviously think it through if you're tempted to use them for anything sensitive.
↩