Designing a Mac-to-VGA monitor sync-splitter adapter

bigmessowires

Well-known member
Continuing the discussion from https://68kmla.org/bb/index.php?threads/mac-to-vga-monitor-adapter-struggles.45423/ - I'm building a Mac-to-VGA monitor adapter that works similarly to other video adapters, but with an added feature: it can also decompose a composite sync signal into separate hsync and vsync signals. Because some monitors don't support composite sync or sync on green, and some Mac computers and video cards only output composite sync or sync on green, there's an incompatibility that often leads to questions like "why can't I get any image from my Mac IIci built-in video?" This adapter can bridge that incompatibility gap for older Mac hardware that lacks separate sync outputs, including:
  • Mac IIci built-in video
  • Mac IIsi built-in video
  • Apple "Toby" or “Macintosh II Video Card” 8201098-C
  • Macintosh II Monochrome Video Card 661-0518
  • SuperMac ColorCard SE/30 and Spectrum SE/30
I've built two prototypes that both partially work, but the devil's in the details. The first prototype used an LM1881 sync splitter chip to extract vsync from csync, but it couldn't extract a separate hsync signal. It also had a couple of LED indicators to show which types of sync signals were active in the video signal. This first prototype worked with some of my test monitors, but failed with others. The second prototype used an ATTINY microcontroller to extract hsync and vsync from csync, and it worked fairly well but resulted in shimmer or distorted images on some monitors.

IMG_3735a.jpg

Along the way I discovered that composite sync signals are not all the same. The Mac IIci, Mac IIsi, and Macintosh Monochrome card all have a csync signal that's hsync xnor vsync. This is fairly straightforward to decode. But the Toby video card has a more complex composite sync signal with changing timing and extra pulses that looks more akin to an NTSC or PAL video signal. I haven't yet examined the SuperMac composite sync to see which one it resembles.

The Macintosh monitor port doesn't have any power pin, and that's a problem. Most Mac-to-VGA adapters are just a passive switch matrix and don't need any power, but an LM1881 chip or a microcontroller need to be powered from somewhere. While an external power connection is a possibility, I've ruled it out on grounds of convenience and aesthetics. Instead, the adapter will be phantom-powered by leeching power from the video signals themselves. This isn't the best practice, but if the supply current is only a few milliamps then it should be OK. It means the adapter can be simply plugged in and used like any other Mac-to-VGA dongle.

My latest plan is to continue with the microcontroller-based design, which allows for several interesting possibilities, but also creates some difficulty due to differences between the pixel clock and the microcontroller clock. When the microcontroller program continuously polls the composite sync signal, there's a variable delay between when csync changes happen and when the changes are detected, due to the phase relationship of the clocks. This creates unwanted jitter in the extracted hsync and vsync signals, producing graphical artifacts. My new idea is to keep the microcontroller but add a monostable multivibrator (a one-shot) to generate the actual hsync and vsync signals with a consistent amount of delay. It remains to be seen how well this will work, and whether it can be done while keeping the power draw low enough for phantom powering.

I'm also planning to make some simplifications to the DIP switch design that some people may disagree with. Whenever I use an adapter like this one, I always need to dig up the instructions to remember which DIP switch settings to use for the desired video resolution and sync signals. It's a pain, and it's silly because 95 percent of the time I want 640x480 with separate hsync and vsync. The other five percent I want 832x624 or 1024x768 with separate sync. I never want the other video modes or options, so why do I need a DIP switch array with 1024 switch permutations when I only actually need 3 or 4? My hope is to make this adapter auto-configuring as much as possible, with the full list of switch permutations small enough that it can be printed on the back of the adapter.
 

360alaska

Well-known member
Maybe you can make it hdmi and also some breakout pins to connect it to compact mac composite video?
 

bigmessowires

Well-known member
This photo shows the dizzying number of video settings possible with a 10-switch adapter, with the ones I actually care about highlighted:

IMG_3639h.jpg

Maybe you can make it hdmi and also some breakout pins to connect it to compact mac composite video?
Not with this approach. This is a K.I.S.S. design and is purely a sync adapter and tool for setting the monitor ID. The actual RGB signal is unmodified.
 

igowen

Member
very interested in this! i had this issue with a radius pivot card in my SE/30 -- the color was very washed out on my beater Dell LCD monitor with a regular mac-to-vga adapter like you have. i ended up "fixing" it by buying a monitor that supported sync-on-green :p but it would be nice to have an adapter that's a bit more flexible.
 

