BMOW title
Floppy Emu banner

Archive for the 'Mac Sync-inator' Category

Mac Sync-inator VGA Sync Converter Launches Today!

 

Today I’m very excited to officially announce a new addition to the BMOW product lineup: the Mac Sync-inator VGA sync converter. I’ve been talking about this project for months, and it’s been available in small quantities while I gathered customer feedback, but now it’s finally ready for the bright lights and prime time. If you own a classic Macintosh or Apple IIgs computer, and have ever struggled to get it working with a standard VGA monitor, then the Mac Sync-inator is for you.

The Sync-inator is an adapter for connecting Apple video sources (DB-15) to VGA monitors (HD-15), with active sync processing circuitry that sets it apart from typical passive video adapters. There’s a built-in microcontroller that analyzes the incoming sync signals in real-time, automatically selects the best adapter settings, and can optionally reprocess the sync signals into a different format for better compatibility with some VGA monitors. You can even view a debug log of diagnostic and technical information about the video signal, as seen by the Sync-inator. For video format nerds as well as for people who want something that “just works” with minimum hassles, there’s a lot to be excited about here.

Sync-inator Benefits

  • Three different sync processing modes, for wider compatibility than other VGA adapters
  • Automatic sync mode selection, for easy setup
  • Sync activity LEDs for quick troubleshooting feedback
  • Serial port output of video signal diagnostic info
  • Plus all the other capabilities of standard VGA adapters

 
What is this and why should I care?

In short, the Sync-inator makes it possible to use many types of VGA monitors that previously wouldn’t work with your classic Apple video source due to sync compatibility issues. It also removes much of the frustration that’s typically associated with using passive DIP switch VGA adapters, by using a microcontroller to automatically configure some of the adapter settings. It will do everything that common passive Mac-to-VGA adapters will do, plus more. If you’ve got a monitor that stubbornly refuses to work with your vintage Mac video card, give the Sync-inator a try.

Sync-inator is not a video scaler, and it doesn’t modify the video resolution or colors in the RGB video signal. Only the sync signals are affected.

 
What the heck is sync?

The video signal from your computer or video card contains synchronization information which helps your monitor detect the beginning of each new line and new frame. There are several different ways in which this sync information can be encoded. Some computers only support specific sync methods, and some VGA monitors can only handle specific sync methods. If your monitor can’t handle the sync signals from your computer or video card, then you’ll have a problem, even if the monitor supports the video resolution and frame rate.

In the world of classic Apple computers, the two most common sync methods are composite sync and separate sync. With composite sync, the horizontal and vertical sync information is combined into a single output signal. With separate sync, horizontal and vertical information is transmitted with two distinct sync signals. Some computers can only output composite sync, or can only output separate sync. Some computers output one or the other at different times, depending on which specific video resolution is active. Some computers output both composite sync and separate sync simultaneously.

The Sync-inator is able to convert a composite sync signal into separate horizontal/vertical sync signals, using several different methods. It’s also able to analyze the incoming sync signal and make an educated guess about which conversion method is best, although this choice can be overridden if you prefer a different method.

 
What’s wrong with my computer? Is it even working?

The Sync-inator also has two built-in LEDs for debugging and troubleshooting video problems. If your monitor remains dark and no image appears, the LEDs can provide information to determine if the problem is with the monitor, the computer, the choice of video resolution, or something else. One LED will light whenever a composite sync signal is present, and the other LED will light whenever a separate sync signal is present. If neither LED is lit, then your computer isn’t outputting any video, and you’ll need to troubleshoot the source. If one or more LEDs are lit, but the monitor doesn’t show any image, then you’re likely dealing with some kind of unsupported video mode and will need to troubleshoot the monitor itself.

 
Debug Log

The Mac Sync-inator has a serial port where debug logging information is provided. The debug log is an optional feature, and all the Sync-inator’s capabilities can be used without ever looking at the log. But advanced tech nerds may find the log info interesting. To view the log, you can attach a USB serial cable to the TXD and GND terminals at the edge of the Sync-inator PCB, and set your terminal software’s serial port speed to 57600 bps. The debug log lists the current sync processing mode, including the result of the automatic processing mode’s analysis, as well as the period and frequency of the detected sync signals and other technical information. Here’s an example showing an Apple “Toby” NuBus video card running at 640×480 @ 67 Hz resolution.

* BMOW VGA Mac Sync-inator, v 1.0
sync mode: choose automatically
detecting sync signals...
hsync no
vsync no
csync yes
csync horiz period 28.5 us, freq 35.0 kHz
csync vert period 15.0 ms, freq 66.3 Hz
auto-select: convert csync into hsync and vsync
csync: pulse width 9 20 871, period 142 285 1003

 
Get your Sync-inator Now

For details on the Sync-inator, usage instructions, or to make a purchase, please see the main Sync-inator page at the BMOW web site. I hope this new device will be as useful for you as it has been for me!

Read 3 comments and join the conversation 

Mac Sync-inator Update

I’m beginning to see the light at the end of the tunnel for my Mac Sync-inator Mac to VGA adapter. The hardware is essentially final now, and all that remains are software tweaks, which are mostly related to the new composite sync splitter behavior. Along the way I’ve amassed a large test fleet of different monitors and an even larger number of Macintosh and Apple-compatible video sources, and testing all those combinations has been very slow.

 
Elevator Pitch

The Sync-inator is a small in-line dongle that aims to be a “pro version” of the Mac to VGA adapters you likely already have, and that takes some of the frustration out of the Mac-to-monitor setup dance, and enables some new combinations of video sources and monitors to work together that were previously incompatible.

