• Please review our updated Terms and Rules here

Project: External S-Video adapter for CGA/RGBI

Eudimorphodon

Veteran Member
Joined
May 9, 2011
Messages
8,038
Location
Upper Triassic
Just wanted to share a little side/skunkworks project that saw its first "Hello World" today. For a while I've had an interest in building intentionally archaic/obsolete NTSC video projects. Lately I've been thinking about how easy/difficult it'd be to add color to a "dingus" I'm hoping to build soon, and while researching it I stumbled across what looked like a "Cadillac solution" (circa mid-90's) for converting an NTSC-frequency RGB source to separate Luma and Chroma feeds (in addition to composite), the Analog Devices AD724. The part is mostly obsolete these days but still available from mainstream outlets like Digikey, albeit often at positively eye-watering prices. Just for laughs I bought 10 of them from a Chinese seller on eBay for an order of magnitude less a month ago, and, well, obviously I needed to see if I'd gotten ripped off so I decided to build something.

I'm sure someone must have done this before, but I failed to find any evidence on the first Google so I designed my own circuit from scratch, combining the VGA-to-TV example in the datasheet with a 4-to-6-bit DAC loosely inspired by an old GGLabs "CGA2RGB" design. (The CGA page on Wikipedia links to the 5154 EGA monitor tech manual, which has a table in it explaining how the EGA monitor implements the "brown fix" that CGA monitors have in terms of the CGA 6 bit palette, so I just ran that through Logic Friday to come up with a suitable equation to stick a GAL to implement the resistor ladder.) My AD724JRs were SOIC surface mounts, so I had to do a gross job soldering one to a wrong-size (24 pin, I couldn't find the right pitch 16 pin) breadboard adapter, and... here's what it looks like:

breadboard.jpg

I'm skeptical the 724's composite output would be much clearer than a normal CGA output because of the fundamental limitations of having to strip the luma and chroma apart, so I went for S-Video... or, in the case of my test environment, C64-style separated video. Here's the test mule, my Tandy 1000 EX, connected to a Commodore 1702 monitor:

Tandyplus1702.jpg

The Tandy's native composite is connected to the front connector, while the separate Luma and Chroma from the breadboard is on the back. Is S-Video an improvement over Composite? Oh, heck yeah, at least for 80 column. What follows is some comparison shots. Here's the XTIDE BIOS message, built in composite vs. svideo:

composite-bios.jpg724-bios.jpg

A "DIR" command output:

composite-directory.jpg724-directory.jpg

And some color bars rendered in BASIC:

composite-colorbars.jpg
724-colorbars.jpg

I tested with several programs that use colored text on colored backgrounds, like the QBasic editor, and they're all *far* easier to read than the CGA composite. I mean, they're not *great*, but you could *almost* kid yourself you're using a really lousy CGA monitor.

As you can see from the colorbar picture there are definitely still some problems to work out. The color palette is off from what it should be; "cyan" is way too green, "magenta" is too blue... the "brown" looks pretty good, I guess? The resistor ladder that's in there is undoubtedly wrong, I should add some pots and try to tune it. And the thing is clearly prone to picking up some interference, as you'd expect, so it definitely needs to be translated to a PCB to actually be "useful", but... curious what people think. If I can get the palette right this *should* be able to replicate the RGBI colors, instead of producing the kind of gross CGA composite set. That... of course is going to count as a negative for actually running games that use tricks to get extra colors on a real IBM composite card, but this might be useful for machines like PCjrs and Tandy 1000s?

*shrug* I dunno. Just thought I'd share.
 
Composite colors are always pretty erratic compared to their digital/ttl counterparts. Magenta, Purple and green are usually rubbish on composite
 
Composite colors are always pretty erratic compared to their digital/ttl counterparts. Magenta, Purple and green are usually rubbish on composite

