• Please review our updated Terms and Rules here

IBM EGA Card Clock

the3dfxdude

Experienced Member
Joined
Jan 11, 2019
Messages
263
Location
US
Hi All,

I bought an IBM EGA card advertised as working, but unfortunately it does not. The screen does not display properly, with the correct DIP switches and EGA monitor. This monitor and computer works correctly on an EGA Genoa card.

I measured the vsync and hsync pins on the db9 and found 26.5 hz for vsync and 9.6 khz for hsync for the IBM card. Compared to the Genoa card, it outputs 59.6 hz and 21.8 khz.

The crystal on the IBM card is outputting a 16.6 MHz. So I narrowed things down. The sequencer chip U33 receives 16.6Mhz on pin 20 CLKIN. The sequencer outputs 8.1Mhz on pin 21 DT and 9.7 khz on pin 6 CCLK. I don't know enough of the Genoa to compare, so can someone to check the for the correct frequencies on a working IBM EGA card? I didn't bother tracing the source for vsync, but I think it's clear there is something wrong with either U33 or U32 the CTRC controller.

Can something be incorrectly causing a clock dividing?
 
Last edited:
Ah thanks for also trying with and without the ROM BIOS. I was wondering if that had a role to play, but since the computer was posting successfully, I thought the ROM was good. I don't know about the IBM PC BIOS, but does it run a checksum on the option ROMs installed?

I could install a CGA card as primary to get a display, and write or run a program that computes a checksum of the EGA BIOS? Can you recommend a utility?
 
Ah thanks for also trying with and without the ROM BIOS. I was wondering if that had a role to play, but since the computer was posting successfully, I thought the ROM was good. I don't know about the IBM PC BIOS, but does it run a checksum on the option ROMs installed?

I could install a CGA card as primary to get a display, and write or run a program that computes a checksum of the EGA BIOS? Can you recommend a utility?
One way to see if the BIOS ROM on the IBM EGA card is being executed at power-on, is to simulate failure of one of the card's RAM chips. You will then hear '1 long beep then 3 short beeps', which the BIOS ROM on the IBM EGA card informing you that its self-test discovered faulty video RAM on itself. The way I simulate failure of one of the card's RAM chips, is to ground one of the chip's data pins.
 
I don't know about the IBM PC BIOS, but does it run a checksum on the option ROMs installed?
The motherboard POST of the IBM PC will not execute the initialisation code in a BIOS expansion ROM unless the ROM's 8-bit checksum is as expected. The checksum is not always for the entire ROM. More information at [here].

I could install a CGA card as primary to get a display, and write or run a program that computes a checksum of the EGA BIOS? Can you recommend a utility?
The BIOS expansion ROM on the IBM EGA card is 16 KB sized and starts at address C0000. Therefore, the following DEBUG code will fetch the ROM's content and create a file from it. You can then use a modern hex editor tool to verify that the first two bytes are 55 and AA, determine the value of the 'ROM size' byte, then verify that the 8-bit checksum (based on the 'ROM size' byte) is 00.

C:\> DEBUG

-N MYC000.BIN (comment: resulting file will be named MYC000.BIN)

-R BX (comment: set BX=0000H/CX=4000H as count of bytes to write, 00004000H = 16K)
BX 0000
:0000
-R CX
CX 0000
:4000

-M C000:0 4000 0100 (comment: copy 16K bytes from C000:0 to offset 0100 in local segment)

-W 0100 (comment: write from offset 0100 in local segment)
Writing 4000 bytes

-Q

C:\>



Of course, with a simple checksum method, a worry is that multiple bits may have flipped in a way that does not affect the checksum. For your comparison purposes, if I use the aforementioned DEBUG code to create a file from the IBM BIOS expansion ROM (the ROM labeled with the IBM part number of 6277356) on my good IBM EGA card, the calculated MD5 of the file is: 528455ED0B701722C166C6536BA4FF46

BTW. Be aware of the following if using an EPROM programmer. Even with a good BIOS ROM chip on an IBM EGA card, if you remove the BIOS ROM then place that in an EPROM programmer (selecting 27128 type), the ROM contents are not as expected; the bytes are in reverse order. It is because on the IBM EGA card, the address lines are inverted before they go to the ROM's IC socket.
 
One way to see if the BIOS ROM on the IBM EGA card is being executed at power-on, is to simulate failure of one of the card's RAM chips. You will then hear '1 long beep then 3 short beeps', which the BIOS ROM on the IBM EGA card informing you that its self-test discovered faulty video RAM on itself. The way I simulate failure of one of the card's RAM chips, is to ground one of the chip's data pins.

Yes. When I short pins 1 & 2 on U2, I can make the POST fail with one long beep and three short.

I went ahead to installing a CGA card as primary display. When I set the EGA card to monochrome, and flipped the switch, POST failed with one long beep and three short. The CGA display does not get initialized. When I remove the CGA card and switch the EGA card back to EGA or CGA, the machine posts, but of course no readable display. I believe the switch block is working correctly.

So I dug out a hercules/mono card and the monitor, and set the EGA as a secondary CGA, and the machine posts, to where I can start using it with the EGA card in there. Something is wrong with the EGA card set as mono.

