13

PC display adapters in text mode usually show a blinking cursor on the screen, often in the shape of a bar appearing under the character. Additionally, text may be made to blink by setting an appropriate character attribute bit within video memory. What are the rates at which each blinks on a typical PC graphics adapter?

Since the blinking rate is pretty much a cosmetic characteristic, I expect there might be some variation among the different cards; and yet, I have the gut feeling that much of the time, the same neat fractions of the refresh rate will appear again and again. Is my hunch correct?

For concreteness, an answer covering the original IBM MDA, CGA, EGA and VGA will be sufficient, but I will also welcome some elaboration on how much variation there has been over the years from different manufacturers, even up to modern cards compatible with VGA text mode.

3
  • pcjs.org/blog/2018/03/20 Has some info
    – Jon Custer
    Commented Oct 5, 2023 at 19:29
  • Start for reasearch: The CGA and MDA are based on the Motorola 6845 or one of its clones. Those chip generate the cursor blink period as 16 or 32 frames with a duty cycle of 50%. At 50Hz (MDA), a frame takes 20ms, so the cursor blink period is 320ms (standard) or 640ms (if the chip is reprogrammed); At 60Hz (CGA), the period is 266ms or 533ms. Commented Oct 5, 2023 at 19:30
  • @MichaelKarcher: The CGA card is designed around the assumption that software will configure the 6485's cursor to be on solidly. I forget whether the board uses a divde-by-16 or divide-by-32, and I'd want to know that before writing an answer, but the rate is either frame/16 or frame/32, and I think the same counter is used for the cursor as for blinking, but tapped at different spots.
    – supercat
    Commented Oct 5, 2023 at 19:42

1 Answer 1

17

Yes, your hunch is correct.

MDA, original card from IBM, reverse-engineered from schematics :

The cursor blink signal is not handled by the Motorola 6845 CRTC. It is handled by dividing VSYNC with 74LS393 by 16, so it is on for 8 frames and off for 8 frames. As the original MDA has 16.257 MHz pixel clock, 882 dot clocks per HSYNC, and 370 lines per frame, the VSYNC rate is 49.816 Hz and cursor blinks at 3.114 Hz. Blinking text blinks at the cursor rate divided down by 2.

CGA, original card from IBM, reverse engineered from schematics :

Practically same as MDA but with different vertical rate causing different blink rate. VSYNC is externally divided by 16 with 74LS393 for cursor blink and again by two more for text blink. As the original CGA card runs from motherboard oscillator signal, the pixel clock is 315/22 MHz, and as there are 912 dot clocks per HSYNC, and 262 lines per frame, the VSYNC rate is 59.923 Hz, and cursor blinks at 3.745 Hz. Text blink again with cursor rate divided by 2.

For original IBM EGA and VGA, it is harder to reverse-engineer as the signals are internal to the LSI chipsets. I will double check the hypothesis on a real PS/2.

In general, EGA and VGA should be assumed similar. Cirrus Logic 542X series VGA technical reference says that characters blinks at VSYNC divided by 32, which matches MDA and CGA, so the assumption is cursor blinks again at VSYNC/16 rate.

As VGA text mode uses 28.322 MHz dot clock and 900 dot clocks per HSYNC, and 449 lines per frame, VSYNC rate is 70.087 and cursor should blink at 4.380 Hz.

For EGA, text mode uses 16.257 MHz dot clock and 744 dot clocks per HSYNC, and 364 lines per frame, VSYNC rate is 60.030 Hz, and cursor should blink at 3.752 Hz, almost same rate as on CGA due to almost same refresh rate.

Now, I would have to guess that the blink rates should have relatively straightforward implementation in clones, and any differences are due to using different vertical total lines, horizontal dot clocks per line, or different pixel clock rate. One example is the HGC Hercules Graphics Card. While otherwise the IBM BIOS sets the video text mode identically, it uses a slower 16.000 MHz pixel dot clock.

I managed to verify the VGA results on a genuine IBM PS/2 Model 30-286 and fixed a typo in the values, VGA blinks at 4.380 Hz.

I attached a photosensor to sound card microphone port, aimed it at both blinking white text blocks and blinking white cursor blocks. and recorded the "sound" in Audacity. Ten on/off pulses of blinking text was measured to be approximately 219168 samples at 48000 sampling rate, which equals 2.190 Hz text blink, and ten on/off pulses of blinking cursor was measured to be 109584 samples at 48000 Hz.

From the measurements it can be deducted that 16 text blink periods is approximately 70.08 Hz and 32 cursor blink periods is also approximately 70.08 Hz. By using the measured sample counts to compare with the theoretical VGA VSYNC or pixel clock rates, the measurements are only -26 PPM and +114 PPM in error compared to actual value.

3
  • 4
    Incidentally, some software back in the day would program the 6485 to blink the cursor, but this would sometimes result in a cursor which was on for half the normal time and blinked at the same rate, and sometimes result in a cursor that would be on for a few frames, then off for half the normal off time, then on for a few frames, and then off for the normal off time. Unfortunately, while software could nudge the relative timings of the 6485 and external hardware blinking, it couldn't force them into sync nor judge when they were.
    – supercat
    Commented Oct 5, 2023 at 22:35
  • 28322000 Hz ÷ (16 frames × 449 lines per frame × 900 dots per line) gives me 4.380 Hz, not 4.330. It also seems much faster than the blinking rates I recall having seen on PC compatibles I have used, and can see on a more modern laptop with Intel graphics (on one laptop, I measured the caret blinking period to be ~2.08 Hz with the built-in LCD display, and ~2.34 Hz with an external monitor; I suspect this is 32 frames, but I cannot measure that directly). But, if <youtu.be/RwN1GZvM93M?t=3m> is any indication, it seems to match the original IBM VGA at least. Commented Oct 8, 2023 at 11:25
  • @user3840170 Thanks, I fixed my typo and verified the blink rates on an actual system.
    – Justme
    Commented Oct 8, 2023 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .