• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

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

bigmessowires

Well-known member
Yes it wouldn't be particularly useful on the IIci, I'm just trying to understand the behavior so I can decide how important it is for my adapter to support all the different monitor sense ID codes explicitly versus just letting the user pick a resolution in the control panel.

This is the only reference I found to holding the Option key to unlock more resolutions. Maybe the author was hallucinating. From https://users.soe.ucsc.edu/~davis/projects/mac/monitor.html: "Holding the option key and clicking the options button in the control panel, brought up a complete list of choices and I selected 1024x768_60Hz." and "Go to the monitors control panel. Hold the option key and hit the options dialog button. You'll see a list of resolutions. 1024x768_70Hz will work nicely on you Apple 15". 60Hz will also work fine. I tried 75Hz which is the normal mac 1024x768 and things were weird, but they did come in."

I saw a reference recently to a control panel or extension that claimed to unlock all the possible video resolutions, and it mentioned the name. But I can't find where that was now. :( It's hard to search for it with Google because the results are polluted with info for modern OSX machines.
 

Phipli

Well-known member
Holding the option key and clicking the options button in the control panel, brought up a complete list of choices and I selected 1024x768_60Hz."
1024x768 means this is a MultiSync capable machine. I suspec this is equivalent to the "Recommend" vs. "All" options in Mac OS 8.* and 9? Not sure. But that mostly lets you pick the frequency (and some extra resolutions sometimes), and can be handy for LCDs.

The computer they're using is a first generation PPC. Quite a bit newer feature wise.
 

bigmessowires

Well-known member
Well, I guess that question is answered. It's not going to be viable to expect users to select different resolutions from the Monitors control panel if the monitor sense ID isn't one that would normally support those resolutions. So the VGA adapter really does need to generate all those different sense IDs, either with DIP switches or by some other method. Hmm.
 

eharmon

Well-known member
Well, I guess that question is answered. It's not going to be viable to expect users to select different resolutions from the Monitors control panel if the monitor sense ID isn't one that would normally support those resolutions. So the VGA adapter really does need to generate all those different sense IDs, either with DIP switches or by some other method. Hmm.
Yeah, I think the best you could do otherwise was set it to MultipleScan 21", but that still limits the resolutions you can use:


640x480
832x624
1024x768
1152x870

Or maybe SuperVGA, which should support 640x480, 800x600, and 1024x768, iirc.

And it'd only work with Macs new enough to understand those sense codes.
 

Melkhior

Well-known member
or by some other method
As there is quite a bit of ADB knowledge on this forum, including for weird I/O, maybe you could kill two birds with one stone and use some form of ADB to both get some 5V power and control of the monitor ID? A small piece of software could read/write the needed value in some form of non-volatile memory on the controller side, if one is available.
ADB is a rather simple bus so you can just have a pass-through for keyboard or mouse, or even have an extra plugs for those ADB-poor systems.
 

LaPorta

Well-known member
So, here is the shot from 7.1.1 on my IIfx. This is actually without holding option at all. All option does is makes it possible to change the gamma, as you said.
image.jpg

Here is the second card that I have, which is only capable of outputting 640x480:

image.jpg

So, I think it probably has to do with hardware sensing of some sort, or at least what the machine and/or cars thinks the connected monitor or cars is capable of somewhere along the line.
 

bigmessowires

Well-known member
The hardware is beginning to take shape in my mind, in a way I'm pretty happy with.

After more tinkering I discovered that the adapter keeps functioning when the phantom-powered voltage is as low as 2.75V, and maybe it can go even lower. So I feel comfortable with the idea that the microcontroller will always be on, with no way to turn it off. I'll include a USB micro port on the adapter for optional external power, just in case there's some situation where it's needed, but I expect it won't be necessary.

I've also massaged the code for sync splitting to where it's working pretty reliably on my IIci with the two monitors that don't normally work with the IIci. It's entirely a mcu program for sync processing, with no other active components needed. The sync splitting code also works well with two other monitors, even though it wasn't needed on those monitors because they also support composite sync. But it causes trouble on another monitor that works fine with composite sync, meaning that sync splitting actually makes things worse for that monitor. So I'll definitely need to include an optional way to put the mcu into "bypass" mode, where the existing sync signals are just passed through without any fancy processing, for cases where the processing causes trouble.

I can use two DIP switches with four permutations to configure the mcu into one of four sync modes: hsync/vsync pass-through, csync pass-through, sync-on-green (no other sync is passed through), and mcu-assisted splitting of csync into hsync and vsync. That should cover all the cases that regular VGA adapters can handle, and with an optional sync splitting mode too, with just two DIP switches.

The full gamut of monitor ID sense codes needs six DIP switches when implemented in the typical way. So this adapter could have 6+2 = 8 total DIP switches. I might be able to do something clever and reduce the number of DIP switches needed for the sense codes by 1 or 2, by eliminating support for rarely-used sense code IDs. But I'm not sure it's worth it, since there's not much practical difference between an adapter with 6, 7, or 8 DIP switches. You're still going to need to refer to a chart to remember what all the switches do. I'd hoped to avoid that but I don't think it's really plausible.

My initial attempt at phantom powering had Schottky diodes connected between each sync signal and a 47 uF capacitor on the mcu's supply pin. That worked fine, but I later discovered that I don't even need those diodes. If the sync signals are connected to mcu input pins, then the mcu will magically turn on when sync signals are applied even if the mcu supply pin is completely disconnected. The sync signals will pass through the ESD protection diodes in the input buffers and inject current into VDD. This is a cool party trick, and would eliminate the need for some external components. But external diodes are probably safer, and Schottky diodes also have a smaller voltage drop than the silicon diodes used for ESD, so the resulting phantom supply voltage would be slightly higher if using external Schottky diodes.

My hardware sketch looks something like this: An ATTINY204 microcontroller (14 pins, 11 usuable I/Os) is the only active element. The Mac's csync, hsync, and vsync signals are each connected to a Schottky diode which feeds a large-ish bulk supply capacitor, something in the 10s of microfarads range. That's the phantom power supply. There's also a USB-B micro connector for external power in case of emergencies, and a microcontroller programming header (or footprint for one).

The Mac's csync, hsync, and vsync are connected to microcontroller inputs, and the VGA hsync and vsync are connected to microcontroller outputs. The code can connect sync inputs to sync outputs in one of four different ways, specified by two DIP switches. Six other DIP switches set the monitor sense ID, but aren't connected to the microcontroller. There are 8 total switches.

There are two LEDs that light up to indicate when a composite sync signal is present, and when separate hsync/vsync signals are present, for quick troubleshooting.

That's 8 or 9 I/O pins depending on how the LEDs are handled, which leaves a few extras for something else or they can be left unused.

I believe that an adapter like this could do everything that other Mac-to-VGA adapters do, so you'd never be worse off by having it, and it would also have the bonus feature of sync splitting for the IIci, IIsi, Toby, and others that can benefit from it. I'll make the sync splitting code as robust as I can, and while I'm sure it won't work in every situation and for every monitor, it will hopefully work for all of the common ones and will be a valuable extra tool in the Mac collector's toolkit.
 

bigmessowires

Well-known member
I think the hardware design is finished. I couldn't fit the whole list of monitor IDs on the back, but I included enough to cover the most common cases.

mac-syncinator-bottom.png

mac-syncinator-top.png
 

bigmessowires

Well-known member
That was insanely fast! From design to finished product in five calendar days. I'm not even ready to test these yet, so this hardware will just need to sit and wait. How do they fabricate these so quickly?

IMG_4003.jpg
 

NJRoadfan

Well-known member
Wonder if this will work on the Apple IIgs. There exists an adapter that uses a LM1881 to split the composite to H+V sync.... but the IIgs port supplies 12 volts on pin 8. Composite is still on pin 3, but pin 12 is composite video, and pin 15 is unused. Might not be enough phantom power.
 

bigmessowires

Well-known member
Doesn't the IIgs video output have NTSC timing rather than VGA timing? This adapter should be able to convert the IIgs composite sync into separate h and v sync, but to display a IIgs video signal you'd also need a monitor that supports 15.734 kHz horizontal frequency, and that's not very common. You'd probably need a scan converter or similar.

The adapter here is basically an upgraded version of the common Mac-to-VGA adapters with an added feature for composite sync conversion. It has no aspirations to being a scan converter or HDMI converter. That would certainly be cool to have, but would greatly increase the complexity and cost.
 

François

Well-known member
RGB2HDMI needs to tap into digital videos signals, and is only 9 bits (?) for RGB. It is absolutely not suited for VGA signals.
 

NJRoadfan

Well-known member
There are some monitors (and maybe even a few scan converters) that accept 15.75khz RGB, but only with H+V sync.
 

bigmessowires

Well-known member
Hey, it works! This VGA adapter quest started several months ago when my Mac IIci wouldn't display a picture on my ViewSonic VG900b, and I stubbornly refused to simply use a different monitor. Here's the Mac Sync-inator running on that same IIci and VG900b, looking good!

IMG_4006.jpg

The picture is stable and crisp. The shimmering that I observed with my prototype is gone. The photo shows some fine vertical lines, but I think that's an artifact of my camera interacting with the monitor. To the human eye, the picture looks as good as you could expect for 640x480 scaled to 1280x1024.

I'm pretty psyched. If everything else failed from here onward, I'd still consider this a success. The phantom powering of the adapter's microcontroller from the IIci's sync signals is working great, with a 4.6V supply voltage. I also tested the USB micro jack on the adapter to verify it works as a source of auxiliary power if phantom powering doesn't work on some systems.

My next task is to implement these pass-through modes that are promised on the bottom of the adapter:

IMG_4009.jpg

That should be pretty easy, assuming I haven't done anything stupid. Then I need to add some code to activate those CSYNC and H/V SYNC detection LEDs on the top side of the adapter, for troubleshooting purposes. Those were implemented in hardware in my first-gen prototype from October, but now I need to write software equivalents.

The final task will be to augment the microcontroller program so that it can decode composite sync signals with more irregularities than the Mac IIci and Mac IIsi signals. My SuperMac ColorCard SE/30's CSYNC signal is low during the entire vblank period, so I can't use CSYNC to derive timing for HSYNC during vblank, and will need to find some other method. The Apple Toby card has the same issue during vblank, and it also has "serration pulses" before and after vblank that must be detected and ignored, for an extra challenge. I'm not sure I'll be able to make either of those cards work, but I'll try.
 

Fizzbinn

Well-known member
I most definitely want one of these! My one small LCD that supports sync-on-green (ViewSonic VG150) is flaking out on me and it would be so nice be able to just keep just my NEC LCD1550V on my workbench to use with all my vintage Macs!
 
Last edited:
Top