TTL to composite video interface

I thought I posted about this before, but I guess not. In an effort to make up for having two *and a half* northstar advantages I wanted to have some solution for the video that the third one is missing. To that end I initially looked at the Mac SE video converter that uses a pi pico to read the video signals from a mac and turn it into VGA. Theoretically this project is similar, it just has different timings. I started down that path but when I realized the project was mostly one of software hacking I quickly looked for another solution.

Enter the zrt80 and its simple composite generation circuit. I did some reverse engineering and repair of this back in 2020 and during that ordeal I remembered that it has a nice simple example of a composite generation circuit. Being a 5v logic based device I decided to investigate the circuit to see how the stages leading up to the combination differed from the advantage.

This is the ZRT80’s video circuit. starting from the end we can see composite video is made by the 2n2222 transistor and the 75 ohm output impedance is achieved by the 75 ohm resistor so that’s good. That all makes sense for standard video. The transistor is driven by two resistors of different values, meaning that the effect that each of those signals will have on the resulting signal will be at different levels. Going into those resistors are some inverter gates so we know that’s getting a 5v logic signal. Technically TTL logic gates are a lot better at pulling down than up, so if we use the same 74-series gates that this design uses we’ll be closer to the intended voltages than if we use 4000-series CMOS gates.

At this point anything we do that has a TTL output into each of these resistors will give the right voltages, but what signals do we need? The bottom chain has two inverters fed by something, but they also feed a XOR gate with a switch on the other input that has an output labeled video out. I thought composite was our video out? Well it is, but this board can output a different video standard for different monitors. Looking above we have a single inverter that feeds our composite out but it also feeds that XOR gate and the output is labeled composite sync. From this it looks like we can drive a composite monitor or one with a separate composite sync and video signal. The video signal is what you would expect, it contains the pixel data for the screen, but the composite sync tells the monitor when it is done with a horizontal line or a vertical frame (one whole image). Feeding that composite sync we can see that horizontal sync and vertical sync are XORed together to generate that composite sync.

In this case the horizontal and vertical sync come straight off the CRTC video generation chip, but will this exact circuit always work? Those XOR gates with the switches are interesting, what do they do? They are effectively used as selectable inverters. If the input with the switch is high, the output is the inverted state of the other input. If the switch forces its input low then the output is exactly the same as the other input. This is because the output is high when only one input is high, exclusively, so not when both are high (and like any other OR gate, not when both are low). Those switches are because different monitors want different polarity video and composite sync signals. We can use this technique later.

This is the video output section of the Northstar Advantage. These schematics came from a guy who has actual paper manuals for the northstar advantage 8/16 (the motherboard I think is needed to support the northnet server card) and I have uploaded these nice, legible scans to the internet archive. Looking at the right side for now we see the video connector. 12v power, ground, video, negative logic horizontal sync and negative logic vertical sync. Feeding into that however we see three more of those XOR gates set up as selectable inverters. It looks like the northstar advantage motherboard was made flexible enough to allow for different monitors to be installed without changes to the board except for a couple jumpers.

How is the video on the advantage being generated though? Well this schematic I grabbed from an apple 2e to show how standard some of these techniques are. Here you can see the same LS166 shift register hooked directly to a ROM where a whole byte can be shifted in and then clocked out one pixel at a time. The Advantage still uses a 166, but it is a lot more sophisticated. Instead of pulling from a fixed character ROM it pulls from a bank of RAM. This display ram can be filled with arbitrary data that means you can address every single pixel on the screen. The older apple design is set up to just show specific sequences out of the ROM it came with.

I showed how the video was generated, but how about the horizontal and vertical clocks? Well, on the Advantage that is done with the timing PROMs. Basically there are high speed ROMs that operate as fast as logic circuits so rather than having a big arrangement of OR and AND and other gates, these PROMS output a specific set of bits as an output for a specific set of bits as input. It’s a pre-computed logic table. This particular computer syncs the screen refresh rate to the frequency of the voltage coming in to minimize flicker on the CRT and that means there are 50hz and 60hz timing PROMs for it.

