Home 
IBM:  MDA / CGA / EGA




Pin Assignment

• Pin assignment within the 9-pin D connector.
• All signals are digital, at TTL levels.
• Warning: Some third party cards and monitors (notably Taxan made ones) use nonstandard sync frequencies.

  MDA CGA EGA    Pin  comments
Pin 1 Ground Ground Ground  
Pin 2 Ground Ground + Secondary Red  IBM EGA Card: See note 1 below
Pin 3   + Red + Red  IBM MDA Card: See note 2 below
Pin 4   + Green + Green  IBM MDA Card: See note 2 below
Pin 5   + Blue + Blue  IBM MDA Card: See note 2 below
Pin 6 + Intensity + Intensity + Secondary Green  IBM EGA Card: Pin 6 becomes 'Intensity' when card configured for IBM 5151 (MDA) or 5153 (CGA)
Pin 7 + Video   + Secondary Blue  IBM EGA Card: Pin 7 becomes 'Video' when card configured for IBM 5151 (MDA)
Pin 8 + Horizontal Sync.
(18.43 kHz)
+ Horizontal Sync.
(15.7 kHz)
+ Horizontal Sync.
(15.7 / 21.85 kHz)
 IBM EGA Card: See note 3 below
Pin 9 - Vertical Sync.
(50 Hz)
+ Vertical Sync.
(60 Hz)
+/- Vertical Sync.
(60 Hz)
 


Note 1 If the IBM EGA card is configured for an IBM 5151 monitor (MDA) or an IBM 5153 monitor (CGA), then ideally, pin 2 should be grounded (to meet the MDA/CGA standard).
Although a jumper (P1) is provided on the IBM EGA card to do just that, I have never found a requirement to use it.
   
Note 2 Normally not connected, but in an early version of the IBM MDA that I have (dated 1982), pins 3/4/5 are connected to chip U64 and consequently are being driven low.
Diagram here
   
Note 3 Mode 1 = 15.7 kHz,  Mode 2 = 21.85 kHz
IBM's EGA monitor, the IBM 5154, automatically switches between Modes 1 and 2 according to the polarity of the incoming vertical sync pulses.
More information about Modes 1 and 2 follows.





Sync Pulses

• As measured on the IBM cards (third party cards can differ).
• Figures are approximate only.
• Like the other types of signals, these are TTL level.

  MDA CGA EGA
Horizontal
Sync
8 µs positive going pulse every 54.3 µs 4 µs positive going pulse every 63.7 µs
  Mode 1:   4.5 µs positive going pulse every 63.7 µs

  Mode 2:   5 µs positive going pulse every 45.8 µs

Vertical
Sync
850 µs negative going pulse every 20 ms 190 µs positive going pulse every 16.7 ms
  Mode 1:   190 µs positive going pulse every 16.7 ms

  Mode 2:   600 µs negative going pulse every 16.7 ms






EGA - Modes 1 and 2

'Mode 1' and 'Mode 2' are terms that IBM uses in the documentation for its EGA monitor, the IBM 5154 (which can also act as a CGA monitor).
These modes must not be confused with what are known as 'video modes'.

In IBM's documentation for the EGA card, Mode 2 is refered to as either "High Resolution" mode or "Hi Res" mode.

The IBM 5154 monitor is a multi-sync monitor, and Mode 1 and Mode 2 are the two modes that it can operate in:
   Mode 1 = LINES: 200, H.SYNC: positive at 15.7 kHz, V.SYNC: positive at 60 Hz
   Mode 2 = LINES: 350, H.SYNC: positive at 21.85 kHz, V.SYNC: negative at 60 Hz

When the IBM 5154 monitor is connected to an IBM EGA card, Mode 2 is the normal mode of operation, however, when software uses the video modes of 04/05/06/0D/0E, the EGA card will switch to Mode 1 operation, which in turn will result in the 5154 monitor switching to Mode 1 operation.
You can see this for yourself:
1. Boot your computer into DOS.
2. Because Mode 2 operation is in effect, you'll find that the 'V.SIZE 2' adjustment on the 5154 monitor rear works, but that the 'V.SIZE 1' adjustment does not.
3. Run CheckIt software (either version 2.1 or 3).
4. Select TESTS then VIDEO then GRAPHICS. A test pattern will show, using video mode 04.
5. Because Mode 1 operation is now in effect, you'll find that the 'V.SIZE 1' adjustment on the 5154 monitor rear works, but that the 'V.SIZE 2' adjustment does not.

There is another situation which causes the IBM 5154 monitor to switch to Mode 1 operation: If you connect an IBM EGA monitor to an IBM CGA card, the monitor will switch into Mode 1 operation (because of the positive vertical sync pulses), and behave just like a CGA monitor. All colours, including the intensified versions, are displayed correctly. I know, because I have tried that with my IBM hardware.