Abstract

After experimenting with various 6845 like controllers, CRT monitors and flat screens, it is clear, to show a certain resolution on all those display devices, we are bound to use the exact timing parameters predefined for that resolution.

As a result, is a calculator sheet that takes the standard resolution as input and calculates the resulting parameters for a given clock frequency and outputs the register values for the MC6845.

The MC6845 Calculator

 
pixel clock 36 MHz MHz
columns per character   pixel/character
rows per character   lines/character
character clock   3 MHz
front porch 0.67 µs 2 0.67 µs
sync length 2.00 µs 6 2.00 µs
back porch 3.56 µs 10 3.33 µs
total vsync 6.22 µs 18 6.00 µs
active video 22.22 µs 67 22.33 µs ; 67*8=536 pixels
total line 28.44 µs 85 28.33 µs, 35.29 kHz
visible lines 600 lines 75 75*8=600
vertical front porch 1 lines 1 by experience, the VFP should be minimum 1 line
vertical sync length 2 lines 16 lines 16 is a constant value for most of the MC6845 derivatives
vertical back porch 22 lines 1 lines  
total lines 625 lines 78 characters + 1 lines
VSYNC 35.156 kHz 35.294 kHz
HSYNC 56.25 Hz 56.47 Hz
Registerdechex
R08454Horizontal Total
R16743Horizontal Displayed
R26945Horizontal Sync Position
R3606Horizontal and Vertical Sync Widths
R4774dVertical Total
R5101Vertical Total Adjust
R6754bVertical Displayed
R7764cVertical Sync position
R8000Interlace and Skew
R9707Maximum Raster Address
R10000Cursor Start Raster
R11000Cursor End Raster
R12000Display Start Address (High)
R13000Display Start Address (Low)
R14000Cursor Address (High)
R15000Cursor Address (Low)

History

MC6845 and it derivatives contains a number of counter and compare registers used to generate timings for CRT Monitors.

For the monitor to show a single line, parameters like length of line (total duration) equals horizontal frequency, blank information and sync timings needs to be set.

Some of the CRTs especially multisync monitors can accept a wide range of timings while flatscreen usually accept only signals for predefined resolutions that in addition has to be met within a few percentage range.

With the intent to make a graphics card for a Z80 machine that should show either 256 or 512 lines in vertical resolution, I did various experiments. As there aren't any definition for a 512x512 display, the first approach was to add a few more extra lines to the VGA 640x480 resolution. I found that CRTs can show 512 lines within a given timing for 640x480 as long as certain high level constraints are met: the horizontal frequency should stay above 30kHz and a vertical frequency above 50Hz. While generally, flatscreens may accept that non standard timing with 512 lines, but it will stick to only show 480 lines or show an error message indicating wrong timing.

References: list of VGA timings and Composite Signal