The Sync-inator works by rerouting, modifying, or splitting the sync signals from the video source before they’re sent to the monitor. It’ll do everything that common Mac to VGA adapters (e.g. Belkin) will do, plus more. Sync-inator is not a video scaler, and the timing and resolution of the RGB video signals are not modified in any way, only the sync.

The Sync-inator’s “normal” features are:

  • DIP switches to set the desired video resolution. Settings for common resolutions are printed on the back of the device.
  • Configurable passive methods of sync pass-through, like a sync switch matrix.

The “pro” features of the Sync-inator over standard VGA adapters are:

  • Micrcontroller-driven active splitting of a composite sync signal into separate hsync and vsync signals. This is essential for older video sources that only provide composite sync. Although some monitors can handle composite sync or sync on green directly, many can’t, and for those monitors a composite sync splitter is required. This is what motivated this project initially, trying to get my Mac IIci built-in video working on one such monitor.
  • Auto-detecting and auto-configuration of the sync behavior, reducing the typical setup hassles experienced with other adapters. If it senses that hsync and vsync signals are already present, it’ll simply pass them through. If those signals aren’t present, then it’ll kick over to composite sync splitter mode.
  • Sync-inator has two LEDs that will visually show whether the video source is outputting composite sync, separate h and vsync, both, or neither. This should further reduce setup hassles, by making it easy to distinguish between cases where there’s no picture due to sync/resolution compatibility problems versus cases where the video source isn’t outputting anything at all.
  • Sync-inator has a serial port that will dump a bunch of diagnostic info about the video source and its characteristics and timing. That’s fun for video nerds, and maybe useful for something.

“Sync splitting” is a slightly misleading term, because it sounds like there are already two signals that simply need to be separated. In reality it’s more like “sync generation”, synthesizing two wholly new hsync and vsync signals using the csync signal as a reference. This is straightforward in theory, but in practice it’s proven challenging to get every timing detail 100 percent right. Along the way I’ve discovered that some monitors care about certain aspects of hsync and vsync that others don’t seem to: like whether they trigger from the hsync falling edge, rising edge, or both edges, their sensitivity to changes in hsync pulse width, and their tolerance for small amounts of jitter in sync signal edges.

 
Apple IIgs Testing

The Apple IIgs uses the same DB-15 port as early Macintosh computers for connecting RGB monitors, so I wondered whether the Sync-inator could also be made to work on the IIgs. The answer is mostly yes, although there are a few things to watch for. Although the IIgs uses the same pins as the Mac for RGB signals, grounds, and composite sync, some of the other pins are different. On the Mac, three pins are used as a Sense ID to set the desired video resolution, but the IIgs uses one of these same pins for a -5V power supply. It doesn’t need a Sense ID since it always outputs the same video resolution. Unfortunately this means one of the Sense ID DIP switch combinations will connect the IIgs -5V supply to GND. This isn’t fatal, but it prevents the IIgs from turning on, and it’s definitely not good. For IIgs use, the Sense ID switches can all be turned off.

Another challenge for the IIgs is the horizontal sync rate of 15.7 kHz, which is much lower than typical monitors will support. Even if the sync signals are all good, most monitors will refuse to display the RGB video from a IIgs. For testing purposes I bought a Samsung SyncMaster 512N specifically because it was reported to work at 15 kHz with the IIgs. Unfortunately it was a bust. The 512N’s activity LED would turn green and the backlight would turn on, but no picture would appear. The monitor’s front panel buttons were also unresponsive, as if the monitor firmware were frozen. I tried the IIgs’ RGB video in composite sync splitting mode, as well as sync-on-green and csync-to-hsync modes, with the same results every time. The failure in csync splitting mode could be a flaw with the Sync-inator, but the other modes should definitely have worked since this monitor supports 15 kHz as well as SOG and csync-to-hsync (I confirmed its sync support with some other video sources).

So I started doing some digging. In the manual for the 512N, it lists 30 kHz as the lowest supported refresh rate, not 15 kHz. Then I found a handy web page with a big list of older monitors and brief reports of their 15 kHz support. This page lists the 510N’s 15 kHz capabilities as “partial”. It doesn’t have an entry for the 512N, but I think they’re the same thing with and without audio speakers. The other SyncMasters in the same product series were also listed as “partial” or “no”.

After doing more reading, this leads me to believe that 15 kHz may be an undocumented feature that may only work on some 512N samples. Either Samsung changed the internal design during the product’s lifetime without changing the model number, or it’s a question of engineering tolerances and manufacturing variability whether 15 kHz works or not. In my case, the answer seems to be “not”.

Update: I later discovered that the IIgs was in PAL mode (50 Hz refresh). After switching the IIgs to 60 Hz vertical refresh, the 512N behaved identically to the VE228H described next.

 
A Second 15 kHz Monitor

But hang on, that handy web page also lists the Asus VE228H as having full 15 kHz support, and that just happens to be one of the eleven monitors in my growing fleet of test equipment. So I hooked up the VE228H in sync-on-green mode, and it worked! The title photo shows an Apple IIgs GS/OS desktop output via the Sync-inator on the VE228H. I also tried the mode where csync is sent to the monitor’s hsync input, and that worked too, even when I physically cut the green video line to be certain the monitor wasn’t sneakily using SOG.

Sadly the Sync-inator’s csync splitting mode didn’t work on the VE228H – mostly it just showed a blank screen or “out of range” error. That’s OK because csync splitting isn’t needed in this particular case, since one of the other sync modes can be used instead, but it meant that something wasn’t quite right with my 15 kHz csync-split signal. That might eventually be a problem in other settings with other monitors. I spent a long time fiddling with parameters and attempting to hand-tune the resulting sync signals to be as good as possible, and while I did succeed in getting the IIgs video to appear for brief moments, I never found a combination that worked reliably.

Is this a failure? Looking at that 15 kHz web page list again, most of the comments for monitors that worked say that they were tested with a simple passive adapter, without any fancy sync processing. The Sync-inator can do that too, as my tests showed. A 15 kHz csync splitting mode would only be relevant in cases where somebody has a IIgs and a 15 kHz monitor, but the monitor only supports 15 kHz on its separate hsync/vsync inputs and can’t support that same signal as sync-on-green or csync-to-hsync. The comments on the web page would suggest that’s a rare situation, maybe non-existent. Manufacturers that include 15 kHz support probably know that they’re targeting older computers and game consoles where composite sync and SOG are common.

Given all this, I’m planning to remove explicit IIgs support from the csync-splitting code, since it doesn’t work in its current incarnation, and since most of the time it should be possible to use another sync mode with the IIgs (assuming a 15 kHz monitor). Removing the IIgs-specific code would have other benefits too, slightly simplifying the main loop code for csync splitting and enabling it to run a bit faster, which might also help in other areas.

 
Status and Next Steps

With that, I think I’ve nearly reached the end of compatibility testing. One significant change made recently is the addition of a feature that dynamically changes the microcontroller’s system clock speed depending on the supply voltage it detects. The Sync-inator is normally self-powered, drawing its supply current from the sync signals themselves, and the supply voltage varies depending on the particular Mac or video card being used. Higher clock speeds require higher supply voltages. This clock speed adjustment allows for slightly more precise csync splitting behavior when sufficient voltage is available, but has no effect on the other passive sync translation modes.

“Normal” Mac-to-VGA adapter behaviors are now 100 percent working, including setting the desired video resolution through DIP switches, and choosing a passive sync translation mode. This matches the capabilities of other Mac-to-VGA adapters.

For troubleshooting help, the csync and hsync/vsync activity LEDs are working, and the serial port output is working. The default DIP switch setting for the sync mode is also “automatic”, which aims to reduce guesswork.

For the Mac IIci and IIsi, composite sync splitting is 100 percent working on every monitor that I’ve tested. That was my main goal, and it’s met. This enables the IIci and IIsi to work on a wider selection of monitors than before.

I’m fairly certain there aren’t any other Macintosh models whose built-in video doesn’t output separate hsync/vsync signals and that would benefit from csync splitting. Among plug-in video cards, I’ve only found a few early cards from the 1980s that don’t output separate hsync/vsync. For the Macintosh Monochrome Card, composite sync splitting with the Sync-inator is working out-of-the-box with 90 percent of monitors tested, and the one exception also works if an external 5V power supply is used. That’s great.

The Toby Nubus video card has a strangely different csync signal than others. It works with all of the monitors tested, but has a few quirks. For a small number of monitors, an external 5V supply for the Sync-inator is needed when using csync splitting mode. One “Planar” brand monitor balks at the csync splitting signals from the Toby, but automatically switches over to sync-on-green which works. I’d rate the csync splitting support for Toby as 4.5 out of 5 stars.

The SuperMac ColorCard SE/30 is another oddball. It fares similar to the Toby, working with all of the monitors tested but requiring a 5V Sync-inator supply when used with some fussier monitors. The benefit of a 5V supply appears to increase for higher resolution video modes. The Planar monitor behaves the same as with the Toby card, switching over to sync-on-green. I’d rate the csync splitting support for this SuperMac card as 4.5 out of 5 stars.

Although I’ve focused heavily on csync splitting in this discussion, most of the time csync splitting mode won’t be needed, because you’re not using a crusty old video source with composite sync or else because your monitor supports SOG or csync-to-hsync. Those common cases are completely working, 5 out of 5 stars.

I still need to clean up a few loose ends here, but I’m hoping I can finally finish this project soon.

Read 10 comments and join the conversation 

Mac-to-VGA Composite Sync-Splitter Progress

I’ve been continuing the design development on a Mac-to-VGA video adapter with an integrated composite sync splitter, whose concept was first discussed in October, with a first-generation prototype following shortly after. To recap: some Macintosh models like the Mac IIci and IIsi and some Apple video cards like the Toby card output a composite sync signal, instead of the more common configuration with separate horizontal and vertical sync signals. VGA monitors don’t have a composite sync input, but some monitors will accept csync if it’s connected to their hsync input. For VGA monitors that lack this feature, the IIci/IIsi/Toby/etc simply won’t work, no matter how the DIP switches are configured on a passive VGA adapter.

My goal is to design an active Mac-to-VGA video adapter with the ability to process an incoming csync signal and generate new signals for hsync and vsync, thereby enabling the IIci/IIsi/Toby/etc to work on standard VGA monitors and LCDs. This sync translation should be optional, so the adapter can also be used similarly to a standard passive Mac-to-VGA adapter, and it can support the widest possible variety of computers, video cards, and video modes. I’m happy to report that I’m very close to this goal.

An active adapter needs a power source, and the first challenge of this development effort was that the Macintosh video port doesn’t provide any power. The port only has ground connections and data signals, but no handy +5V supply pin. I’ve settled on a design that uses phantom powering, drawing current from the sync input signals themselves in order to power the adapter’s circuitry. While this is generally considered a bad design practice, I’ve been able to keep the adapter’s total current consumption low enough that phantom powering doesn’t interfere with the normal functions of the sync signals. I prefer this solution over requiring an external power source, since it enables the active adapter to be used identically to passive adapters. Just plug it in to the video port, and it works.

The first-generation prototype used an LM1881, a specialized sync-splitting chip that can generate a new vsync signal from a csync input. The LM1881 can’t generate an hsync signal, however. This prototype worked with some monitors that I tested, but not others. I considered replacing the LM1881 with other more advanced sync-splitting chips, but they’re more expensive and more rare. After some experimentation I decided to use a small microcontroller instead of a dedicated sync-splitting chip, since it would be more flexible, cost less, and consume less power than a dedicated sync splitter. That decision was the foundation for this second-generation prototype, which I’m tentatively calling the Mac Sync-inator.

 
Generation Two: VGA Mac Sync-inator

Here’s a 3D rendering of the prototype. There’s not much to the hardware: just a DB-15 for the Macintosh side, an HD-15 for the VGA side, an ATTINY404 microcontroller, and a set of DIP switches. There’s also a USB jack for an optional source of external power, although so far my tests have found it isn’t needed. A pair of LEDs light up to indicate whether the Mac is outputting composite sync, separate horizontal and vertical sync, or both. This is a valuable debugging aid when you’re staring at a black screen and aren’t sure which piece of equipment to begin troubleshooting.

The first six DIP switches configure the monitor ID sense code that the Macintosh will see, and they function very similarly to the DIP switches on passive adapters. Many older Mac models check the sense code at startup, and use the code to determine what resolution of video output to generate, or whether to generate any video output at all. The last two DIP switches control the microcontroller’s sync conversion behavior. There are four choices:

  1. Pass through hsync and vsync without any conversion – For newer Mac models that already output separate hsync and vsync signals.
  2. Pass the Mac’s csync signal to the monitor’s hsync input – For older Mac models attached to VGA monitors that can accept a csync signal.
  3. Don’t pass any sync signals – For Mac models and video cards that have sync information included in the green video channel, called sync-on-green.
  4. Convert the csync signal into new hsync and vsync signals – For older Mac models attached to any VGA monitor, with the widest compatibility.

It’s that last option for csync conversion that’s the interesting one, and that makes this adapter unique. Passive adapters can do the first three behaviors, but not composite sync conversion.

And it works! Using the Mac-Syncinator in csync conversion mode, I’m now able to run my Macintosh IIci on any of my monitors, including the ViewSonic VG900b that has consistently been the pickiest monitor through all my development efforts. Hallelujah!

If you’ve ever used another Mac-to-VGA adapter with a set of DIP switches, then you’ve surely had the experience of not remembering what all the DIP switches do, and not being able to find the manual when you need it. It’s frustrating. To help with this problem, I’ve included a list of the switch settings for the most common video modes directly on the back of the Sync-inator:

 
Remaining Work

So what’s next? Is it all finished? Not quite. As of right now the Sync-inator works with the composite sync signals from the Macintosh IIci and IIsi, and from the Apple Macintosh II Monochrome Video Card 661-0518. But it doesn’t work with the Toby card (Macintosh II Video Card 820-1098) nor with a SuperMac ColorCard SE/30 that I tested. The reason is that not every composite sync signal is constructed the same way.

Here’s the csync signal from the Mac IIci, along with the new hsync and vsync signals that are created by the Sync-inator:

The csync signal is normally high, but there’s a short low pulse after every horizontal scan line of video. Once per frame, the polarity of the whole signal is reversed for a few lines – this inversion is the vsync. The important detail is that falling edges of csync are always regularly spaced, even during the inverted vsync period. The Sync-inator’s microcontroller uses these edges to derive timing information and create a synthetic hsync signal to feed to the monitor.

Now contrast this with the csync signal from the Apple Toby card:

During the vsync period, the csync signal polarity isn’t reversed – it’s simply flatlined at zero so there’s no timing information the microcontroller can use to generate synthetic hsync pulses. The falling edges of csync aren’t always regularly spaced either. They’re mostly consistent, but during the lines just before and just after vsync you can see the csync pulses are suddenly twice as frequent as normal.

The SuperMac card has the same flatlined zero behavior as the Toby, but not the double-speed csync pulse behavior.

The double-speed csync pulses seem like maybe they could be filtered out by ignoring any csync pulse that arrives too soon after that previous pulse. But what’s “too soon”? If I could assume a specific video resolution then I could probably use a fixed time duration for the filter, but if the video resolution might change then I probably need to measure the normal duration between pulses and then create a dynamic filter threshold based on that. Even if I knew exactly how long to make the filter, I’m not yet sure how I would implement it, since csync is triggering a hardware peripheral in the microcontroller rather than being polled and processed by generic program code.

I’ll probably focus on the flatlined zero problem first, since it’s common to both video cards. In theory the microcontroller needs to measure the average time between csync pulses, and detect cases where a csync pulse doesn’t arrive within a small error window around the expected time, and then insert a synthetic pulse in place of the missing pulse. That might be plausible if I were using a super-fast microcontroller and all of this behavior was implemented in program code, but I’m relying heavily on hardware peripherals in the chip. Those peripherals can’t necessarily be configured for that type of complex behavior. Maybe I can rig up some clever scheme of enabling and disabling interrupts at certain times, where the interrupt handlers change the hardware peripheral states, to create a behavior for a missed csync pulse. There will necessarily be timing jitter in these newly-created pulses though, plus some delay between the end of the window where csync was expected and the start of the time where the synthetic pulse is generated. From my earlier experiments, many monitors don’t react well to this kind of jitter and variance in the sync signal timing, so this whole approach may not even be viable. I guess I’ll find out.