I'll proceed with examining the ROM tomorrow. Thanks for the instructions.
 
I went ahead to installing a CGA card as primary display. When I set the EGA card to monochrome, and flipped the switch, POST failed with one long beep and three short. The CGA display does not get initialized.
Note that when you 'set the EGA card to monochrome', the IBM EGA card did not become a monochrome card (i.e. from a hardware perspective, not a monochrome card).

Out of curiosity, I replicated what you did on my IBM 5160. Nothing ever on the CGA monitor except for an underline cursor. The 5160 did boot (A: drive stepped, POST issued single beep, hear drive C: being booted from). No '1 long beep then 3 short beeps' though.
 
MD5 of my ROM is the same as yours.

I can read the switch block setting from RAM. I think the ROM will run, but I think the EGA card is not taking all the initialization settings.

Is there an EGA diagnostics program out there? Actually, I am getting the the one long and three short beeps consistently now. So I think I'd like to try a memory test.
 
Note that when you 'set the EGA card to monochrome', the IBM EGA card did not become a monochrome card (i.e. from a hardware perspective, not a monochrome card).

Out of curiosity, I replicated what you did on my IBM 5160. Nothing ever on the CGA monitor except for an underline cursor. The 5160 did boot (A: drive stepped, POST issued single beep, hear drive C: being booted from). No '1 long beep then 3 short beeps' though.

Then how can an EGA co-exist with CGA? The manual does say to always set SW1 5=ON 6=ON when the EGA is installed, even as secondary. I think the EGA ROM is supposed to initialize the primary card.
 
Then how can an EGA co-exist with CGA?
When I am answering posts, I am never sure what knowledge a poster has on the subject matter, and so I look for clues in what is written. For example, when someone writes, "When I set the EGA card to monochrome", then with nothing else to clue me in, I think, maybe the author thinks that the card becomes a monochrome card and is treated accordingly. If instead, "When I set the EGA card up for a monochrome monitor" was written, then I would think to myself that the author is aware of the distinction.

My understanding is that what changes are:

* Pin functionality on the 9-pin D connector
* BIOS functionality

Additional, in IBM's technical document is, "The address of the display buffer can be changed to remain compatible with other video cards and application software."

But from what I read, the EGA card does not change itself to be register-level compatible with MDA or CGA. That is going to 'break' some software.

The manual does say to always set SW1 5=ON 6=ON when the EGA is installed, even as secondary. I think the EGA ROM is supposed to initialize the primary card.
Now I can see that you have been reading the manual. You didn't mention before that switches 5 and 6 were still on; "I went ahead to installing a CGA card as primary display." can imply to some that switches 5 and 6 were set to CGA. Misunderstanding can be a consequence of brevity.
 
I can only run the EGA diagnostics telling the program that I do not have both monitors hooked up. Otherwise it will try to prompt for things on the EGA screen I cannot see.

When I run only from the monochrome display, I got this message:

ERROR -
ENHANCED GRAPHICS ADAPTER 2401 S
0 - DISPLAY ADAPTER AND MEMORY TEST
FAILING GRAPHICS MEMORY 000052

I don't understand this code. It would be nice to know if some level of writing/reading is working on the DRAM. But I am not sure on the DRAM timings being correct right now anyway. All seems to be pointing back to the sequencer. It is either bad or it is not being initialized correctly. One item that I forgot to mention, I found that the clocking mode register bit 3 controls a clock divide mode.

I think I might try writing to a0000 or b8000 in debug.
 
So question on the EGA card. With it in the machine does it boot you to DOS? Is the display issue only when you start a program in EGA mode?
 
Yes. The machine will boot to DOS. The POST failure is in the tests performed by the EGA ROM. The machine proceeds and I can use the machine with a second display card, and right now I am using it through a serial terminal to be sure what I am seeing from the EGA card. (other video card removed)

The EGA card's sequencer will be in a reset mode until programmed with the correct registers. The ROM will do this. Without the ROM, I can program EGA's mode 2 and CGA's mode 0 for comparison now. I can reproduce my original clock numbers in the mode 2. I picked trying CGA mode 0 (40 column) because this low res mode should match the timing numbers as if the clock divider is selected, and it does. But there is still issues with timing somewhere, including the DRAM. Also, while the dot clock is the correct frequency (7 MHz), VSYNC is oddly less than 60 hertz.

One thing I would like to know on a working card is what the approximate clocking frequency coming in on pin 7 of the sequencer (SYNC) in the normal EGA configuration? It looks identical to HSYNC.

Also, I checked IOW signal to the sequencer and CTRC, and looks fine. All the address, data, and external register ics seem to be fine.
 
This is my final collection of data. I suspect CCLK is out of spec due to something faulty with the sequencer.

ModeHSYNCSYNCVSYNCDTCCLK
At Boot No RomNone397khzNone7.1mhz795khz
CGA Mode 013.9khz13.9khz53hz7.1mhz795khz
EGA Mode 016.9khz16.9khz46hz7.1mhz795khz
EGA Mode 29.7khz9.7kz26hz8.1mhz903khz

Note: SYNC is an inverted form of HSYNC on my scope.
 
Back
Top