The resistor ladder I’m using is split for each color as described in the docs, IE, 2/3rds max amplitude for the “base” color and 1/3rd for the intensity, but it definitely seems like the chroma encoding doesn’t respond in a linear manner. The way my colors are off is similar to how they’re “wrong” with the original circuitry. (They display a lot cleaner, but the hues are off the same way. Except for brown, since the original composite circuitry seems like it’s doing the “dark yellow”; that part of the encoder does the needful.) Generalizing it seems like green overpowers blue and blue overpowers red in terms of where the hue lands in the color space?
 
Last edited:
Looks pretty good. I think you are running into the dot pitch limitation of the 1702, which I believe is 0.64. The screenshots are very similar to CGA on the Tandy CM-5, which also has a terrible dot pitch. I would be interested to see what it looks like on a better screen (or direct video capture).
 
I would be interested to see what it looks like on a better screen (or direct video capture).

It looks like to capture it I’ll have to scrounge up something that can actually properly take S-Video input. For composite captures I have this kind of half-***ed setup where I hook one of those $9 composite-to-hdmi bricks to a USB capture dingus. (Works okay for basic monochrome captures.) I grabbed a similarly cheap brick with an S-Video in, but after wiring it up it looks like it’s “fake”; the output from the so-called S-Video port looks identical to what I get if I hook the same devices’ composite port to the composite output of the AD724. This makes me think they’re just mixing the S-Video to composite with a resistor and shoving through the same chip as the composite bricks.

I might have to resort to hooking it up to the living room TV…
 
Looks pretty good. I think you are running into the dot pitch limitation of the 1702, which I believe is 0.64. The screenshots are very similar to CGA on the Tandy CM-5, which also has a terrible dot pitch.

Yeah, I didn’t realize the 1702 was quite this bad, but it really is a screen door. I suspect I only thought is was better because I also have this 10” Panasonic industrial color monitor (metal case, BNC inputs, etc) that has a similar pitch on an even smaller tube. I suppose it’s inevitable it would look better by comparison even on a 40 column Apple II.
 
What's it look like on a modern LCD screen?

That's the thing I need to schlep it out to the living room to find out. Unfortunately I don't have a smaller LCD TV that natively has an S-Video input; I'm kind of kicking myself for not picking one up off a street corner. (People throw out "working", at least according to the piece of paper taped to them, older LCD TVs with legacy ports *all the time*.)
 
... I've been thinking about the off colors, and I'm wondering if I might be able to take a stab at improving them by reprogramming the GAL.

The "Brown fix" for CGA, if you're not familiar, is instead of the "dim" version of yellow being equal parts red and green the green component is knocked down to half (relative) strength so the color comes out as brown instead of a kind of sickly greeny-yellow. (And doing that seems to be working on this setup.) Looking at the pictures the problem seems to be:
  1. "Cyan" is way too green, and
  2. "Magenta" is way too blue, so..
what if I apply a similar fix to knock Green down by half on the "Cyan" color, and knock Blue down to half strength for "Magenta"? Maybe that'll shift the color space around enough to get them into the ballpark of the "canonical" hues.

FWIW, I guess I also have both an Apple IIgs and a couple Color Computer IIIs. Maybe I should knock together a board to accept raw analog RGB and shove it through an AD724; maybe it'll reveal if this kind of hue shift is seen on those. Would let me divorce NTSC color encoding issues from the DAC...
 
That's the thing I need to schlep it out to the living room to find out. Unfortunately I don't have a smaller LCD TV that natively has an S-Video input; I'm kind of kicking myself for not picking one up off a street corner. (People throw out "working", at least according to the piece of paper taped to them, older LCD TVs with legacy ports *all the time*.)
I take it you don't also have an LCD monitor with SVIDEO either? It was fairly common back in the mid-2000s. I've got some in both 4:3 and 16:9.
 
I take it you don't also have an LCD monitor with SVIDEO either? It was fairly common back in the mid-2000s. I've got some in both 4:3 and 16:9.

The only real computer monitor I have that has anything besides the usual computer-related ports (Displayport/HDMI/DVI/VGA) is a 2009-ish vintage Dell 30" that has *Component*, of all things.