It may be impossible to support these oddball csync formats, and I may have to footnote the Toby and ColorCard SE/30 as *not compatible with csync conversion. That wouldn’t be too bad, since the main goal was Macintosh IIci and IIsi support, which has already been achieved. But I’ll give it my best effort!

Read 15 comments and join the conversation 

Mac-to-VGA Sync-Splitter Prototype

Elapsed time: 122 hours from design concept to finished product in my hands. Hey, it works!

Last week I wrote about my attempts to design a Macintosh-to-VGA video adapter with an integrated sync splitter, separating composite sync into the separate hsync and vsync signals expected by most VGA monitors. I bodged together a proof-of-concept circuit using an LM1881 chip, which sort-of worked on some of the monitors I tested. After that, my goals for this prototype PCB were:

sync detection LEDs: Two LEDs to visually indicate whether the Mac is putting out composite sync, separate sync, both, or neither.

self-powering: The chips in the adapter should be powered by rectifying the sync signals themselves, instead of requiring a separate 5V supply.

usable VSYNC: The extracted vsync signal from the LM1881, when combined with the original csync, should enable at least some monitors to work with my Mac that didn’t work before.

Here’s the PCB schematic:

There are two specific elements worth mentioning here. One is the LM1881 RSET resistor, which is 680K ohm in the LM1881 reference design, but I lowered it to 510K ohm here in a belief that this value would be more appropriate for Mac video resolutions.

The second element is the way the Mac’s csync signal is applied directly to the LM1881 video input at pin 2 (or “directly” through a blocking capacitor), instead of first passing through a resistor voltage divider to reduce csync to the approximate voltage level of a composite video signal. I experimented with both approaches, and an earlier schematic used the divider. But I think the combination of the resistor divider and the blocking capacitor formed an unwanted RC filter, resulting in oscillation and strange behavior. I could have taken further steps to address this, but since many other people have used 5V sync inputs with the LM1881, and it appeared to detect the sync just fine, I used the simpler approach without the divider.

 
Shiny New Prototype

My first prototype was an ugly mess of wires and breakout modules, and it didn’t even try to implement sync detection LEDs or self-powering, so I was excited to try this new prototype PCB. I’m happy to report that sync detection works, for both csync and h+vsync. In an effort to reduce the adapter’s current consumption, the LEDs are powered with less than 1 mA of current, but are still easily visible. This is exciting and this feature alone is a great diagnostic tool. At this weekend’s Mactoberfest Meetup, you can bet I’ll be running around plugging one of these adapters into every Mac and Nubus video card that I can find, and making a list of which ones output csync, separate H+V sync, or both.

The self-powering also works. The self-powered supply voltage (diode rectified from the sync signals) results in a VCC about 4.09V. That seems to be high enough for the chips to work, but we’re in uncharted territory for the LM1881 and it may not work completely correctly at this voltage. The Schottky diodes used for rectifying should drop about 0.3V from 5V, so why isn’t VCC 4.7V? Well, there’s also a 180 ohm series resistor on each of the Mac’s sync outputs that will cause additional voltage drop, and the sync output drivers also have some internal resistance. Based on these numbers, I estimate the adapter is drawing about 3.3 mA (0.6V drop divided by 180 ohms) from each of the three sync signal outputs, or about 10 mA total.

It’s great that self-powering works, but the resulting VCC is lower than I would have hoped, and the dependency on that 180 ohm series resistor is troubling. If other Macintosh models and video cards have a larger series resistor or a higher internal resistance on their sync output, then self-powering might not work.

The vsync signal that’s output from the LM1881 has a voltage during its high parts of only about 2.65V. I think 2.65V is still high enough to be a valid logical high voltage when seen at the monitor, but it’s cutting it close. I might add a buffer or transistor here to bring the vsync signal all the way up to VCC, if it doesn’t increase the adapter’s current needs much.

There’s a second oddity about the LM1881’s vsync output with this prototype, aside from the voltage: the vsync pulse width is significantly longer than with the first protoype (about 16 lines versus 10), and it’s also variable (from about 15-17 lines on any given frame). The falling edge of the vsync pulse always comes at exactly the same spot relative to csync, but the time until the rising edge is variable. With my change of RSET from 680K ohm to 510K, the vsync pulse width in this new prototype should have been shorter than before, not longer. I’m not sure if this odd behavior is because of the lower VCC, or because one of my other component values is wrong, or what.

I can try all this again using a 5V external supply, instead of self-powering, and see how things change.

 
Field Testing

So does it actually work for separating hsync and vsync? The answer is yes, sort of. On my Dell 2001FP monitor it works, but the picture jumps up and down vertically by a couple of lines, probably due to the problems with VSYNC. I wouldn’t have guessed that the timing of vsync’s rising edge mattered much, so this is a little surprising.

I just received a Dell EL151FP monitor, which doesn’t work with the IIci normally, but does work via this adapter. Awesome! However once again there’s some vertical jitter.

My Viewsonic VG900b doesn’t work. This is the pickiest monitor in my stable, and it didn’t work with my first prototype either.

The Viewsonic 6 CRT works. This monitor doesn’t work with the Mac IIci normally, so this proves the adapter is doing something useful.

 
Goodbye LM1881, Hello MCU

As promising as this second prototype is, I’m not going to pursue this LM1881 design further. I’m not going to switch to a different sync-splitting chip either. It finally dawned on me that all the sync splitting chips are designed to do something much more complicated than I need: they’re meant to extract sync signals from a composite video signal that contains actual video data, chroma bursts, and negative-going sync, all at low voltage levels around 0.7V. But I don’t need any of that – I already have a 5V composite sync signal and I merely need to extract HSYNC and VSYNC from it.

