bigmessowires
Well-known member
I've been kicking this idea around in my head: build an adapter to connect a compact Mac (128K, 512K, Plus, SE) to an external VGA monitor. Has anyone seen something like this before? I did a quick web search, but didn't find anything.
I see two parts to this hack: getting the video signal out of the Mac, and converting it to VGA. Getting it out shouldn't be too bad, I think: the video and sync signals are already present on the analog-to-logic board connector. Some kind of Y-splitter cable could be inserted inline, with some new wires to feed the video signal out the back, through the battery compartment or a drilled hole. (eek!)
Converting to VGA is the tricky part. The Mac's horizontal refresh rate is 22.25 kHz, which doesn't match any standard VGA resolution, nor does it divide evenly into any standard resolution. It's around half the 48.36 kHz rate for 1024 x 768 @ 60 Hz VGA, but it's not exact.
Outside the Mac, you'd have a board with a CPLD or FPGA, maybe some RAM, and a VGA connector. The job of the FPGA would be to record the incoming video signal, then play it back out at a different rate. It might also need to flip the polarity of the sync signals.
One approach would be to buffer an entire frame's worth of Mac video into RAM, then play that frame back out at a new rate while simultaneously buffering the next frame. This would require two frame buffers worth of memory: 512 x 342 x 2 / 8 = 44KBytes of RAM. I believe there are FPGAs with that much internal RAM, or alternatively one or two external RAMs could be used. Two external RAMs would be convenient, because of the requirement of simultaneous access to both the incoming and outgoing buffers. But it might be possible to use one external RAM and do transfers twice as fast, alternating incoming and outgoing data. With external RAM, it should be possible to fit all the logic inside a smaller and cheaper CPLD instead of an FPGA. But you'd need around 25-50 I/O pins to interface with all the address and data lines on the RAM(s).
The second approach would be to buffer only one line's worth of Mac video, then play it back out twice, at 2x the original rate. This would only require two lines worth of memory: 512 x 2 / 8 = 128 bytes. That might even fit inside a CPLD, or for sure inside an FPGA. But this approach would result in a horizontal refresh rate of 2x the Mac's rate, or 44.5 kHz. I don't know if that would be close enough to 48.36 kHz for a VGA monitor to be happy with it, or if it would barf. I'm guessing it would barf, but it's probably worth testing.
With either approach, you would end up with a pixel-doubled VGA display at 1024 x 768, with a black boarder at the top and bottom, since 342 x 2 is less than 768.
A CPLD with external RAM may be the better solution. I did a quick check on FPGAs, and the Xilinx XC3S500E has enough internal RAM, but it costs $30, only comes in a BGA package, and runs at 1.2 volts. Not very hobbyist-friendly.
Thoughts? Am I crazy?
I see two parts to this hack: getting the video signal out of the Mac, and converting it to VGA. Getting it out shouldn't be too bad, I think: the video and sync signals are already present on the analog-to-logic board connector. Some kind of Y-splitter cable could be inserted inline, with some new wires to feed the video signal out the back, through the battery compartment or a drilled hole. (eek!)
Converting to VGA is the tricky part. The Mac's horizontal refresh rate is 22.25 kHz, which doesn't match any standard VGA resolution, nor does it divide evenly into any standard resolution. It's around half the 48.36 kHz rate for 1024 x 768 @ 60 Hz VGA, but it's not exact.
Outside the Mac, you'd have a board with a CPLD or FPGA, maybe some RAM, and a VGA connector. The job of the FPGA would be to record the incoming video signal, then play it back out at a different rate. It might also need to flip the polarity of the sync signals.
One approach would be to buffer an entire frame's worth of Mac video into RAM, then play that frame back out at a new rate while simultaneously buffering the next frame. This would require two frame buffers worth of memory: 512 x 342 x 2 / 8 = 44KBytes of RAM. I believe there are FPGAs with that much internal RAM, or alternatively one or two external RAMs could be used. Two external RAMs would be convenient, because of the requirement of simultaneous access to both the incoming and outgoing buffers. But it might be possible to use one external RAM and do transfers twice as fast, alternating incoming and outgoing data. With external RAM, it should be possible to fit all the logic inside a smaller and cheaper CPLD instead of an FPGA. But you'd need around 25-50 I/O pins to interface with all the address and data lines on the RAM(s).
The second approach would be to buffer only one line's worth of Mac video, then play it back out twice, at 2x the original rate. This would only require two lines worth of memory: 512 x 2 / 8 = 128 bytes. That might even fit inside a CPLD, or for sure inside an FPGA. But this approach would result in a horizontal refresh rate of 2x the Mac's rate, or 44.5 kHz. I don't know if that would be close enough to 48.36 kHz for a VGA monitor to be happy with it, or if it would barf. I'm guessing it would barf, but it's probably worth testing.
With either approach, you would end up with a pixel-doubled VGA display at 1024 x 768, with a black boarder at the top and bottom, since 342 x 2 is less than 768.
A CPLD with external RAM may be the better solution. I did a quick check on FPGAs, and the Xilinx XC3S500E has enough internal RAM, but it costs $30, only comes in a BGA package, and runs at 1.2 volts. Not very hobbyist-friendly.
Thoughts? Am I crazy?