• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

VGA on Compact CRT?

Bunsen

Admin-Witchfinder-General
68040
Preliminary research and thoughts:

Inspired by the recent spate of video hacking on compact Macs, EvilTim's MPxPlayer, and of course the Poor Man's Greyscale Project, I'm wondering how to go about converting the CRT and analog board of a compact to a VGA monitor.

Ideally this would be plug and play with later Macs and PCs without requiring software hacks (as used in the MPxPlayer). And unlike the PMGS, I am looking at using the existing a/b and yoke, rather than cannibalizing another monitor.

Yes, I realise this would require extensive modifications, and may turn out to be impractical. I just want to investigate possible approaches to see whether it is remotely feasible.

This would be a step on the road to an LC630 (or similar) in SE hack.

Resolution........................................ 512 x 342 Horizontal scan rate.......................... 22.3KHZ, (4µs on, 40µs off)

Vertical scan rate ............................. 60HZ (180µs on, 16.4ms off)
the video signal is 15.6672 MHz
The VGA specifications are as follows:
* Selectable 25.175 MHz or 28.322 MHz master clock

* Maximum of 800 horizontal pixels x 600 lines

* Refresh rates at up to 70 Hz

* Vertical blank interrupt

* 0.7 V peak-to-peak

* 75 ohm double-terminated impedance (18.7mA - 13 mW)

Signal

For most common VGA mode 640x480 "60 Hz" non-interlaced the horizontal timings are:

Clock frequency 25.175 MHz

Horizontal pixels 640

Horizontal sync polarity Negative

Total time for each line 31.77 µs

Front porch (A) 0.94 µs

Sync pulse length ( B) 3.77 µs

Back porch © 1.89 µs

Active video (D) 25.17 µs

The vertical timings are:

Vertical lines 480

Vertical sync polarity Negative

Vertical frequency 59.94 Hz

Front porch 0.35 ms

Sync pulse length 0.06 ms

Back porch 1.02 ms

Active video 15.25 ms

640 x 400 @ 70 Hz is video mode used for booting most x86 personal computers.

640 x 480 @ 60 Hz is the default MS-Windows graphics mode with 16 colours.
So at a minimum, I'm looking at the following conversions:

Code:
Spec             Mac       VGA     Unit     x
=================================================
Clock frequency  15.6672   25.175  MHz      1.61
Resolution:  H  512       640      pixels   1.25
         :  V  342       480      pixels   1.40
Scan Rate :  H   22.3      31.476  kHz      1.41
         :  V   60        59.94   Hz       1
=================================================
 
My thought is that the existing Analog board would need to be scrapped and start over with a new one.

The question is would the tube hold up to the higher rates. My understanding is that the gun is rated for a frequency range and will burn out if you go to far out side of those.

 
One problem you'll have is converting the TTL video signal from the Mac into the three (RGB) signals for the VGA monitor.
MarkS, I'm looking to go the other way around from the direction you're hacking towards. That is to say, I want to convert the existing Mac CRT (and, if possible, analogue board) into a compatible display for later computers (or indeed PAL video sources).

EvilTim's MPxPlayer has already accomplished this, albeit using software to force a PC video card to lock to the Mac's scan rates. I am investigating the possibility of hardware modding the CRT/ab to avoid this step, for use with systems where this is not an option (due to unavailable software or hardware limitations). I chose VGA as a kind of lowest common denominator for newer systems.

The MPxPlayer and the PMGS demonstrate that a 640x480 dot pitch and greyscale are no problem: the next step is to create standard scan rates.

Apart from scan and sync, the issue here is not converting the motherboard TTL video signal to analogue, it's piping the analogue signal into the Mac CRT in place of the TTL signal.

EvilTim's ingenious approach to this seems the most promising:

Remove the red, blue and green gain pots, the video signal goes in where the wiper (middle leg) went
modify.png.160c700e0166996080cd634a113e5fb9.png
In this case, of course, there is only one gain (or brightness) pot to bypass, and the R-G-B signals will have to be summed into it.

My thought is that the existing Analog board would need to be scrapped and start over with a new one.
Yes, that seems likely. That is of course the approach the Poor Man's Greyscale takes - I might end up cloning the board he used. I'm sure I have one in the teetering stack o' monitors in the lab.

My understanding is that the gun is rated for a frequency range and will burn out if you go to far out side of those.
How is the electron gun (as opposed to the deflection plates/amps) affected by frequency? /ETA/ the PMGS seems to show that it's not an issue.

 
Thoughts on TV (PAL/NTSC video):

(Much cutting and pasting from wikipedia)

The term PAL is often used informally to refer to a 625-line/50 Hz (576i), television system, and to differentiate from a 525-line/60 Hz (480i) NTSC system. / The line count and frame rate are defined as EIA 525/60 or CCIR 625/50. PAL and NTSC are only the method of the colour transmission used.
There may be errors, inaccuracies or approximations here:

Code:
Spec             unit         |   Mac       PAL       x       NTSC     x     |
==============================================================================
Clock frequency  MHz          |   15.6672   ?                 ?              |
Resolution:  H   pixels       |  512        n/a*                             |
         :  V   lines/frame  |  342        576i      1.68    480i     1.40  |
                lines/field  |             288       0.84    240      0.70  |