After giving it some thought, I decided that the best path forward is to use a microcontroller to process the input sync signals, extract HSYNC and VSYNC, turn on the activity LEDs, and do anything else that’s needed. This will create some new challenges like clock-based jitter and VCC-imposed limits on clock speed, but it will turn this into more of a firmware plus circuit design problem, instead of a “read the datasheet” problem involving some complicated sync chip designed for a different purpose than mine.

I’ve already had some success with testing this approach, and in fact I was able to get a usable video image from the Mac IIci on the Viewsonic VG900b monitor, which had rejected all my prior attempts at feeding it synthetic sync signals. There are still more problems to work out, though. More updates coming soon.

Read 7 comments and join the conversation 

Classic Macintosh Video Signals Demystified, Designing a Mac-to-VGA Adapter with LM1881

In the late 1980s When Apple released its first Macintosh models supporting external color monitors, the company made some design choices that continue to cause trouble even today. Computers like the Macintosh IIci supported 640 x 480 video resolution, the same resolution as the VGA standard that was common in the PC world, but they used a different physical connector for the monitor cable, a different vertical refresh rate, and a different method of encoding sync information. It’s those sync differences that have proven to be most problematic over the years. Let’s look at what all is required to use my Macintosh IIci with a modern LCD monitor. Grab some coffee and get comfortable, because this will be a long one.

 
Monitor Connector Comparison

The classic Macintosh video connector is a DB-15, with two rows of pins. The correct name for this is actually DA-15, but nearly everybody calls it DB-15 and we’ll follow that convention. The VGA connector is a DE-15 with three rows of pins. This is sometimes called HD-15 owing to its “high density” arrangement of pins. Despite the physical differences, the video signals on the two connectors are mostly the same: (pinout data from sfiera)
 

Signal Mac VGA
Red video 2 1
Red ground 1 6
Green video 5 2
Green ground 6 7
Blue video 9 3
Blue ground 13 8
HSYNC 15 13
HSYNC ground 14 5
VSYNC 12 14
CSYNC 3 NC
VSYNC/CSYNC ground 11 10
Sense 0 4 NC
Sense 1 7 NC
Sense 2 10 NC
Ground shell shell

This difference in physical connectors is fairly easy to solve with an adapter. During the 1990s and 2000s you could find a Mac-to-VGA adapter at any computer store. Today they’re more rare, but still available from surplus electronic suppliers or eBay.

 
Signals and Sync

A very brief primer on video signal formats: A video signal is composed of a series of lines, organized into frames. The lines are output from the video hardware one by one, at a fixed rate, and the timing of each line is indicated with an HSYNC pulse from the video hardware. After all the lines in a frame have been output, there’s a VSYNC pulse before the start of the next frame. The monitor needs these sync pulses to keep its display operating in lockstep with the video signal.

The 640 x 480 VGA standard uses 60 frames per second – its vertical refresh rate is 60 Hz. But Apple chose a 67 Hz refresh rate for its 640 x 480 video format (actually 66.666666…), which could be argued is slightly better than 60 Hz because the higher rate results in reduced flickering on CRTs. The difference is negligible, however, and the 67 Hz rate only serves to complicate things. Fortunately most modern moderns support a fairly wide range of vertical refresh rates, where a range like 50-75 Hz is common. This means that the 67 Hz refresh rate usually isn’t a problem. If you know of a counter-example, please tell me.

What about those sync signals? In the VGA standard, HSYNC and VSYNC are provided as separate input signals on VGA pins 13 and 14. It’s nice and simple, end of story. But in the classic Macintosh video world, sync is… complicated. There’s a fair amount of misunderstanding and myth about this topic floating around the web, so I’m here to explain the truth. From the table above we can see that the Mac has outputs for HSYNC and VSYNC, but also for CSYNC composite sync (HSYNC xor VSYNC). Many people have also heard about sync on green, where composite sync is mixed directly into the green video channel. So what exactly is the Mac video sync standard? Does it output separate HSYNC and VSYNC, or CSYNC, or sync on green?

The answer is yes, the Mac generates all of those sync standards at different times, depending on what type of monitor it thinks is connected. But it doesn’t generate all of them all of the time. The video hardware checks the voltages on the connector’s three sense pins, which form a 3-bit monitor ID for the connected monitor type. If it’s a supported monitor type, the video hardware configures itself for an appropriate output signal and sync method. If it’s not a supported monitor type, the video hardware shuts off and outputs nothing.

Here’s a page from a Macintosh IIsi hardware developer note. The IIsi’s video hardware is nearly identical to my IIci:

We can see that four different types of monitors are supported, but two of them share the same monitor ID and signal format. For a 15 inch portrait monitor, the Mac outputs separate HSYNC and VSYNC signals exactly like VGA requires, but at the mostly-useless portrait resolution of 640 x 870. For the 13 inch RGB monitor standard that we’re interested in, with 640 x 480 resolution, HSYNC and VSYNC are stuck high and the sync information is provided via CSYNC.

What about sync on green? Although it’s not mentioned anywhere in the developer note, the Mac also outputs sync on green any time it outputs composite sync. It outputs both CSYNC and sync on green. In fact, it also outputs sync on red and sync on blue too – all three color channels have embedded sync information when composite sync is used. This was recently proven conclusively with a video hardware schematic analysis followed by a series of tests by dougg3 (Doug Brown), who kindly gave me permission to reproduce his oscilloscope captures here.

