Hitachi HD6845
This page was last modified 23:12, 15 April 2022 by Mars2000you. Based on work by Briqunullus.

Description

The Hitachi HD6845 is a Cathode Ray Tube Controller (CRTC). It's primary function is to generate timing signals which are necessary for raster scan display devices (like televisions and monitors). Unlike the VDP, the 6845 is not an entire display solution on its own. Other circuitry is needed to generate the actual pixels. Because of this, systems using the 6845 vary in resolution and number of colors.

The CRTC started life as the Hitachi HD46505, but gained in popularity when Motorola released it as the MC6845. Shortly after, Hitachi would rename theirs to HD6845. The 6845 has been used on early pc graphic cards as the IBM Monochrome Display Adapter, Hercules and CGA. It can also be found in the Amstrad CPC and the BBC Micro, amongst others.

On MSX and related systems, the 6845 can be found in these devices:

Internals

Responsibilities of the 6845 are:

  • to produce the correct display format
  • calculate addresses of the video data that needs to be displayed
  • positioning the cursor
  • performing interlace
  • monitoring a light pen unit (not used on MSX)

For these tasks, the HD6845 has 18 registers. 12 of these are write only, 4 of these are read and write and 2 are read only. Read and write ability of registers may be different on clone chips. To read or write register values, first the address register needs to be set with the correct register.

Register Read/Write bits Description Unit
R0 Write Horizontal total (-1) Character
R1 Write Horizontal displayed Character
R2 Write Horizontal sync position (-1) Character
R3 Write bit 0-3 Horizontal sync width Character
bit 4-7 Vertical sync time Scan line
R4 Write Vertical total (-1) Character row
R5 Write Vertical total adjust Scan line
R6 Write Vertical displayed Character row
R7 Write Vertical sync position (-1) Character row
R8 Write bit 0-1 Interlace mode
bit 4-5 Display delay
bit 6-7 Cursor delay
R9 Write Maximum raster address Scan line
R10 Write Cursor start raster Scan line
R11 Write Cursor end raster Scan line
R12 Read/Write Start address (H)
R13 Read/Write Start address (L)
R14 Read/Write Cursor position (H)
R15 Read/Write Cursor position (L)
R16 Read Light pen (H)
R17 Read Light pen (L)

Registers with the -1 indicator expect a written value 1 less than the desired value. For example, if when R0 is set to 112, the 6845 will render 113 horizontal characters.

The width of the characters in pixels and the pixel clock are set in the circuitry complementing the 6845. Together with R0 these will determine the horizontal scan line time. For example, 9 pixel characters, a pixel clock of 16 MHz and R0 set to 112 will result in a scan line time of 9 * (1/16) * 113 = 63,5625 us.

The values for R4 and R9 together will determine the number of scanlines. The maximum raster address (R9) is the number of scan lines in a character row minus 1. So the number of scan lines will be R4 * (R9 + 1). If R5 is set, these will be added to the number of scan lines.

Because scan line time and number of scan lines can be set with the registers, the 6845 can dynamically switch between NTSC and PAL.

Links