Scan Rate :  H   kHz          |   22.3       15.625   0.7      15.75   0.7   |
         :  V   Hz           |   60         50i      0.83     59.97  ~1     |
                Hz           |              25       0.42     29.94   0.5   |
==============================================================================
? even applicable?

* not applicable:

Analogue television signals have no pixels; they are rastered in scan lines, but along each line the signal is continuous.
i = interlaced ie alternating fields scanning alternate lines. Two fields per frame.

[PAL has] 575 scan lines of picture content / Also in analogue, 50 additional blank lines for the synch pulse are added, resulting in 625 lines.
When 576i is used / the odd field of the frame is transmitted first. This is the opposite of NTSC.

while NTSC has a total of 525 lines, only 480 of these are used to display the image for DV-NTSC. For analog NTSC there are 486 lines, and two of those 486 being half-lines (scan line number 263 which appears as the last scan line in the first (odd) field, and scan line number 283 which is the first scan line of the second (even) field; there are 525 scan lines in a frame, and the scan line numbering starts at 1).

PAL: 50 fields per second, 625 lines, odd lines drawn first

NTSC: 59.94 fields per second, 525 lines, even lines drawn first
 
Last edited by a moderator:
TV may be more viable than VGA, it seems. Although a roughly equal amount of hacking would be involved, most of the components will be subject to a lower frequency, from the figures above.

The trick is that TV signals are interlaced, thus only displaying half the number of lines per field. So a PAL field is only 288 lines, and thus the vertical scan rate is lower than that of a compact. By good fortune, the horizontal scan rate is lower as well.

Interlacing could be achieved by slightly bumping or lowering the vertical deflection on alternating fields.

 
A VGA monochrome monitor PCB is going to be easier to hook up to the CRT than modifying the Mac's analog board. That said, it might not be all that hard. The parts that are going to resist bumping the scan rate up to 31KHz from 22 KHz are the flyback transformer and the yoke. It might be necessary to replace them with parts from a mono VGA monitor, and of course all the tuned circuits will need different capacitors, etc.

 
many moons ago i started a project and ran a mac analog board at VGA resolution. problem was, the tuned circuits in the horizontal deflection stage needed re-tuned and redone. there was so many foldover and linearity issues in the horizontal, it wasn't even funny. I used a local PLL locked horiz oscillator. then i used a national semiconductor video amplifier IC using the back porch flyback pulse from the local oscillator and a tap off of the flyback. its been long ago, i cant remember exactly how i did it.

but the V sync could directly drive the Vertical stage no problems. it was the horizontal and video amplifier stages i had the most fun with.

But i could see a very decent picture on the screen of 640x480, 32bit grayscale. problem was, the horizontal linearity was messed up, and the picture was "rippled" in the horizontal stage. the yoke and everything just wasn't tuned or impedance matched at the higher 31khz.

But it did work. I tried replacing some caps and changing the linearity coil from one of an old VGA monitor, and it did improve the picture alot, fixed the linearity, and removed some "waves" in the picture. but the picture just wasn't that great as it still had some ripples in it from the "mis-tuning" of the yoke. But i guess if i would have put a pi-filter network on it, it would have fixed it, but it wasn't worth too much more effort. Also the flyback got hot, dangerously too hot, probably from core saturation. so i never finished the project.

 
Thanks techknight for the writeup on your experience. Good to hear that the resolution is there. By the sound of it, viletim/eviltim's hack gives us a way around the frequency problems you encountered, for some use cases.

Do you have any feedback on this brainfart?

TV may be more viable than VGA / most of the components will be subject to a lower frequency
Code:
Spec             unit         |   Mac       PAL       x       NTSC     x     |
==============================================================================
Scan Rate :  H   kHz          |   22.3       15.625   0.7      15.75   0.7   |
         :  V   Hz           |   60         50i      0.83     59.97  ~1     |
                Hz           |              25       0.42     29.94   0.5   |
==============================================================================
Or is tuning still the stumbling block, whether you shoot high or low?

 
ive tried running at TV frequencies, either direction you steer away from the 22khz tuned center frequency, you start running into problems. so either way you go, you need to retune, but 15khz is easier on the flyback though ;-)

 
About a year ago I converted a 5" monochrome monitor's horizontal stage from mono TTL (18KHz) to VGA (31KHz). But these days I don't put as much effort into documentaion as I once did...

It's over on the shelf, so I'll have a look what I did to it. The yoke and horizontal output transformer are both original, but the transformer has a couple of external windings around the exposed core. I think there was one for boosting the B+ up to a higher votlage and the other winding was placed between the output transistor and the flyback capacitor. Authough it may just be there to increase/decrease the overall inductance. The flyback capacitor was reduced in value to keep the voltage on the aux windings at the same level.

There's a pretty hairy oscilator circuit to shape the horizontal pulse to the correct shape which feeds the output stage.

The compact mac monitors aren't hugely different from this little monitor. I think it would certainly be possible to increase the horizontal frequenct to VGA or even higher.

 
either direction you steer away from the 22khz tuned center frequency, you start running into problems.
What if one were to use an exact multiple of the tuned frequency? Say, 89.2khz (4x). That's within the range a modern video card can put out, though not exactly one of the common frequencies.

 
I dont know. never thought about it. I Guess it all depends in the filtering of the circuitry, and how it handles harmonics, as using multiples of the original fundamental frequency is the same thing as the 2nd, 3rd, 4th, etc order harmonic.

Might work....

 
Back
Top