Doug hotwired his IIci’s monitor connector, grounding pin 4 (sense 0) to produce the monitor ID for 640 x 480 RGB. He made this scope capture showing the Mac’s CSYNC output (yellow trace) and red video signal (cyan trace). On CSYNC you can see the shorter HSYNC pulses and the longer VSYNC pulse combined with the HSYNC pulses during it. On the red channel, you can see some red video data on the left, with the sync info clearly also present in the lower voltage range.

Looking at the green channel also showed the same thing – embedded composite sync in the green video data. Doug then looked at the VSYNC output (cyan trace):

Nothing. VSYNC was just a constant high voltage. Nothing to see here. This confirms the information from the developer note: when CSYNC is output, VSYNC and HSYNC are turned off.

 
DIP Switch VGA Adapters

Now we know enough to begin peeking inside the common Mac to VGA adapters, with their confusing arrays of DIP switches, to understand how they work. If you’ve been around classic Macintosh computers for a while, you’ve surely seen many variations of these:

Obviously they are physical adapters from DB-15 to HD-15, but what do all those DIP switches do? For nearly all such adapters, the guts are simply a passive switch matrix, controlling how the Mac pins are connected to the VGA pins. There’s no signal processing of any kind. The DIP switches typically perform two functions:

Monitor ID – Configure how the sense pins are connected to ground, or to each other, to set the desired monitor ID. This tells the Mac what kind of video signal to generate.

Sync mapping – VGA VSYNC can optionally be connected to Mac VSYNC. VGA HSYNC can be connected to Mac HSYNC or Mac CSYNC.

They’re pretty simple devices. Maybe you’re wondering why you’d ever want to connect the Mac’s CSYNC to the VGA monitor’s HSYNC. Many newer monitors are able to accept composite sync as an alternative to HSYNC and VSYNC, and if they have that capability, they will normally expect CSYNC on their HSYNC input. Providing a DIP switch mapping for this will enable the Mac to work directly with such monitors.

Note that there are no DIP switch settings related to sync on green. If the monitor supports sync on green, it will use the sync info in the green video channel with no extra configuration needed. If the monitor doesn’t support sync on green, too bad.

 
The Sad Tale of One Macintosh IIci, Four Monitors, and No Joy

Are you still awake? With all of this background exposition finished, we’re finally ready to tell the story that inspired this whole investigation. It’s the story of my Macintosh IIci, four different monitors, a host of different Mac-to-VGA adapters, and a lot of frustration leading to eventual understanding and the design of a new video adapter.

For several years I’ve been using my Macintosh IIci with the Griffin Mac PnP adapter pictured above and a Dell 2001FP LCD monitor, and it’s worked great. This particular monitor also has a composite video input that works with Apple II and other classic computer hardware, so it’s an excellent tool for computer collectors. As to exactly how the Mac IIci video worked with this monitor, I never gave it any thought. I just plugged it in and got a picture.

A couple of weeks ago I went on a shopping spree and purchased a ViewSonic VG900b 19-inch LCD, a Viewsonic 6 TX-14H30 14-inch CRT, and an E-Machines ColorPage T16 II 1108DT16MR 16-inch CRT. These are all multisync displays, with a max resolution of 1024 x 768 on the CRTs and 1280 x 1024 on the LCD. But when I connected them to my Mac IIci with the Griffin adapter, I got no picture from any of them. I tried zillions of DIP switch settings, I tried different adapters, but nothing helped. All three of these fussy monitors simply refused to show any image from my IIci. They behaved as if nothing were connected.

Now that we understand the video signals and the inner workings of the DIP switch adapters, we can see the likely reason that nothing worked. In 640 x 480 mode the Mac IIci outputs composite sync and sync on green. My 2001FP must support one or both of those sync standards, but the new monitors probably don’t support them. In the case of the VG900b this was confirmed in the hardware specifications listed in its manual, where it lists support for “H/V Separated (TTL)” video sync. Other Viewsonic LCDs from the same era specifically mention composite sync and sync on green in their specifications, so this isn’t likely just an accidental omission from the documentation. I haven’t been able to find detailed specifications for the two CRT monitors, but I’m guessing it’s the same issue. These monitors require separate HSYNC and VSYNC signals, and won’t support any other sync format.

 
LM1881 to the Rescue

What do you do when your computer outputs composite sync, but your monitor requires separate HSYNC and VSYNC? Say hello to the Texas Instruments LM1881 Video Sync Separator.

This chip is designed to extract composite sync from composite video, a video standard in which composite sync is mixed with RGB color data. In our case the composite sync is already separated from the color data and doesn’t need to be extracted, but the LM1881 has another feature we can take advantage of: synthesis of a separate VSYNC signal from the composite sync input. Unfortunately the LM1881 doesn’t have a complementary HSYNC output. There are other rarer and more expensive chips that can extract both HSYNC and VSYNC, but I haven’t investigated these.

Fortunately for us, I’ve learned that many (most?) monitors will accept CSYNC as a substitute for HSYNC, so long as a separate VSYNC signal is also provided. So all we really need is VSYNC, and the LM1881 can do the job.

Armed with this information, I set out to build a Mac to VGA adapter with an integrated LM1881 that would enable my Macintosh IIci to work on those three fussy monitors. I would use the LM1881 to extract VSYNC from CSYNC, passing the VSYNC to the VGA monitor, and I would pass CSYNC to HSYNC with my fingers crossed.

I began with a DB-15 breakout. I connected up all the grounds, and grounded pin 4 (sense 0) to request Mac 13 inch 640 x 480 mode. I plugged the breakout into my Macintosh IIci, and connected a logic analyzer to all three sync outputs. CSYNC showed the expected composite sync with a period of 15 ms (66.67 Hz), while HSYNC and VSYNC remained high.