(I guess I also have this more recent dinky little 8" thing that has Composite, but that's also no help.)

I didn't actually realize that S-Video had gotten so rare on new TVs/hard to find converters for that aren't Potemkin Composite. It's a little sad, because S-Video output, if available (and it was on most 90's-through-early-aughts high-end AV equipment) is *almost* as good as 480I Component. Bleah.
 
Yeah that is weird. Of course I only recently discovered my main TV lacks any of that. Who would have guessed?
 
I've kept 2009 1080p 23" Phillips around for the reason of inputs, it's a "TV/monitor" so it has pretty much everything.
 
I grabbed a similarly cheap brick with an S-Video in, but after wiring it up it looks like it’s “fake”; the output from the so-called S-Video port looks identical to what I get if I hook the same devices’ composite port to the composite output of the AD724. This makes me think they’re just mixing the S-Video to composite with a resistor and shoving through the same chip as the composite bricks.

Feh. I haven't broken it open to *absolutely* make sure (I'm currently wondering if I'm still inside the return deadline), but I measured the resistance between the luma and chroma lines of the S-Video port on this converter brick and the tip of the composite RCA jack and there's just 150 ohm across it, exactly what I'd expect if they were just tying luma to chroma with a resistor behind the S-Video jack and feeding them together into a composite chip. Friggin liars...(*)

(* Edit. Hrm. I dunno. Poking around some more I'm a little less sure? Maybe I need to actually rip the plastic off and make sure. There's *something* different about how it's rendering things, the problem is the inputs are so noisy/my board is unshielded enough it's hard to be sure.)

Amazon and other such places are lousy with these little USB video capture devices with RCA and S-Video dongle connectors that look like this:


61Ho4ClQ6US._AC_SL1500.jpg


Does anyone have one of these and can save me the disappointment of buying one and finding out the S-Video jack on it is a fake too? (Or, by some miracle, confirm that it is actually separate from the RCA jack?)
 
Last edited:
... I've been thinking about the off colors, and I'm wondering if I might be able to take a stab at improving them by reprogramming the GAL.

Hahaha. Or maybe I just need to remember that this 1702 monitor has a "Tint" control. Apparently if I play with that I can get them to look almost like the canonical 5153 set.

tint_control.jpg

So... I'm pretty pleased with those results. It's *far* more readable than the normal composite output of the machine. It's still not as good as an RGBI monitor, obviously; the limited ability to completely change colors more than ~160 times or so horizontally still means you have problems when you put one color of text on another color background, how bad the problem is depends on the color combination, but it still at least renders colored (and white) text-on-black soooo much better.

Of course if suitable S-Video monitors are now rare as hens' teeth finishing this might be a waste of time, but it's still at least "interesting". :P

Maybe I should at least go ahead and solder this together on a protoboard and stick it in a shielded box, so I can give a capture device or whatever a better chance for a clean signal.
 
Svideo is more common on modern monitors than CVBS or RGB, so svideo still isn't a bad option. Have you tried yours with a RetroTink?

- Alex
 
Have you tried yours with a RetroTink?

I don't have one, but I'm curious how they'd work with this. (The prices of their products give me a slight case of the jitters every time I've looked, although I understand paying for quality.)

FWIW, if there's any interest I can formally draw up a schematic and share it, along with the GAL program. (I literally just seat-of-the-pants-ed it on the breadboard.) The third chip on the board is just a 74HCT04 inverter that I used to convert a cheap 4x colorburst crystal into a CMOS(ish) oscillator source. If you were building one of these for real I'd probably recommend using a quality canned oscillator, it's possible that my results might be varied by the slightly wonky duty cycle I'm getting from this ad-hoc clock.
 
Does anyone have one of these and can save me the disappointment of buying one and finding out the S-Video jack on it is a fake too? (Or, by some miracle, confirm that it is actually separate from the RCA jack?)
Those "EasyCap"-type devices are universally awful. I have one of the "better" ones and its S-Video input is fake, too. A lot of them have fake stereo sound, too. They have separate left and right audio inputs, but they're really just combined together to mono.
 
Back
Top