Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting one of these http://www.old-computers.com/museum/computer.asp?st=1&c=446

I'm planning to build a server inside it. And I was thinking of using the built in CGA-monitor as a statusdisplay (LCDInfo style, or whatever the cool geeks use nowadays). The screen is monochrome amber so it would probably look a bit like the Planar EL-screens some have been using in their mods. And I want to use an Arduino (or something like it) as a middleware solution... PC -> Arduino -> Screen

I have been checking up a bit, and CGA is a RGBI signal using TTL-communications. 4 lines (RGB + Intensity), combined with HSYNC (15.75KHz) and VSYNC (60Hz). The 4 "color-inputs" are logic on or off. The combination of these generates up to 16 colors. However, as this is an amber screen, it would probably be easiest to start with "all-high" or "all-low"... White and Black.

So the problem is the following... I could probably both wire and code the arduino to flip the TTL-lines on and off, but I'm not sure what I do with the HSYNC and VSYNC inputs. And how to time the TTL-flips to correspond to pixels on the screen. (The standard CGA resolution is 320x200).

I'm not very good at electronics, but I'm very good at following instructions, and taking hints

Has anyone tried this before?

EDIT: Could I maybe use a modified version of this? http://www.eosystems.ro/deogen/deogen_en.html

EDIT2: I don't need to use an Arduino. But I want to keep it as simple as possible.

EDIT3: It might seem that the monitor in question actually is a composite monitor, and not a "real" CGA input monitor. So that probably makes things a bit easier. But I'm still interested in how to generate a pure CGA signal using a microcontroller...

share|improve this question
up vote 7 down vote accepted

The hsync and vsync signals are just relatively short, negative pulses that reset the CRT's electron beam to the left and top of the screen respectively.

Since CGA was basically just NTSC (AKA RS-170) with separate sync and components, the timing of the pulses should be the same. The hsync would occur about every 63.5 microseconds, and the vsync about every 16.7 milliseconds. The vertical timing should be well within the capabilities of an arduino, but the horizontals might be more challenging.

During the active horizontal scan you'd need to update the luminance according to the horizontal resolution you're designing to. To get 640 pixels, assuming you use about 53 us of the horizontal trace time to allow for HS duration, and margins to make sure your output doesn't run off the edges of the CRT, you need to output a new pixel about every 82 nanos,. Now, 82 ns is (probably) way to fast to get directly from an arduino, but if you employ an external 8-bit shift register, you only have to load that about every 660 ns, i.e., order of half a microsecond. Of course you could opt for 320 pixels and ease the timing further.

If meeting that kind of timing sounds reasonable to you, the exact numbers could easily be had via some light googling. For example, this looks like a pretty good example.

share|improve this answer

Are you set on a Arduino?

The Parallax Propeller can generate all sorts of video signals natively. There is code available for Generating VGA and composite video signals, and all the sources are available too, so you can tweak them if you want. Internally, it has a set of specialized video-timing-generation logic. It should be possible to configure the system to drive that screen without too much trouble, though it may require a bit of external SRAM if you want to be able to display full motion in full (well, as full as it gets considering it's a amber display) color.

Also, it's way more powerful than a arduino.

share|improve this answer
No I'm not set on an Arduino :) And I'm not going to display fullmotion video. I want to use the display the same way you would an LCD for systems-info. – Christian Wattengård Aug 29 '10 at 14:28
Well, the propeller has an internal raster character map in ROM for displaying text on screens, so it sounds like exactly what you want, then. – Connor Wolf Aug 30 '10 at 1:34

http://code.google.com/p/arduino-tvout/ is probably what you need. If you are lucky the internal monitor will accept an NTSC signal.

share|improve this answer
Well, maybe... But I really want the 320x200 resolution, and maybe it doesn't... – Christian Wattengård Aug 27 '10 at 11:48
That code generates exactly the frequencies you mentioned which are the same as an NTSC signal. The original CGA has a composite video output and a monitor plug. It's rather likely the internal monitor on these things uses the composite signal according to deduction and cursory inspection of vintage hardware forae. Why would they even bother going to the trouble to send a full color signal to an amber screen? – joeforker Aug 27 '10 at 13:24
An extension of joe's comment would be that it would probably be easiest to get a graphics card that has composite out already, and skip the arduino :( – Kevin Vermeer Aug 29 '10 at 1:59
You are all missing the point... I don't want to get some random monitor to display a composite signal... I want to generate a "native" CGA signal, and use it with a CGA monitor. – Christian Wattengård Aug 29 '10 at 14:26
You think the internal monitor is CGA. I think you are very likely to be wrong. Come back when you get the equipment. – joeforker Aug 29 '10 at 17:37

I've never used CGA but you may be able to adapt one of the (many) Arduino VGA projects to your purpose.

I built a VGA pong game around an ATMega168 which might be a good starting point (links 1 2). I used the AVGA library, which does all of the VGA timing under interrupt so your foreground code only needs to be concerned with moving sprites around.

Another option might be to modify a YBox.

share|improve this answer
Actually it's not VGA at all. VGA is analog component RGB, while CGA is digital TTL RGBI. – Christian Wattengård Aug 27 '10 at 10:23

The IBM Portable PC behaved as though internal monitor was wired to the composite output of a stock CGA card. One of the side-effects of this was that when the mode was set to "color" 80 columns, colors would appear as gray stripe patterns rather than as shades of gray. This in turn would render many foreground-background combinations (e.g. blue on black) almost completely illegible. This was rather irksome given that (1) the internal monitor was monochrome, and thus chroma information would be useless to it; (2) even when using an external composite monitor, the colorburst signal was mistimed in 80-column mode, so one couldn't get color anyway.

Incidentally, the Compaq's internal monitor seems to be unique; it uses the NTSC horizontal scan rate, but the vertical scan can be either 60Hz or 30Hz. I'm not sure why Compaq decided to use non-interlaced 30Hz, rather than jinxing the vertical circuit of the monitor to work nicely with the 6485's not-quite-right interlaced output, but it's the only machine I've ever seen with a 30Hz display scan.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.