Next I soldered some wires to an LM1881 breakout PCB. The LM1881 requires a 5V supply, which isn’t present on the monitor connector, so I stole 5V from the floppy disk port. Later I intend to try self-powering the LM1881 using the (otherwise unused) VSYNC and HSYNC signals as a power source.

Examining the LM1881 composite sync output, I saw that the output followed the input as expected.

But zooming in, the signals were not quite the same. The LM1881 output lagged the CSYNC input by about 100ns, and included a very short low pulse before going high and low again, for each pulse on the CSYNC input. This might have been an artifact of using a logic analyzer to view the signal, rather than an analog oscilloscope.

Then I soldered another wire to LM1881 pin 3, the synthesized VSYNC output. It worked! But the extracted VSYNC lagged the input VSYNC by a whole line, and extended several lines past the end of the input VSYNC. This was unexpected, but I believe the exact timing and duration of the VSYNC signal isn’t critical, so long as the refresh frequency is correct.

So far, so good. I finished the adapter by adding an HD-15 breakout. I connected the LM1881’s VSYNC output to VGA VSYNC, and LM1881 CSYNC output to VGA HSYNC. Remember, this second connection isn’t really correct – CSYNC is not HSYNC – but we’re relying on the premise that monitors will accept CSYNC on their HSYNC input as long as they also have a separate VSYNC signal. Thanks to the LM1881, we now had that missing VSYNC signal.

Here’s the finished adapter, including the floppy port adapter for stealing 5V: it really is a big mess o’ wires, and something so ugly that only a mother could love it.

I’ve mentioned that I have one monitor that’s worked with my IIci’s built-in video all along: the Dell 2001FP. And three monitors that do not work, no matter what settings I have tried on the VGA adapters: the Viewsonic VG900b LCD, Viewsonic 6 CRT, and E-Machines CRT.

As a sanity check, I tried the Dell first:

It still worked, but the video quality was lousy: there was all kinds of shimmering and noise in the image. Maybe it was a result of my messy nest of wires snaking everywhere? At least there was a usable image.

Next I tried the Viewsonic VG900b LCD. This was the real test, since this monitor had refused to sync with my IIci video before. Would it work now?

Whomp whomp, so sorry. There was no love from the VG900b, which still complained there was no video signal and then went to sleep. That was disappointing. Maybe the VG900b doesn’t like CSYNC as HSYNC substitute, or maybe it’s confused by the CSYNC that’s also still present on the RGB channels.

OK, how about this Viewsonic 6 CRT? It never worked with the IIci video before, but how about now?

Success, it worked! The image quality was pretty good too. There was still a little bit of shimmer, but much less than with the Dell 2001FP. I’m not sure why there was such a difference, maybe something about digital versus analog video circuitry?

The final test was the E-Machines 16 inch CRT. This was the third member of the fussy trio that had refused to work with my IIci built-in video before:

Huzzah! It also worked (minus some image centering). The image quality was similar to the Viewsonic CRT: some shimmer, but not too bad.

 
Design of a New Mac-to-VGA Adapter

That’s a score of 2 out of 3 for this Mac-LM1881 adapter. I think that’s useful enough to deserve being made into a proper PCB kit, for other classic Macintosh computer owners who’ve faced the same monitor challenges. Since it’s such a simple circuit, I’ll probably share the whole PCB design for anybody who wants to make their own, and also stock a few in the BMOW store for anybody that wants a pre-built adapater.

To assist with troubleshooting, I’d also like to include some LEDs in the adapter to show which of the Mac sync outputs have activity, and maybe also which of the RGB outputs have activity. I haven’t quite figured out how to do this. The RGB outputs are only 0.7V, and may have negative voltage swings if sync on green is used. The sync outputs are standard TTL levels with 0 to 5V swing. I’ve been brainstorming how to build an “activity detector” circuit to turn on an LED without involving a microcontroller. Maybe something with a flip-flop where the sync signal is used as the clock input, and there’s an RC circuit with appropriate time constant connected to the flip-flop’s asynchronous clear. If you have any great ideas for this, please share them.

Some questions about the LM1881 remain. I belatedly read the chip’s data sheet only after I’d finished my experimentation, and realized that I may be using it incorrectly, and that many of the similar circuits seen on the web are using it incorrectly. Referring to the canonical LM1881 circuit diagram shown above:

  1. Why didn’t the Viewsonic VG900b work with the LM1881 sync signals? Is there something simple I could do to fix it?
  2. The datasheet says the recommended input voltage on pin 2 is 1.5V and the absolute max is 3V, but I’m feeding it a 5V sync signal from the Mac.
  3. A different RC filtering scheme on input pin 2 may be needed – the 0.1 uF blocking capacitor is just an example. “Typical Applications” in the datasheet shows an alternative design with an RC lowpass filter on pin 2.
  4. The value of the R-set resistor may need to be adjusted, depending on video timing. The default value of 680 kOhm may be inappropriate for this.
  5. The LM1881 output pins can only source a few mA of current, but if I’m putting 5V into a 75 ohm terminated monitor input, won’t that be 67 mA? Do I need to buffer these signals? 67 mA is a pretty large amount of current, and more than even most buffers can provide. Perhaps I’ve misunderstood this. Do I also need a 75 ohm resistor at the source? Does 75 ohm termination even apply to the sync signals, or is that only for the RGB signals?

The investigation continues. More updates soon, I hope!

Read 15 comments and join the conversation