CRTC

From CPCWiki

Jump to: navigation, search
  • This is an article about the "Cathode Ray Tube Controller" hardware unit of the Amstrad CPC. For the cpc scene member see ChaRleyTroniC


The CRTC (Cathode Ray Tube Controller) generates the video signal of the Amstrad CPC.

Contents

Overview

Type 0 - HD6845S/UM6845

Type 1 - UM6845R

Type 2 - MC6845

Type 3 - The ASIC

Type 4 - PreASIC

Programming the CRTC

The 6845 Cathode Ray Tube Controller (CRTC) Introduction The 6845 Cathode Ray Tube Controller (CRTC) is a programmable IC used to generate video displays. This IC is used in a variety of computers including the Amstrad CPC, Amstrad CPC+ and KC Compact.

CRTC in the Amstrad CPC/CPC+ and KC Compact designs The CRTC was a common part available from many different manufacturers. During the life of the CPC, Amstrad sourced the CRTC from various manufacturers.

All ICs used were based on the same design but have a different implementation. As a result they do not operate identically in all situations. This document highlights these differences.

This table lists the known ICs used, with their part number, manufacturer and type number.

Part numberManufacturerType number(note 3)
UM6845UMC0
HD6845SHitachi0
UM6845RUMC1
MC6845Motorola2
AMS40489Amstrad3 (note 1)
???Amstrad?4 (note 2)

NOTES

1. The CRTC functionality is integrated into the CPC+ ASIC. This type exists only in the CPC464+,CPC6128+ and GX4000.

2. As far as I know, this type exists only in "cost-down" CPC6128 systems. In the "cost-down" CPC6128, the CRTC functionality is integrated into a single ASIC IC. This ASIC is often refered to as the "Pre-ASIC" because it preceeded the CPC+ ASIC.

3. In the Amstrad community each 6845 implementation has been assigned a type number. This type identifies a group of implementations which operate in exactly the same way.

As far as I know, the type number system was originally used by demo programmers.

It is possible to detect the 6845 present using software methods, and this is done to:

warn that the software was not designed for the detected 6845 and may function incorrectly, to adapt the software so that it will run with the detected 6845 In most cases, the type of the detected 6845 is reported.


4. As far as I know, the KC compact used HD6845S only.

The 6845 is selected when bit 14 of the I/O port address is set to "0". Bit 1 and 0 of the I/O port address define the function to access. The remaining bits can be any value, but it is adviseable to set these to "1" to avoid conflict with other devices in the system.

The recommended I/O port addressess are

I/O port addressFunctionRead/Write
&BCxxSelect 6845 registerWrite only
&BDxxWrite 6845 register dataWrite only
&BExx(note 1)Read only
&BFxx(note 1)Read only

NOTE

1. The function of these I/O ports is dependant on the CRTC type Signals

The following table defines the generated memory address from the CRTC and Gate-Array signals.

Memory Address SignalSignal sourceSignal name
A156845MA12
A146845MA11
A136845RA2
A126845RA1
A116845RA0
A106845MA9
A96845MA8
A86845MA7
A76845MA6
A66845MA5
A56845MA4
A46845MA3
A36845MA2
A26845MA1
A16845MA0
A0Gate-ArrayCCLK


DISPTMG

DISPTMG signal defines the border. When DISPTMG is "1" the border colour is output to the display.

HSYNC and VSYNC

HSYNC and VSYNC from the CRTC are passed into the Gate-Array. The Gate-Array modifies the signals and then mixes these to form the Composite-Sync which is output to the display The 6845 Design Registers

The Internal registers of the 6845 are

Register IndexRegister Name
0Horizontal Total
1Horizontal Displayed
2Horizontal Sync Position
3Horizontal and Vertical Sync Widths
4Vertical Total
5Vertical Total Adjust
6Vertical Displayed
7Vertical Sync position
8Interlace and Skew
9Maximum Raster Address
10Cursor Start Raster
11Cursor End Raster
12Display Start Address (High)
13Display Start Address (Low)
14Cursor Address (High)
15Cursor Address (High)
16Light Pen Address (High)
17Light Pen Address (High)

CRTC Differences

In this section I will attempt to identify all the differences between each CRTC.

The following tables list the functions that can be accessed for each type:

Type 0

b1b0FunctionRead/Write
00Select internal 6845 registerWrite Only
01Write to selected internal 6845 registerWrite Only
10--
11Read from selected internal 6845 registerRead only

Type 1

b1b0FunctionRead/Write
00Select internal 6845 registerWrite Only
01Write to selected internal 6845 registerWrite Only
10Read Status RegisterRead Only
11Read from selected internal 6845 registerRead only

Type 2

b1b0FunctionRead/Write
00Select internal 6845 registerWrite Only
01Write to selected internal 6845 registerWrite Only
10--
11Read from selected internal 6845 registerRead only

Type 3 and 4

b1b0FunctionRead/Write
00Select internal 6845 registerWrite Only
01Write to selected internal 6845 registerWrite Only
10Read from selected internal 6845 registerRead Only
11Read from selected internal 6845 registerRead only

It is not possible to read from all the internal registers, this table shows the read/write status of each register for each type:

Register IndexRegister NameType
0123
0Horizontal TotalWrite OnlyWrite OnlyWrite Only(note 2)
1Horizontal DisplayedWrite OnlyWrite OnlyWrite Only(note 2)
2Horizontal Sync PositionWrite OnlyWrite OnlyWrite Only(note 2)
3Horizontal and Vertical Sync WidthsWrite OnlyWrite OnlyWrite Only(note 2)
4Vertical TotalWrite OnlyWrite OnlyWrite Only(note 2)
5Vertical Total AdjustWrite OnlyWrite OnlyWrite Only(note 2)
6Vertical DisplayedWrite OnlyWrite OnlyWrite Only(note 2)
7Vertical Sync positionWrite OnlyWrite OnlyWrite Only(note 2)
8Interlace and SkewWrite OnlyWrite OnlyWrite Only(note 2)
9Maximum Raster AddressWrite OnlyWrite OnlyWrite Only(note 2)
10Cursor Start RasterWrite OnlyWrite OnlyWrite Only(note 2)
11Cursor End RasterWrite OnlyWrite OnlyWrite Only(note 2)
12Display Start Address (High)Read/WriteWrite OnlyWrite OnlyRead/Write (note 2)
13Display Start Address (Low)Read/WriteWrite OnlyWrite OnlyRead/Write (note 2)
14Cursor Address (High)Read/WriteRead/WriteRead/WriteRead/Write (note 2) ***check
15Cursor Address (Low)Read/WriteRead/WriteRead/WriteRead/Write (note 2) **check
16Light Pen Address (High)Read OnlyRead OnlyRead OnlyRead Only (note 2) **check
17Light Pen Address (High)Read OnlyRead OnlyRead OnlyRead Only (note 2) **check

Notes

1. On type 0 and 1, if a Write Only register is read from, "0" is returned.

2. See the document "Extra CPC Plus Hardware Information" for more details.

Links

Wikipedia on the CRTC

Personal tools
Multiple Upload
Server space and bandwidth kindly donated by
CMO Internet Dienstleistungen GmbH
Image:Cmologo55x25.gif

CPC-TopSite