Each PROM, or set of PROMs will generate a waveform like the one shown above. This has a lot of implications for memory cycles, RAM access, but also the horizontal or vertical sync timing. Helpfully the PROMS are all detailed in the technical manual so you can recreate them if you have a bad one (that’s where these pictures came from). Unhelpfully all the PROMs I had in my machines differed from the ones in the manuals. I figure they made some changes between when the manuals were printed and when the machines went out for final production. I have the real PROMs archived as well, but I haven’t done a deep analysis except to check that they are all at least a little different.

With complete control of the CRT’s horizontal sync and vertical sync you can drive the tube at a range of frequencies and it will obey the commands to move the beam to the next line or move it back to the top of the screen. The sync information is literally driving analog circuitry in the monitor to steer the beam around and if the components in the monitor can work at different speeds, then you can have timings that are not quite the same as NTSC composite video. This is the sort of monitor the ZRT-80 could connect to all the way back up at the top, one with separate sync and video inputs. The essential information here is that I could edit these PROMs to be more exactly NTSC video timings, but if this is close enough I won’t have to muck with the other aspects of the RAM timing and such.

This is my generic polarity selectable TTL logic to composite video generator. I based the circuit off the one in the ZRT-80 but I made each input individually polarity selectable like the advantage has on its outputs. That makes this design fairly generic and able to be used on a variety of computers to replace monitors that may have failed or video outputs that did not fir the composite video voltage levels. You could even hook this up to a raspberry pi pico or an FPGA and use it to generate a good solid composite signal as long as your video timings were correct.

I made one on some protoboard to test, especially because I wasn’t completely sure the polarities I needed for my advantage (the rest of the manual is detailed, but questionably accurate at this point). By using this I determined experimentally the right settings and produced a board design.

And here is the board. This project was sponsored by PCBWay and as usual everything turned out great. The silkscreen is nice and crisp, the corners are rounded and smooth, everything worked alright. I think for my next rounds of boards I will start rotating through their soldermask colors because while I’m impatient and green is usually faster, I don’t always end up getting to these projects right away anyway and having some other colors around sounds cool.

There’s available inverters if you want to use the spares for something, but I tie the inputs to ground. Because TTL chips pull down with a transistor, but the outputs just float high with a resistor having the outputs go high burns less power when they’re unused. My little board also has a 7805 regulator because the video connector for the advantage monitor only exposes 12v to power it so I can use that and make 5v myself on the board. It’s a TO220 instead of the 78L05 or something else because these are more readily available as salvage and I have a bunch to use up. You may also notice, if you’re not colorblind, that I don’t always use the exact resistors called out. In this case I called out 4.7k resistors as pull ups, but I used 3.9k resistors. I did that because the additional current draw is negligible, but also I had them in large quantities and for pull ups they work fine. In my case, building one configuration that I will never change the polarity on I didn’t need pull ups, I could have just tied each input high or low and saved a little current in resistor dissipation.

I have a pass-through pin header so I can plug this into an advantage and have the original monitor also plugged in if it has one.

There you go, it’s not perfect, but it works pretty darn well for something that’s not even supposed to support composite video out.

There’s a little silkscreen explanation on it for my use, and some lines to indicate how to use the inverters (which input go to which output). I have the board up on PCBWay if you want one for yourself. Or you can go check it out on my github if you want to make some changes to optimize it for your use case. I know I didn’t make it super compact or low chip count, this just uses what I had to be as generic as possible.

2 Responses to “TTL to composite video interface”

  1. Recreating a vintage TTL to composite video interface #VintageComputing @abzman2000 « Adafruit Industries – Makers, hackers, artists, designers and engineers! Says:

    […] See the details in the blog post here. […]

  2. Evan Allen's TTL-to-Composite Adapter Board Goals to Give Video Outputs to Retro Gear — And Extra - msn2u Says:

    […] full mission write-up is obtainable on Allen’s weblog, whereas the KiCad mission information have been uploaded to GitHub below the permissive Unlicense […]

Leave a comment