chelseayr

Well-known member
I don't really have much to directly say about this but I otherwise could maybe think of two small things to mention from myself tho
1. I don't know about finding beige rather than black sheathed "svideo connectors" (haven't really looked) but otherwise you could easily sap 20mA or whatever from a basic Y-passthrough off the adb port? I don't mean it has to be as elegant and smooth as this https://i.ebayimg.com/images/g/R0cAAOSwO2ZevGTO/s-l640.jpg but you get the idea, one connector directly onto the adb port in-line with one connector to the usual adb cable and in the meanwhile from the middle inbetween both connectors is one or two offset wire(s) cabled to your sync dongle itself
2. I strangely for some reason never ever found any uses for these dip switches as anything from 640x480@80 to 1024x768@60 seem to just work (don't have owned any mac that even had enough onboard vram [even in b&w colour] to output 1600x1200 in any way tho mind you)

either way I agree on skipping hdmi as beside a second dongle [sourced from elsewhere quite easily] would be a lot easier than trying to troubleshoot two very different kind of video things on one single tiny board
 

tt

Well-known member
Really cool concept, and it's an interesting approach to getting power to the board. I had a similar thought of grabbing power from another port like a serial port in case it is needed, but that approach isn't nearly as elegant. Regarding the dip switch settings, I would be interested in support for 1600x1200.
 

bigmessowires

Well-known member
If you wanted to steal power from another port, ADB would be a good candidate. I just don't like the concept for this purpose, though. There's a time and place for a more powerful and more capable external video processor, but this isn't that. Mostly I just want something I can plug into my IIci to make it work with more monitors, and everything else is gravy.

The DIP switch settings tell the Mac what type of monitor is connected, but don't actually constrain what resolution image the Mac generates. I think there's a "multisync" DIP setting where the Mac monitors control panel lets you chose the actual display resolution. This may be the default behavior on newer Macs, and for older Macs I think there's an extension or control panel that forces the same behavior. So lack of an explicit DIP setting for 1600x1200 or any other resolution doesn't necessarily prevent you from running at that resolution.

I've done a bit more research into the five Macs and video cards I've found where sync splitting could potentially be useful:

Mac IIci and IIsi built-in video: Composite sync is hsync xnor vsync. It tolerates phantom powering fairly well, and my first prototype was able to derive a supply voltage of about 4.1V to 4.2V. Prognosis for making this work is good.
Macintosh II Monochrome Video Card: The composite sync signal is identical to the IIci and IIsi, but there are fewer signals from which to steal phantom power, and the derived supply voltage was only 3.75V. That might still work, but for example it's low enough that it probably precludes running the microcontroller at its max clock speed.
SuperMac ColorCard aka SuperMac Spectrum: The composite sync signal completely shuts off during the vblank period, staying low the whole time. That means there's no timing information the adapter can use to synthesize an hsync signal during this period. Even so, this sort-of-worked on one monitor I tried, but definitely didn't work on another. Theoretically the adapter might generate hsync pulses during vblank based only on its own internal timers, but I'm not sure they'd match the real hsync timing closely enough to work. Even if that were possible, this card did not like phantom powering and the derived supply voltage was only 2.94V. Prognosis for making this work is not very good.
Apple Toby Card 8201098-C: Like the SuperMac, the composite sync signal completely shuts off during the vblank period, staying low the whole time. But what's even worse, during a few lines before and after vblank, the csync pulse rate is two per line instead of one per line (I think these are called serration pulses). Toby would require the same magic hsync pulse generation during vblank as the SuperMac card, plus some way of handling/ignoring the serration pulses. The phantom powered supply voltage was 3.93V, but it actually depends somewhat on the specific image being displayed and the vsync output pin is inexplicably connected to the green video channel. So the more phantom power the adapter draws from the sync signals, the darker the green part of the image would become. Prognosis for making this work is not very good.
 

bigmessowires

Well-known member
800x600 is a PC video resolution, not Mac, so I think it would be handled by setting the monitor ID to multisync. None of the computers or video cards that are stuck with composite sync can output 800x600 anyway, but if you also wanted to use this adapter with other computers then it might be relevant.

I've been fooling around with the IIci built-in video, trying to get that working reliably before worrying about addressing the other video cards. Out of six LCD monitors at home, four work with the IIci built-in video and standard Mac-to-VGA adapters, two don't. Two incompatible monitors isn't a very large sample set, unfortunately.

Right now my adapter solution works perfectly with the IIci built-in video on one of those monitors, and mostly-works on the other monitor, but shows annoying shimmering in the image. I'm torn over whether to investigate the shimmering further, or to decide it's good enough and move on troubleshooting the other video cards and the phantom powering circuit. If I had 10 monitors and only one shimmered, I would probably ignore it. When it's 1 out of 2, I really wish I had a bigger sample.

I'm scratching my head about the cause of the shimmering. If it's an issue with my messy tangle of unshielded wires or the microcontroller clock signal leaking through, then I would expect the problem to appear on both monitors instead of only one. So it's probably an issue related to jitter in the rising or falling edges of HSYNC or VSYNC.
 

LaPorta

Well-known member
Hmph...then why has every Mac I owned since I was little (Performa 6300, original iMac, iMac DV SE....etc) always had an 800x600?
 

NJRoadfan

Well-known member
They were later 1990s machines that supported multisync monitors. By then 800x600 was an established standard. Apple insisted on 832x624 to maintain 72dpi on 15in monitors. Even 800x600 wasn't a common standard on PCs. IBM didn't support it with the 8514/A or the original XGA video cards. They both went straight to 1024x768.
 

Juror22

Well-known member
I never want the other video modes or options, so why do I need a DIP switch array with 1024 switch permutations when I only actually need 3 or 4? My hope is to make this adapter auto-configuring as much as possible, with the full list of switch permutations small enough that it can be printed on the back of the adapter.
Yes! I agree - a thousand times (or 1024?), yes!

I have a folder on my laptop with dozens of pdf docs for all the different adapters.
 

bigmessowires

Well-known member
Hmph...then why has every Mac I owned since I was little (Performa 6300, original iMac, iMac DV SE....etc) always had an 800x600?
Check EveryMac specs for early to mid 1990s Mac models and video cards. None of them have 800x600. If you have a PowerPC or iMac then you're light years ahead of the audience that this adapter is targeting, and you don't need this.

I think I've found the cause of the shimmering on that one monitor: poor grounding. I'm not sure why it only showed up on one monitor and not the other, but when I added an extra ground wire that bypassed my adapter and went directly from Mac to VGA, the shimmering mostly disappeared. Once this is all packaged into a PCB instead of a snarl of wires, hopefully it'll be gone entirely.

I tried using a 74HC123 monostable multivibrator (one-shot) to generate the hsync and vsync signals from csync, instead of generating them directly from the ATTINY microcontoller, to eliminate jittering due to the clock phase. It worked, but it didn't obviously improve anything, so I'm reverting to the simpler design that's entirely implemented in an ATTINY program.

There are a few more details that need working out. Chief among these is how to disable or turn off the microcontroller when the Mac already has separate sync signals and no sync splitting is needed. Simply switching off the micrcontroller's supply pin won't be enough, because it'll phantom power itself through its input pins and their ESD protection diodes. I either need to embrace this as a feature (microcontroller is always on), or else isolate the input signals in a way that prevents phantom powering.

A related question is how to control the sync signal connections. I see as many as four potentially-useful configurations:
  • The Mac's csync signal is read by the microcontroller, which then generates hsync and vsync output signals for the VGA side
  • The Mac's hsync and vsync signals are routed to the corresponding signals on the VGA side
  • The Mac's csync signal is routed to the VGA side's hsync input, and the VGA side's vsync input is left disconnected
  • The Mac's hsync, vsync, and csync signals aren't connected to anything, forcing the VGA side to use sync-on-green if it can
Only the first configuration actually requires the microcontroller, but all four could theoretically be done by the microcontroller via software. But then the microcontroller would need some way of selecting one of those four behaviors, through a set of switches or a button with some simple UI.

There's also a good argument for eliminating the microcontroller from the equation entirely in those last three configurations, to make sure it doesn't cause problems by phantom powering or through some other unexpected means. But then how would those four configurations be implemented? Would I use an 8-input 2-output mux and a pair of DIP switches to select the mode? That would need phantom power, so it wouldn't really accomplish the goal of eliminating phantom power problems. Instead of a mux I could use something like a 4-way switch, but those tend to be bulky and expensive.

You could also argue that only the first two of those four configurations is actually useful: either you already have separate sync, or you use the microcontroller to make separate sync from composite sync. The only reason why you'd ever want to pass through composite sync or force sync-on-green would be if the micorcontroller didn't work correctly in some situations. But if I'm optimistic that it'll work, and if those are the only two configs that are actually useful, the microcontroller can detect whether separate sync signals are present or not and change its behavior automatically. So the whole thing could boil down to a single option.
 

sfiera

Well-known member
Aren't configurations 2-4 addressed by existing, common adapters?

I think 800×600 made its first appearance on the Mac as a sub-type of the VGA mode. I've used it on my Q700, though I couldn't swear it was the internal video. But anything capable of SVGA is capable of VGA and doesn't need a sync splitter.
 

bigmessowires

Well-known member
Yes configurations 2-4 are addressed by existing adapters, but this adapter wants to cover those cases too. The goal is that you can use this adapter basically anywhere, except maybe not for less common video modes like 512x384 and 640x870 if I reduce the number of DIP switches.

I did a bit more reading about 800x600 and it seems that it first appeared on the Quadra 800 in 1993. There's a monitor sense code for "VGA/SuperVGA" so maybe that's it?

In some cases you can hold the option key while clicking the options button in the monitors control panel, and it'll show you a larger list of possible resolutions than usual. Does anybody know how this list is generated, and if it's present in all versions of MacOS? If holding the option key always gets you a list of all the resolutions the computer and video card can support, then why shouldn't I hard code the adapter's sense code to be Apple 13 inch 640x480? That resolution would always work, and then you could change it later in the control panel if desired.
 

chelseayr

Well-known member
@bigmessowires yeah for a while different resolutions used to have slight different acronyms before simply all resolutions low to high basically just got called 'vga' alone and thats that (re svga, xga, etc)

either way 800x600 at thousand of colours would had likely needed 1mb vram and f you wanted the full (millions of colour) view you need 2mb which was beyond many onboard vrams, not a surprise that the early powermac aka x100 series had that acronym 'hpv' for their vram-big cards which was aptly fitting
 

LaPorta

Well-known member
I did a bit more reading about 800x600 and it seems that it first appeared on the Quadra 800 in 1993. There's a monitor sense code for "VGA/SuperVGA" so maybe that's it?
Thanks for the clarification. This is a piece of Mac history that I obviously am unaware of because of my leap from a Mac Plus, to Quadra 660av with fixed 640x480 monitor, to that Performa 6300. Glad to learn something new! Either way, I think this is a pretty awesome project.
 

Arbee

Well-known member
The Apple 16" RGB Monitor that did 832x624 was first supported on the Quadra 700/900. Plain 800x600 was definitely later.
 

bigmessowires

Well-known member
I tried holding holding down the Option key while clicking the "Options..." button in the Monitors control panel, while using a VGA adapter configured to appear as a 13-inch 640x480 monitor:

Mac IIci with system 6.0.8
: No resolution picker is shown. There's an option for "use special gamma" and a few options for how much RAM to reserve for built-in video, but not option for 512x384 or 640x870, both of which the hardware can support.
Mac IIci with system 7.1: Same as 6.0.8
Performa 475 with system 7.1: The option appears for "use special gamma", but there's no resolution picker anywhere.

Any ideas what I'm doing wrong here? The idea of holding the option key to show a full list of video resolutions is not working at all.
 

Phipli

Well-known member
I tried holding holding down the Option key while clicking the "Options..." button in the Monitors control panel, while using a VGA adapter configured to appear as a 13-inch 640x480 monitor:

Mac IIci with system 6.0.8: No resolution picker is shown. There's an option for "use special gamma" and a few options for how much RAM to reserve for built-in video, but not option for 512x384 or 640x870, both of which the hardware can support.
Mac IIci with system 7.1: Same as 6.0.8
Performa 475 with system 7.1: The option appears for "use special gamma", but there's no resolution picker anywhere.

Any ideas what I'm doing wrong here? The idea of holding the option key to show a full list of video resolutions is not working at all.
I've never heard of this being a thing. Someone mentioned an extension, but I've not seen that one either - when they mentioned its name, I searched on Macintosh Garden and didn't get any hits. There is a SuperMac extension called "SoftPrecisionColor" or something, but I think that still required multisync support on the host computer... I forget.

I'd quite like to see it, but it would be pretty useless. Doesn't the IIci only do 3 resolutions? 512x382 (or similar), 640x480 and 870x480? Two of which, you'd never want to use unless you were using the monitor they were designed for.
 
Top