Contents Index Section 2

AMSTRAD PC1640 TECHNICAL MANUAL

1.0 Introduction

This manual provides a comprehensive description of the AMSTRAD PC1640 hardware and firmware. General information about the PC1640, GEM Desktop and the delivered operating system software is contained in the AMSTRAD PC1640 USER GUIDE. This manual is intended to satisfy the needs of advanced developers who must have access to the various resources available within the PC1640.

Note that all address constants in this document are hexadecimal. In addition hexadecimal quantities are noted with small letter 'h' terminator to denote that they are in hexadecimal form. Address quantities are not usually annotated this way since they are clearly hexadecimal. Values are presented in hexadecimal form when they are logically bit oriented quantities rather than of purely numerical significance.

1.1 Central Processing Unit (CPU)

The CPU is an 8086-2 microprocessor with 1 Megabyte memory addressing capability (See Figure 1), running at a clock frequency of 8MHz. The CPU is connected to an on-board 16-bit system memory bus requiring four 125nS timing cycles (T-States) per access resulting in a 500nS memory cycle for 16-bit memory. The CPU is also connected on an on-board 8 bit I/O and memory peripheral bus with a 4 MHz clock, which in turn connects to an external expansion bus. Operations on the 8-bit bus automatically incur 125nS wait states as follows:

OperationWait StatesBus Cycle
8-bit (Memory) 4 1.0 uS
16 to 8-bit convert (Memory)122.0 uS
8-bit (I/O) 6 1.25 uS
16 to 8-bit convert (I/O) 16 2.5 uS

The CPU is configured to run in maximum mode and the instruction set may be optionally extended by the addition of an 8087-2 Numeric Data Coprocessor. The 8087 BUSY output is connected directly to the 8086 NOT TEST input.

1.2 MEMORY LAYOUT

The main board memory consists of 640K bytes of system RAM with parity checking and 16K bytes of system ROM without parity checking.

The 640K byte user RAM starts at CPU memory address 00000 and extends to 9FFFF.

The 128K byte address space from A0000 to BFFFF is reserved for video regeneration buffers, and is not used by CPU programs. The PC1640 Internal Graphics Adapter (IGA) uses the full 128K byte range or segments of this memory range depending on the display mode (see section 2, Video I/O Int 16). External display adapters also use this memory address range for their display buffers.

00000   ON-BOARD
DYNAMIC RAM
640K BYTE
SYSTEM
MEMORY
RANGE
    9FFFF
A0000 128K BYTES
VIDEO DISPLAY BUFFERS
 
BFFFF
1M BYTE
ADDR
RANGE
C0000 192K BYTES
EXPANSION ROMS
C8000 - C9FFF : HD ROM
C0000 - C7FFF : IGA ROM
EFFFF
    F0000 48K BYTES
ROS ROM BLOCK REPEATS
64K BYTE
SYSTEM
ROM AREA
FBFFF
FC000 16K BYTES (ROS)
RESIDENT OPERATING SYSTEM ROM
FFFFF  

The 192K byte address space from C0000 to EFFFF is reserved for external expansion ROM address space. When the Internal Graphics Adapter is enabled, it uses the space from C0000 to C1FFF for its bios (executable) code and the area from C2000 to C7FFF for its fonts. The optional Hard Disk controller uses the range from C8000 to C9FFF. Additional hard disk controllers may also use the area from CA000 to CD000. The PC1640 test board uses the ROM area from E0000 to E7FFF.

The 16K byte system ROM is at FC000 to FFFFF and contains the Resident Operating System (ROS) firmware. The 48K byte address range from F0000 to FBFFF is reserved for ROM space expansion. The 16K byte ROS area address bits are partially decoded such that the ROS ROM repeats four times in the F0000 to FFFFF address range.

[Figure 1.2]

1.3 MAIN BOARD I/O CHANNELS

The interfaces on the main board occupy the 8086 I/O addresses as follows:

ADDRESS(hex)OUTPUT USEINPUT USE
000 - 00F8237 DMA Controller8237 DMA Controller
010 - 01FDo Not UseDo Not Use
020 - 0218259 Interrupt control8259 Interrupt control
022 - 03FDo Not UseDo Not Use
040 - 0428253 PIT Load Count (0-2)8253 PIT Read Count (0-2)
043 8253 PIT Load ModeUndefined
044 - 05FDo Not UseDo Not Use
060 No EffectPort A - Keyboard Code or System Status 1
061 Port B - System ControlPort B - (Readback)
062 No EffectPort C - System Status-2
063 No EffectDo Not Use
064 Write System Status-1Do Not Use
065 Write System Status-2Do Not Use
066 System ResetDo Not Use
067 - 06FDo Not UseDo Not Use
070146818 RTC AddressDo Not Use
071146818 RTC Data146818 RTC Data
072 - 077Do Not UseDo Not Use
078Clear Mouse X-CoordinateMouse X-Coordinate
079Do Not UseDo Not Use
07AClear Mouse X-CoordinateMouse X-Coordinate
07B - 07FDo Not UseDo Not Use
080Do Not UseDo Not Use
081DMA Page Register Ch 2Do Not Use
082DMA Page Register Ch 3Do Not Use
083DMA Page Register Ch 0,1Do Not Use
084 - 09FDo Not UseDo Not Use
0A0NMI Mask ControlDo Not Use
0A1 - 0BFDo Not UseDo Not Use
0C0 - 0FFReservedReserved
378Printer Data LatchPrinter Data Latch
379Do Not UsePrinter Status
37APrinter Control LatchPrinter Control Latch
37B - 37FDo Not UseDo Not Use
3B0 - 3BFMono Mode CRTC Registers Mono Mode CRTC Registers
3C0 - 3CFVideo Controller Registers Video Controller Registers
3D0 - 3DFColor Mode CRTC Registers Color Mode CRTC Registers
3F0 - 3F1Do Not UseDo Not Use
3F2Drive SelectionDo Not Use
3F3Do Not UseDo Not Use
3F4Do Not Use765 FDC Status
3F5765 FDC Data765 FDC Data
3F6 - 3F7Do Not UseDo Not Use
3F8 - 3FF8250 UART Tx Data/Control 8250 UART Rx Data/Control

1.4 EXPANSION BUS I/O CHANNELS

The 8086 CPU I/O addresses on the expansion bus are as follows:

ADDRESS(hex)USE
200 - 20FExternal Game Control Interface
210 - 217External Bus Expansion Unit
220 - 24FReserved
278 - 27FExternal Printer Port
2F0 - 2F7Reserved
2F8 - 2FFExternal Asynchronous Serial RS232C Port
300 - 31FExternal Prototyping Card
320 - 32FExternal Hard Disk Controller
380 - 38FExternal SDLC Serial RS232C Port
3A0 - 3AFReserved
3B0 - 3BBExternal Monochrome VDU Controller
3BC - 3BFPrinter Port
3C0 - 3CFExternal Graphics Controller
3D0 - 3DFExternal Color/Graphics Controller

I/O address above 03FFh, if accessed, wrap around and are mapped onto the range 0000h-03FFh.

External cluster controllers at 0790h-0793h, 0B90h-0B93h, 1390h-1393h and 2390h-2393h wrap around to I/O addresses 0390h-0393h respectively.

1.5 Direct Memory Access (DMA)

The Amstrad PC 1640 supports four DMA channels on the system board, using an 8237-4 DMA controller and programmable page registers to extend its addressing range from 64k bytes to the full 1M byte processor address range. Each channel is able to transfer data in blocks of up to a maximum of 64K bytes within a page. The DMA channels are for 8-bit data transfers between (8-bit) I/O devices and 8-bit or 16-bit memory.

In peripheral (slave) mode, CPU I/O address lines A0 - A3 are connected conventionally so that 16 command codes appear in the order described in the 8237 data sheets (See section 3.5).

The DMA controller CLK is driven at 4MHz (+/- 0.1%). In master mode during DMA transfers on channels 1,2 and 3, one wait state is added resulting in a five-clock DMA bus cycle of 1.25uS. Channel 0 transfers have a four-clock bus cycle of 1uS.

The DMA channel request signals are as follows:

DMA ChannelUSE
08253 Timer/Counter OUT1 output - for memory refresh.
1Spare for use by expansion bus. Used by external SDLC Serial Port.
2765 Floppy Disk Controller DRQ output. Available on the expansion bus.
3Spare for use by expansion bus. Used by external Hard Disk Controller.

1.5.1 DMA Page Registers

DMA channels 1, 2 and 3 can address the entire 1M byte addressing range of the CPU through the use of their associated DMA page registers. There are three DMA registers, one each for channels 1 through 3. Each page register defines for its channel which one of sixteen 64K byte pages in the 1M byte address range DMA transfers are to occur. The page registers are static so that modulo 64K byte addressing occurs at page boundaries.

The DMA page register bit assignments are as follows:

BitOutput Use
7-4Not Connected
3Address bit A19
2Address bit A18
1Address bit A17
0Address bit A16

1.5.2 DMA Initialisation

Following a reset, system (ROS) initialisation firmware (in the ROS) sets up the 8237 DMA controller for channel 0 (dynamic refresh) operation as follows:

FunctionInitialised State
Word Count64K Transfers
Mode
Register
Read
Autoinitialise
Increment
Single Mode
Command
Register
Disable Memory to Memory
Enable Controller
Normal Timing
Fixed Priority
Late Write
DREQ Active High
DACK Active Low
Mask
Register
Clear Channel 0 Mask Bit

After power-up or system reset the DMA page registers are undefined and are initialised to zero by the ROS firmware and all 8237 internal locations for channels 1-3 are initialised to a state comparable to the channel zero initialisation above.

Following industry compatibility, memory to memory DMA is not supported on the PC1640. It is prohibited due to timing considerations.

1.6 System Interrupts

Nine levels of hardware interrupt are provided for in the system by the CPU Non Maskable Interrupt (NMI) and by an 8259A-2 Interrupt Controller. All levels including NMI, are maskable under software control.

CPU I/O address line A0 is connected conventionally so that the command codes appear in the order described in the 8259 data sheets. The SP/EN pin is tied high signifying that the device is to be hardware un-buffered and designated as a master, not a slave.

1.6.1 Interrupt Levels

The interrupt levels are assigned as follows:

LevelAssigned Function
NMIMemory Parity Error and 8087 NDP INT output.
08253 Timer/Counter Out0 output.
1Keyboard Scan Code Receiver.
2146818 Real Time Clock IRQ output.
Available on the expansion bus.
3Spare for use by expansion bus.
Used by external (secondary) Asynchronous Serial Port
and external SDLC Serial Port.
48250 UART INTRPT output. Available on the expansion bus.
Used by external SDLC Serial Port.
5Hard Disk Controller. Available on the expansion bus.
6765 Floppy Disk Controller INT output.
Available on the expansion bus.
7Parallel Printer Port.
Available on the expansion bus.
Used by external Printer Port (secondary) and Printer Port (ternary) on external Monochrome VDU Controller.

The system (ROS) firmware initialises the 8259 address bits such that IRQ0 through IRQ7 appear in the CPU interrupt vector space at interrupts 8 through 15 repectively. NMI appears at CPU interrupt vector 2.

1.6.2 Interrupt Controller Initialisation

Following a reset, the initialisation firmware in the ROS sets the 8259 Interrupt Controller to operate as follows:

8086 system, Single (not cascaded),
Normal fully nested (not special),
Edge-triggered,
Buffered mode - slave,
Normal EOI (not auto),
Fixed priority - level 0 highest, level 7 lowest.

The system (ROS) firmware initialises the 8259 address bits such that IRQ0 through IRQ7 appear in the CPU interrupt vector space at interrupts 8 through 15 respectrively. NMI is configured to CPU interrupt vector 2.

1.6.3 NMI Mask Control

The NMI Mask Control is a write only register at I/O address 0A0h and allows the CPU non-maskable interrupt (NMI) input to be enabled or disabled by software. The Bit assignments are as follows:

BitOutput Use
7Enable NMI.
6 - 0Not Connected

Following a reset NMI is disabled.

NMI can be connected to the 8087 NDP, the on-board memory parity check circuit, and the expansion bus I/OCHCK (I/O Channel Check).

1.7 Programmable Interval Timers

Three programmable timer/counters are provided at I/O Addresses 040 - 043 by an 8253 Programmable Interval Timer (PIT) device. They are defined as follows:

CounterUse
0General Purpose Timer.
1Used by DMA channel 0 (for dynamic ram refresh).
2Tone Generation for Speaker.

1.7.1 Timer Configuration

The 8253 timers are configured as follows:

FunctionConfiguration
CLK 0,1,21.193 MHz +/- 0.1% (54.925493 ms per count)
GATE 0,1Always 'ON'.
GATE 2Controlled via Port B (System Control Channel) Speaker Modulate output.
OUT 0Interrupts on 8259 PIC IR0 input.
OUT 1Requests on 8237 DMA DREQ0 input.
OUT 2Logical 'AND' with Port B (System Control Channel) Speaker Drive output. Also goes to Port C (System Status-2 Channel) as an input.

1.7.2 Counter 1 initialisation

Following a reset, the system initialisation firmware in the ROS programs the 8253 PIT for counter 1 (dynamic ram refresh) operation as a rate generator producing a signal with a period of 15.13 uS. There are no restrictions requiring the initialisation and programming of counters 0 and 2.

1.8 System Status and Control

Two system status input channels and four output channels are provided on-board. Ports A, B and C emulate a pre-programmed 8255 PPI device. They are located in the I/O address space in the range 060h - 06Fh. Port B is programmed for control output, Port A is programmed either for Status-1 input or for receiving data from the keyboard, and Port C is programmed for Status-2 input.

Ports A, B and C emulate an 8255 PPI that has been set up as follows:

Group A Mode 0,Group B Mode 0,
Port A = input,Port B = output,
Port C(U) = input.Port C(L) = input.

Unlike an 8255, power-up and reset do not affect this configuration.

1.8.1 Port B - System Control

The System Control channel is located at I/O Address 061h. Its bit assignment is as follows:

Bit (PBn)Output Use
7Enable Status-1/Disable Keyboard Code on Port A.
6Enable incoming Keyboard Clock.
5Prevent external parity errors from causing NMI.
(Also Disable any pending NMI).
4Disable parity checking of on-board system Ram.
3Undefined (Not Connected).
2Enable Port C LSB / Disable MSB. (See 1.8.3)
1Speaker Drive.
08253 GATE 2 (Speaker Modulate).

When bit 7 is set high, Status-1 data is enabled on Port A, the keyboard data path and keyboard interrupts are disabled. When bit 7 is set low, keyboard input data is enabled on port A, the keyboard data path and keyboard interrupts are enabled. Applications software which sets PB7 must restore it to the cleared state else the keyboard may be rendered inoperable.

The keyboard interface operates as follows: Each incoming keycode is latched on-board, causing a keyboard interrupt (on level 1). While the interrupt remains pending, the incoming keyboard data signal is forced low as an acknowledgement to the keyboard that the keycode has been received. As soon as the interrupt has been cleared, the keyboard may use the Data signal to transmit the next keycode.

PB5 when set prevents an external parity error (ie. an I/OCHCK condition on the expansion bus) from causing NMI, even if NMI is unmasked. When NMI has been triggered and latched it may be cleared by pulsing PB5 (if the external device has removed its I/OCHCK signal).

PB2 when set enables the reading of the four LS bits of the RAM fitted indicator on Port C. When PB2 is clear the top (MS) bit of the RAM fitted indicator is read (see 1.8.3).

PB1 may be toggled to drive the speaker with a corresponding pulse train. The speaker may also be driven by a wave form from the 8253 PIT OUT2 output (simultaneously with PB1).

PB0 may be toggled to drive the 8253 gate input, hence modulate counter 2operations and therefore driving the speaker which may all be performed simultaneously to create various audio effects.

1.8.2 Port A - Status-1 Input/Keyboard Code

Port A is a read only location located at I/O Address 060h. The bit assignments for Port A are as follows:

Bit (PAn)Status-1Keyboard Input
7Always 0. KBD7
6Second Floppy disk drive installed.KBD6
5DDM1 - Default Display Mode bit 1.KBD5
4DDM0 - Default Display Mode bit 0.KBD4
3Always 1.KBD3
2Always 1.KBD2
18087 NDP installed.KBD1
0Always 1. KBD0

When Port B, Bit 7 (PB7) is set to high, reading Port A loads Status-1. When PB7 is set low, reading Port A loads keyboard data.

The Default Display Mode bits (DDM1, DDM0) are set up by the ROS during system initialisation as follows:

DDM1DDM0Default Display Mode Selected
00Internal Graphics Adapter (IGA) Enabled
or Extended Adapter Installed in Expansion Bus.
01Colour Graphics Adapter Installed in the Expansion Bus
with alpha, 40 X 25 chars, bright white on black.
10Colour Graphics Adapter Installed in the Expansion Bus
with alpha, 80 X 25 chars, bright white on black.
11External Monochrome Controller, 80 X 25 chars.

When the Internal Graphics Adapter (IGA) is enabled then switches 1 - 5 determine what the default display mode is and whether the IGA is the primary or the secondary adapter. See section 1.22 for these details.

When the Internal Graphics Adapter (IGA) is disabled then the ROS uses the position of display selector switches SW6, SW7 and SW10 to determine the default display mode.

When an EGA or another adapter is installed then its particular User's/Hardware manual is the best guide to its display modes or other features.

Following a reset, the ROS then sets the initial video state is based on the DDM value. Section 2.3.7 gives additional details of the ROS Video Mode settings.

1.8.3 Port C - Status-2 Input

Port C is a read only location located at I/O Address 062h. Its bit assignments are as follows:

Bit (PCn)Input Use
7On-board system RAM parity error.
6External parity error (I/OCHCK from expansion bus).
58253 PIT OUT2 output.
4 Undefined.
  LSB or MSB (depends on PB2)
3RAM3Undefined
2RAM2Undefined
1RAM1Undefined
0RAM0RAM4

PC7 is forced to the zero state when on-board system RAM parity checking is disabled by PB4.

When the I/OCHCK condition (external parity error) from the expansion bus is disabled from causing NMI (by PB5 set high), PC6 reflects the state of the I/OCHCK input else it reflects the latched state of I/OCHCK.

The value of RAM4-RAM0 denotes the amount of system RAM fitted to the system as follows:

RAM4 RAM3 RAM2 RAM1 RAM0  
01110512K bytes.
01111544K bytes.
10000576K bytes.
10001608K bytes.
1001 0640K bytes.

Since the PC1640 comes with 640K of RAM fitted the expected value should always be 640K bytes. Any other value indicates an installed memory configuration error.

See section 1.8.1 for the Control Port B setting for reading RAM fitted segment bits.

1.8.4 Write System Status-1

The Write System Status-1 register (WSS1) is a write only register at I/O Address 064h and is initialised by the Resident Operating System (ROS) firmware based on values obtained from configuration switches 4 and 5. It is used in conjunction with the 8255 PPI Port A emulation. The bit assignments are as follows:

BitOutput Use
7No effect.
6PA6 - Second Floppy disk drive installed.
5PA5 - DDM1.
4PA4 - DDM0.
3No effect.
2No effect.
1PA1 - 8087 NDP installed.
0No effect.

1.8.5 Write System Status-2

The Write System Status-2 register is a write only register at I/O Address 065h and is initialised by the Resident Operating System (ROS) firmware based on the memory size check perfomed during Power On Self Test. It is used in conjunction with the 8255 PPI Port C emulation. The bit assignments are as follows:

BitOutput Use
7PC2 (MSB) - Undefined.
6PC1 (MSB) - Undefined.
5PC0 (MSB) - Undefined.
4PC3 (MSB) - RAM4.
3PC3 (LSB) - RAM3.
2PC2 (LSB) - RAM2.
1PC1 (LSB) - RAM1.
0PC0 (LSB) - RAM0.

Since the PC1640 comes with 640K on the main board the expected value of PC3 - PC0 is binary 10010.

1.8.6 System Reset

Any write access to I/O Address 066h regardless of the value written will cause the hardware to generate an immediate 512uS system reset and pulse the reset line on the expansion bus. The contents of the on-board system RAM is preserved following a system reset.

1.9 Real Time Clock

A HD146818 Real Time Clock plus RAM device is installed and backed up by a set of four non-rechargable size AA batteries. The clock device provides a time of day clock with alarm, a one hundred year calendar, a programmable periodic interrupt, and 50 bytes of static RAM. The static RAM is called the Non-Volatile RAM (NVR) and used to store system configuration data such as number of disk drives, memory size, serial I/O parameters, and default VDU screen mode. The ROS firmware maintains a checksum of the NVR and will reset the configuration data to 1sensible values1 during startup whenever the checksum value is incorrect (thus destroying your actual configuration). Even though direct hardware access to the NVR is possible it is recommended that the programs make use of the ROS Enhanced Function Interrupt (Interrupt 21) to access the NVR because these properly maintain the NVR checksum value.

When system power is off and the 146818 is on battery backup power, the functions which remain active are the clock and the retention of RAM data. No battery power is used while the system power is on.

The input crystal oscillator runs at 32.768 KHz and the 146818 interrupt request is connected to the 8259 system interrupt controller on level 2 (which is also available on the expansion bus). The 146818 power-sense input PS is connected to a battery condition sensor. When the backup battery voltage is sufficiently low, the VRT bit in register D becomes set indicating that the time, the calendar and the NVR data are no longer valid. When this condition is noted during startup, the firmware outputs the message "Please fit new batteries" and resets the NVR to default values (See section 2.4).

All the features described in the 146818 data sheet are available with the exceptions that the CKOUT (clock output) and SQW (square wave output) pins are not connected on the main board.

Writing or reading the NVR involves a two step sequence for each byte that is accessed. The RTC Address channel (I/O Address 070) is first loaded with the NVR location to be accessed. Then the RTC Data channel (I/O Address 071) is either written or read to complete the I/O operation. This facility should be used with caution in order to avoid disturbing the system configuration data.

1.10 Parallel Printer Port

The printer port provides an interface for driving 8-bit and 7-bit Centronics compatible printers. The timing of the signals to the printer is under direct software control. There is a read/write control latch for sending control signals to the printer, an unlatched read-only printer status channel, and a read/write data latch for sending printer data.

In addition the printer control latch can be read to obtain system type and switch information.

1.10.1 Printer Data Latch

The printer data latch is a read/write record at I/O address 378 and its layout is as follows:

Bit (Dn)Output/Input UseCable Polarity
7Data 7Hi
6Data 6Hi
5Data 5Hi
4Data 4Hi
3Data 3Hi
2Data 2Hi
1Data 1Hi
0Data 0Hi

The contents of the data latch are undefined following a power-up or system reset.

1.10.2 Printer Control Latch

The printer control latch is a read/write record at I/O address 37A and its layout is as follows:

BitOutput/Input UseReset StateCable Polarity
7PC1640 SW7 [RO]
6PC1640 SW6 [RO]
5OPT (1640)/1 (1512) [RO]
4Enable Int on ACKFalse
3Select PrinterFalseLow
2Not Reset PrinterTrueLow
1Select Auto FeedFalseLow
0Data StrobeFalseLow

Bit D7 is a read-only bit which reflects the state of switch 7 (at the back of the machine) and returns a logic "1" when the switch is in the "on" position and a logic "0" if in the the "off" position.

Bit D6 is a read-only bit which reflects the state of switch 6 (at the back of the machine) and returns a logic "1" when the switch is in the "on" position and a logic "0" if in the the "off" position.

Bit D5 is the option (OPT) bit and can return one of three different pieces of information. Although not documented as such on the PC1512, Bit D5 was always a "1", however on the PC1640 it will always be a zero if immediately prior to the read of channel 037Ah the software performs an I/O read of an I/O channel implemented on the PC1512 main board, having address line A7 high (for example, the CGA channels). This is a simple test for software to detect whether it is running on a PC1512 or a PC1640. A PC1512 will give a 1, whereas a PC1640 will give a 0.

In addition to being a test of machine type the OPT bit, D5, can also reflect the state of either SW9 or SW10. The OPT bit will reflect the state of switch SW9 by an I/O read operation to an I/O channel not implemented on the main board and having address lines A14 and A7 both low (for example channel 0278h) immediately prior to the reading of channel 037Ah. The OPT bit is set to the state of switch SW10 by an I/O read operation to an I/O channel not implemented on the main board having address lines A14 high and A7 low (for example channel 4278h). Software testing OPT bit should disable interrupts before the initial (dummy) channel read and the I/O read of channel 037A in order to avoid additional (interrupt based) I/O operations between the setting and the testing of the information read back in the OPT bit. For switches SW9 and SW10, a logic "1" is returned when the switch is on the "on" position and a logic "0" if the switch is in the "off" position.

When Interrupt on ACK is enabled an incoming Printer Acknowledge condition will cause a system interrupt on level 7 (which is also available on the expansion bus).

If the printer control lines normally driven via latched bits D0 - D3 are driven externally, the data read on input to this channel will be the logical OR of the latched bits and the externally driven bits, e.g. If a data bit is false and the corresponding cable bit is driven true by the external driver, the bit input will be true.

Following power-up or system reset, the control latch contents assume reset conditions as shown.

Note that this is a general purpose printer interface and that not all printers require all the control signals, hence the provision for non-standard printers to be able to drive some of the control signals as inputs to the main board. The timing requirements on Centronics compatible printers generally specify that data must be present at 1uS before the strobe is made active, and must remain valid for at least 1uS after strobe goes inactive. The strobe duration must be between 1uS and 500 uS. Printer Busy status can be inspected as soon as the strobe is inactive in order to determine when more data can be sent.

1.10.3 Printer Status Channel

The Printer Status Channel is a read only register at I/O Address 0379h. Its layout is as follows:

BitInput UseCable Polarity
7-Printer BusyHigh
6-Printer AcknowledgeLow
5Paper OutHigh
4Printer SelectedHigh
3-Printer ErrorLow
2-LK3 fitted 
1-LK2 fitted 
0-LK1 fitted 

LK1 - LK3 are general purpose factory installed option links on the main board which are used by the system ROM Operating System (ROS) firmware to distinguish national variant machine configurations. The ROS will produce its sign-on message and error messages in one of seven languages. The first seven states (0 - 6) are used for language variants and the eighth (7) state is used extended diagnostic mode testing (See section section 2.2). Since the link state is inverted, the value obtained from the lower three bits of the printer port must be exclusive or'ed (XOR) with 1's to obtain the language number.

LK1LK2LK3ROS Language
OFFOFFOFFEnglish.
OFFOFF ONGerman.
OFF ONOFFFrench.
OFF ON ONSpanish.
ONOFFOFFDanish.
ONOFF ONSwedish.
ON ONOFFItalian.
ON ON ON Diagnostic Mode. (English)

Note that this is a general purpose printer interface and that not all printers implement all the status lines, nor do they all attach the same meanings to the error conditions.

Printer Busy normally indicates that a printer cannot receive data, for example during data entry, printing, when offline, or during a printer error condition.

Printer Acknowledge, if implemented is generally asserted by a printer to indicate that data has been received and the printer is ready to receive the next data. Note that Printer Acknowledge (ACK) can also be set to cause interrupts (See 1.10.3).

Section 1.14 contains the printer connector pin assignments.

1.11 The Internal Graphics Adapter.

The Internal Graphics Adapter (IGA) is a gate array on the main board which provides either an Extended Graphics Adapter (EGA) mode, or a Color Graphics Adapter (CGA) mode or a Monochrome Display Adapter (MDA) mode. Additional Hercules monochrome adapter modes and Plantronics (Color) adapter functions are also supported.

The video screen memory (or regeneration buffer) is the 128K byte range from A0000 to BFFFF and its configuration varies depending on the selected display mode. The regeneration buffer origin (ie the starting address) may be configured to either A0000, B0000 or B8000 with sizes varying from 2K bytes to 32K bytes. (See 1.11.2.5).

When an Extended Color (PC-ECD) Display is fitted the IGA is capable of displaying up to 64 different colors in EGA mode with a resolution of 640 dots x 350 lines. The CGA and Plantronics display modes supports 16 colors (for Extended Color Displays and standard Color Displays) with a resolution of up to 640 dots by 200 lines.

For the PC-MD monochrome display, the IGA supports black and white text in normal, intense, blink, or underline with a resolution of 720 by 350 in text modes. The maximum monochrome Graphics resolution is 640 x 350 or 720 x 348 resolution graphics for Hercules compatible monochrome.

For color systems, when an initial mode change is set up via the ROM BIOS, a set of sixteen color palette registers are loaded with standard values such that a standard IRGB color selection is available for sixteen total colors available on the display. The color attribute fields (discussed later) and the color plane selections relate to the standard sixteen color palette format as follows:

IntensityRedGreenBlue Colour
0000Black
0001Blue
0010Green
0011Cyan
0100Red
0101Magenta
0110Brown
0111White
1000Grey
1001Light Blue
1010Light Green
1011Light Cyan
1100Light Red
1101Light Magenta
1110Yellow
111 1Intense White

Note that the Extended color display (PC-ECD) supports 64 colors using a 6-wire rgbRGB color scheme (where the capital letters represent 2/3 intensity primary color signals and the small letters represent 1/3 intensity secondary color signals). Since each of the sixteen palette registers is a 6-bit register with the bits representing rgbRGB (MSB through LSB respectively) only 16 of 64 colors can be displayed on the screen at any one time.

1.11.1.1 Color Alpha Display

In Color mode, two Alpha modes are available: either (medium resolution) 40 characters by 25 rows or (high resolution) 80 characters by 25 rows. The display RAM requirement is 2K bytes and 4K bytes of display RAM for 40 and 80 column modes respectively. The display regeneration buffer is from B8000h to BBFFFh for these modes and the display ROM bios supports up to 8 or 4 separate display pages for 40 and 80 column modes respectively.

The character set is formed by a RAM loadable character generator and for 200 line resolution systems, each of the 256 characters is made up of a 8 by 8 pixel matrix.

When an Extended Color Display (PC-ECD) is being used in full 350 line resolution, the 40 and 80 column text modes are still supported but the character generator is programmed differently and a 8 by 14 pixel matrix is used. The display RAM mapping and regen buffer origin and size requirements are exactly the same as the 200 line display modes.

The starting address in the display RAM is programmed via the CRT (Cathode Ray Tube) Controller (CRTC). The starting address is on an even address boundary and it addresses the first (leftmost) character position in the top row of the display. The CRTC starting address register is a 16-bit register and it specifies the offset in two byte pairs from the display mode origin. This means for each change of one in the CRTC starting address register, the next even address is selected in the display RAM as the current regeneration buffer origin.

In order to display a single character, two bytes of display RAM are required, and for each pair of display RAM bytes, the even address is for the character code and the odd address is for the attribute byte. Subsequent characters are displayed along the row from left to right. When the end of a row is reached the next pair in the display RAM appears in the first character position of the next row down. Appendix 8 gives the 256 character codes and their respective default character representations. Note that the ROM bios for EGA mode supports reprogramming the character generator with user supplied character matrices.

The attribute byte allows a choice of either 16 foreground and 8 background colors per character, plus blinking, or a choice of 16 colors for both foreground and background without blinking. In CGA mode, the display border may be programmed for any one of the 16 colors.

The attribute byte for each is as follows:

Bit (ATn)Definition
7Intensity or Enable Blink (Background)
6Red (Background)
5Green (Background)
4Blue (Background)
3Intensity (Foreground) or Character Map A/B Select
2Red (Foreground)
1Green (Foreground)
0Blue (Foreground)

Bit 7, the Intensity or Enable Blink Bit, changes function based the Mode Control Register. In EGA mode, Mode Control Register (I/O address 03C0h, index 10), Bit 3 selects between Intensity or Blink in standard alphanumeric display modes. For CGA compatible mode, Mode control Register (I/O address 03D8h) bit 5 selects between Intensity or Blink.

In EGA mode bit 3, the foreground intensity bit, can be used as an alternate character map select bit to obtain up to 512 displayable characters for a given screen. The extended character map option is explained in section 1.11.3, IGA Extended Graphics Mode Registers, in the section which deals with the Character Map Select Register which is contained in the sequencer logic.

Note that in EGA mode, the bit positions listing IRGB actually selects one of the 16 paletter registers and depending on the contents of the selected palette register the (extended six-wire) color signals are produced accordingly. If the palette registers are left unchanged from the initial values loaded at mode change the color selections will be given the sixteen standard colors listed in the color table at the beginning of this section. The table below gives the palette register settings which produce the standard 16 color palette.

Regr g bR G BColor
00 0 00 0 0Black
10 0 00 0 1Blue
20 0 00 1 0Green
30 0 00 1 1Cyan
40 0 01 0 0Red
50 0 01 0 1Magenta
60 0 01 0 0Brown
70 0 01 1 1White (Grey1)
81 1 10 1 0Grey (Grey2)
91 1 10 0 1Light Blue
A1 1 10 0 0Light Green
B1 1 10 1 1Light Cyan
C1 1 11 1 0Light Red
D1 1 11 0 1Light Magenta
E1 1 11 1 0(Light) Yellow
F1 1 11 1 1 Intense White

The small (lower case) letters represent the secondary colors at 1/3 intensity each and the big (upper case) letters represent the primary colors at 2/3 intensity each.

1.11.1.2 Monochrome Alpha Display

When driving a Monochrome (PC-MD) Display, there is only one Alpha mode available, 80 characters by 25 rows with a resolution of 720 dots by 350 lines. The display RAM requirement is in 4K increments in display regeneration buffer area from B0000h to B7FFFh. The display ROM bios supports up to 8 separate display pages. Buffer 0 is from B0000 to B0F9F, buffer 1 is from B1000 to B1F9F with the remaining 6 buffers starting on even 1000h boundaries to B7000.

In EGA mode the character set is formed by a RAM loadable character generator and each of the 256 characters is made up of a 9 by 14 pixel matrix.

The CRTC Starting Address is programmed in the same way as when in color modes and the two byte character and attribute pairs are arranged in the display RAM just as in the color modes. The attribute byte, however assumes different functions from the color attributes since there are no IRGB signals sent to the monitor, but Video & Intensity are produced. The monochrome attribute byte is as follows:

Function Bits 7 6 5 4 3 2 1 0
Blanked Bkg I/B 0 0 0 I 0 0 0
Underlined Bkg I/B 0 0 0 I 0 0 1
Normal Bkg I/B 0 0 0 I 1 1 1
Inverse Bkg I/B 1 1 1 I 0 0 0

Bit 7, the Background Intensity/Blink Enable (B/I) Bit, changes function based the Mode control register. In EGA mode, Mode Control Register (I/O address 03C0h, index 10), Bit 3 selects between Intense background when inverted or Blinking. For MDA compatible mode, Mode control Register (I/O address 03B8h) Bit 5 selects between Intensity or Blink Functions. The Hercules modes follow the same scheme in text mode.

Bit 3 is the foreground intensity bit and controls the intensity when not in inverse video or blanked. It is also necessary to turn the contrast down on the PC-MD display in order to observe the difference in video levels.

1.11.2.1 Colour Graphics Display

PC-CD (Standard Color Display) systems support 200 scan lines with a choice of two graphics resolutions, either 320 pixels per scan line with four colors per pixel or 640 pixels per scan line with a two colors and these are termed 'CGA' compatible modes. Additional sixteen color (EGA) modes are also available in the above two resolutions. In the CGA compatible modes, the regeneration buffer for the 320x200 4-color mode and 640x200 2-color mode starts at B8000 and requires 16K bytes per display page. The IGA ROM BIOS supports either 8 or 4 display buffer pages for the 320 or 640 resolution modes respectively.

For EGA 16 color modes, the regen buffer starts at A0000 and is divided into four 64K byte planes, one each for the Blue, Green, Red and Intensity bits. Each plane may be individually read from or written to by the CPU, and two or more planes may be selected by the CPU for writing simultaneously with the same data. Individual data bits can be either enabled or disabled during CPU writes to the graphics memory. The section on registers (1.11.3 below) will explain the methods available for graphics control.

PC-ECD (Extended Color Display) systems support the 200 line resolution modes described above with an additional 16 or 64 color, 640x350 resolution mode. For the high resolution (350 line) mode the regen buffer starts at A0000 and requires 28K bytes per display page. The IGA ROM BIOS supports 2 display pages for the 350 line mode. The 16 color selection is by way of four color planes as described above. The 16 of 64 possible colors is achieved by reprogramming the palette registers introduced in the color text description.

1.11.2.2 Low Resolution (320 x 200) Graphics

In Low Resolution Graphics Mode, the display memory for one scan line (320 pixels) consists of 80 bytes. Each pixel requires two bits so that four pixels are specified by each byte. The leftmost pixel is contained in the two MS bits of the byte and the two bit pairs for the remaining pixels follow on logically from left to right. The two bit field for each pixel specifies one of four colors and can be in one of three palettes as follows:

ColourPalette 0Palette 1Palette 2
0BackgroundBackgroundBackground
1GreenCyanCyan
2RedMagentaRed
3Yellow WhiteWhite

The display regeneration buffer for medium resolution graphics modes is mapped a split buffer configuration with the even scan lines (0, 2, 4, ... 198) contained in the graphics memory space from B8000 to B9F3F and the odd scan lines (1, 3, 5, ... 199) in the memory address range from BA000 to BBF3F. The memory map is as follows:

 320 Pixels (2 Bits Per)  
B8000 - Scan Line 0 (80 Bytes) - B804F
B8050 - Scan Line 2 - B809F
B80A0 - Scan Line 4 - B80EF
.
.
.
B9EF0 - Scan Line 198 - B9F3F
BA000 - Scan Line 1 - BA04F
BA050 - Scan Line 3 - BA09F
BA0A0 - Scan Line 5 - BA0EF
.
.
.
BBEF0 - Scan Line 198 - BBF3F

The mapping of a byte of graphics RAM in low resolution mode is as follows:

RAM Bit: 7 6 5 4 3 2 1 0
Pixel: 0 1 2 3
Pixel Bit: 1 0 1 0 1 0 1 0

1.11.2.3 Medium Resolution (640 x 200) Graphics Mode

In Medium Resolution Graphics Mode, the display memory for for one scan line consists of 80 bytes. Each pixel requires one bits so that eight pixels are specified by each byte. The leftmost pixel is contained in the MS bit of the byte and the remaining pixels follow from left to right. In high resolution mode the two colors are either black (pixel bit off) or pixel bit on with video in one of the 16 colors as selected by a foreground palette register.

One byte of graphics RAM in medium resolution graphics is as follows:

RAM Bit: 7 6 5 4 3 2 1 0
Pixel: 0 1 2 3 4 5 6 7

The address mapping of the scan lines in display RAM for high resolution graphics is the split buffer configuration depicted for medium resolution mode. - All (100) even scan lines from B8000 to B9F3F followed by all (100) odd scan lines from BA000 to BBF3F.

1.11.2.4 High Resolution (640 x 350) Graphics Mode

In High Resolution Graphics Mode, the display memory required for each scan line is 80 bytes which is the same as the 640 pixel scan lines of the medium resolution mode. The major difference is that there are 350 scan lines which are mapped into a contiguous block of display memory starting at A0000 and extending to AFFFF. The IGA ROM BIOS supports two display pages by reprogramming the CRTC starting address register. Page 0 is from A0000 to A6D5F and page 1 is from A8000 to AED5F.

In high resolution mode the display RAM mapping is very straight forward, the 350 display lines are in contiguous 80 byte blocks in the regeneration buffer. The internal pixel to RAM bit mapping is the same as depicted above for medium resolution graphics mode.

This display graphics mapping applies for both EGA Monochrome (BIOS Mode 15) and for EGA High Resolution Color (BIOS mode 16) graphics. The Hercules 720 by 348 graphics mapping is not so straightforward and requires a graphics map which is segmented into four pieces. This mapping scheme is covered in section 1.11.7 with the Hercules Mode control registers.

1.11.2.5 IGA BIOS Modes

The IGA BIOS sets up the hardware to support twelve different modes for the various displays available on the PC1640 range. The following table gives the modes supported by the BIOS ROM. Mode numbers between 8 & 12 are dummy mode numbers for other graphics adapters not supported by the IGA ROM BIOS.

BIOS Mode01234 567131415 16
TypeTextTextTextText Graph Graph GraphText Graph Graph GraphGraph
Columns40408080 320 320 64080 320 640 640640
Rows25252525 200 200 20025 200 200 350350
Colour(s)16161616 4 B/W 2Mono 16 16 Mono16/64
Char Cell Size8x88x88x88x8 8x8 8x8 8x89x14 8x8 8x8 9x148x14
Regen OriginB8000B8000B8000B8000 B8000 B8000 B8000B0000 A0000 A0000 A0000A0000
Regen Size32768327683276832768 32768 32768 32768 32768 65536 65536 65536 65536
Page Size2048204840964096 16384 16384 16384 4096 8192 16384 3276832768
Number Pages1616 882 228 842 2

The Regeneration Buffer Origin is stated in hexadecimal notation since it is an address quantity. All other values are in decimal notation in order to give a numerical perspective to the quantitites.

The IGA ROM BIOS supports multiple display pages and can be called to select an alternate page. The default (base page) upon initial mode selection is always zero and it begins at the origin address. The successive pages are located higher by the page size increment in the table. The equation for page origin is: Page Origin = Regen Origin + (Page Number - Page Size). Since the 'Page Size' quantity is a pure binary multiple it becomes a shift factor for the selected page number. Page are numbered from 0 to n-1 where 'n' is the number of pages available.

The maximum display pages for modes 0 and 1 is listed to be 16 for each. While this is true from a hardware point of view, the IGA ROM BIOS only supports the first eight and the additional pages though accessible via direct access to the memory map, the video character output routines in the ROM BIOS will not correctly access alternate page numbers 8 - 15.

1.11.3 IGA Control Registers

The control registers available in the IGA are somewhat complex but allow a versatile alphanumerics (text) and graphics display environment. The PC1640 ROM Operating System (ROS) and the IGA ROM BIOS allow a simplified set of software interfaces to this hardware and this should be the preferred method of implementing programs with some measure of transportablility to future hardware which may not be compatible with this environment at the hardware level.

Special IGA Registers

There are three special registers which control the overall IGA operational mode and setup characteristics of these modes. The IGA ROM BIOS and the DISPLAY utility program supplied with the PC1640 are the usual programs which sets up these registers. The IGA does not auto-switch, that is, it will stay in a selected hardware emulation mode until some program such as the DISPLAY utility manipulates the control registers. In addition applications programs with drivers for particular hardware will use these registers for their control purposes. The Special IGA Registers are as follows:

NamePort Address
IGA Extended Mode Control3DB/3BB
Hercules Control Register3BF
Plantronics Control Register3DD

Extended Mode Control Register

The IGA Extended Mode Control Register controls the overall operational mode of the IGA such that it can be in EGA, CGA, MDA, Hercules or Plantronics emulation modes. The Extended mode control register is a write only 8-bit register located at I/O address 3DB/3BB and it can only be written to after two successive I/O reads of address 3D8/3B8. This is a protection feature which prevents accidental modifications from taking place. In order to determine whether to use I/O addresses 3B8/3BB or 3D8/3DB (Mono or Color addresses) it is necessary to know whether the system is configured in monochrome or color mode. The standard method for doing this is to use the system ROS's CRTC I/O address pointer located at RAM address 00463. This word (16-bit) will contain either 3B4 or 3D4 depending whether the system is in monochrome mode or color display mode respectively.

The format of the IGA Extended Mode Control register is as follows:

BitOutput Function
7Vsync Polarity, Border Blanking.
6Enable Special Modes.
5Disable Palette and Overscan Registers.
4Lock CRTC Timing Registers.
3Enable Alternate Character Sets on plane 3.
2Disable Blanking.
1Enable 132 Character Mode.
0Enable Color Simulation Modes.

Bit 7 when set forces negative polarity of vertical sync and also blanks the screen border.

Bit 6 when set enables the 6845 compatible modes, CGA, Monochrome, Hercules and Plantronics modes.

Bit 5 when set locks out the Palette registers and the Overscan register.

Bit 4 when set prevents modification of the CRT Controller registers which determine sync signal timing.

Bit 3 when set provides an additional character set option of four 8Kb character sets from plane 3. (See page 40 for additional details.)

Bit 2 when set disables the screen blanking in the CGA Color Alpha mode.

Bit 1 when set enables the 132 Character Mode.

Bit 0 when set enables color simulation modes.

Hercules Mode Register

The Hercules Mode Register is active when Hercules Monochrome Graphics is enabled and is a write only register at I/O address 3BF. It controls the configuration of the graphics memory map and protects against accidental setting of the graphics mode bits in the mode control port at 3B8. The layout of this register is as follows:

BitFunction
7 - 2Not Used.
1Enable Mode Reg Bit 7. (The Full/Half Graphics bit)
0Enable Mode Reg Bit 1. (The Text/Graphics bit)

Since Hercules mode resembles MDA mode but with graphics extensions, applications software built for the MDA may inadvertently set the Hercules graphics control bits. This register prevents such accidents by forcing the respective bits to zero so that text mode is maintained and the display buffer remains at B0000.

Plantronics Mode Register

Plantronics mode is an additional color mode which allows CGA-like color but with extensions for four colors in 640x200 resolution and 16 colors in 320x200 resolution through use of an additional color plane residing in the BC000 memory range. The Plantronics Mode Register (PLR) is a write only register located at I/O address 3DD. Its format is as follows:

BitFunction
7Not Used.
6Color Plane 0/1 Position.
5Enable Extended color palette 1
4Enable Extended color palette 2
3 - 0Not Used.

Bit 6 when clear enables color plane 0 to start at B8000 and color plane 1 to start at BC000. Setting bit 6 swaps the two plane's starting addresses so that color plane 0 starts at BC000 and color plane 1 starts at B8000. Each color plane is 16K bytes in length.

The Extended color palettes enable combinations of bits set is planes 0 and 1 to select one of four different colors for 640 dot resolution or one of 16 colors in 320 dot resolution modes.

When both bits 4 and 5 are cleared standard CGA mode is enabled. When both bits 4 and 5 are set together then bit 4 overrides bit 5 but it is recommended that either bit 4 or bit 5 be set individually else unusual effects may occur. Bit 6 has no effect unless one of bit 4 or bit 5 is set.

EGA Mode Compatible Registers

There are sixty-five EGA Mode compatible registers which control the characteristics of the Extended Graphics Environment. These registers are are grouped into five logical groups, EGC (External) Control, Attribute Controller, Sequencer, Graphics Controller, and the CRTC Controller. They are listed in their respective groupings below:

Register NamePortR/WIndex
EGC Control3C2WO-
EGC Status 3C2RO-
Attribute Controller Address3C0WO-
Palette Registers (0-F)3C0WO00-0F
Mode Control Register3C0WO10
Extended Graphics Border3C0WO11
Color Plane Enable3C0WO12
Horizontal Panning3C0WO13
Sequencer Address3C4WO-
Clock Mode3C5WO01
Color Plane Write3C5WO02
Character Set Select3C5WO03
Memory Mode Select3C5WO04
Graphics Controller Address3CEWO-
Set/Reset3CFWO00
Enable Set/Reset3CFWO01
Color Plane Compare3CFWO02
Data Rotate3CFWO03
Color Plane Read3CFWO04
Graphics Mode Register 13CFWO05
Graphics Mode Register 23CFWO06
Color No Care3CFWO07
Write Mask3CFWO08
CRT Controller Address3B4/3D4WO-
Horizontal Total3B5/3D5WO00
Horizontal Display End3B5/3D5WO01
Start Horizontal Blanking3B5/3D5WO02
End Horizontal Blanking3B5/3D5WO03
Start Horizontal Retrace3B5/3D5WO04
End Horizontal Retrace3B5/3D5WO05
Vertical Total3B5/3D5WO06
CRTC Overflow3B5/3D5WO07
Preset Row Scan3B5/3D5WO08
Maximum Scan line3B5/3D5WO09
Cursor Start3B5/3D5WO0A
Cursor End3B5/3D5WO0B
Start Address High3B5/3D5R/W0C
Start Address Low3B5/3D5R/W0D
Cursor Address High3B5/3D5R/W0E
Cursor Address Low3B5/3D5R/W0F
Start Vertical Retrace3B5/3D5WO10
Light Pen High3B5/3D5RO10
End Vertical Retrace3B5/3D5WO11
Light Pen Low3B5/3D5RO11
Vertical Display Enable End3B5/3D5WO12
Offset3B5/3D5WO13
Underline Location3B5/3D5WO14
Start Vertical Blanking3B5/3D5WO15
End Vertical Blanking3B5/3D5WO16
CRTC Mode Control3B5/3D5WO17
Line Compare Register3B5/3D5WO18
Status Port3B5/3D5RO-

The CRT Controller registers will either reside in the 3B- range for monochrome display mode or in the 3D- range for color display modes. This variable address selection is by way of bit 0 in the EGC Control register at I/O address 3C2.

EGC External Control Registers

The EGC External Control registers comprise a group of two registers which enable reading of information such as switches and enable a number of other hardware setup functions.

EGC Control Register (3C2 Out)

The EGC Control Register is a write only register which resides at I/O address 3C2. Its format is as follows.

BitFunction
7VSYNC Polarity.
6HSYNC Polarity.
5Alternate (64K) Text page Select.
4External Video Enable.
3-2Clock Rate Select / Switch Sense Select.
1Display RAM Enable.
0CRTC 3BX/3DX I/O Address Select.

Bit 7 = '0' for positive VSYNC polarity, and bit 7 = '1' for negative VSYNC polarity.

Bit 6 = '0' for positive HSYNC polarity, and bit 6 = '1' for negative HSYNC polarity.

Bit 5 enables the selection of an alternate 64K display RAM for text modes (BIOS Modes 0 - 3 and 7). Bit 5 = '0' for the default (Low) 64K Text Page and bit 5 = '1' for the alternate (High) 64K Text Page select.

Bit 4 when set disables internal video and enables a data path for video from an external (Features) connector. However no such connector is provided on the PC1640 main board IGA. Bit 4 should always be written as zero.

Bits 2 and 3 form a two-bit field which selects one of two clock rates. When both bits are zero (bit 3 = bit 2 = '0') then 14MHz clock is used as the clock source and when bit 3 is zero and bit 2 is one (bit 3 = '0', bit 2 = '1') then 16MHz is used as the IGA clock source. The other two combinations are not valid for the PC1640. In addition to selecting the clock rate Bits 2 and 3 form a two bit field for reading the system board switches 1 - 4 and comprise a ones complement switch select field (See EGC Status - page 35).

Bit 1 = '0' disables CPU access to the display RAM and bit 1 = '1' enables CPU access to the display RAM.

Bit 0 maps the CRTC for Monochrome I/O addressing or Color I/O addressing. When bit 0 = '0' the CRTC resides at 3B4 & 3B5 for monochrome mode and when bit 0 = '1' the CRTC resides at 3D4 & 3D5 for color mode. The Status Port register is also remapped from I/O address 3BA in monochrome mode to I/O address 3DA in color mode.

EGC Status Register (3C2 In)

The EGC Status Register is a read only register which resides at I/O address 3C2. Its format is as follows.

BitFunction
7VSYNC Interrupt Active.
6 - 5Not Used.
4Switch Sense.
3 - 0Not Used.

Bit 7 = '1' when the VSYNC is waiting and bit 7 = '0' when VSYNC interrupt request has been cleared or is inactive.

Bit 4 works in conjunction with bits 2 and 3 of the EGC Control register to form a switch sense selector. When bit 4 = '0' the selected switch (1 - 4) is closed. The following tables gives the switch select settings.

EGC Control Reg
Out (3C2)
EGC Status Reg
In(3C2)
Bit32Bit 4
11-Switch 1
10-Switch 2
01-Switch 3
00-Switch 4

The IGA ROM BIOS reads these switches during the Power On Self Test (POST) initialization phase and deposits the switch complement value in the system storage location 0:488. Bits 0 - 3 correspond to the ones-complement of switches 1 - 4 respectively. The four MS bits of location 0:488 will always be ones on the PC1640.

Attribute Controller Registers

The Attribute Controller is a hardware grouping within the Extended graphics Controller which provides for color management. The major components of this section of logic are the palette registers which allow for the selection of 16 of 64 colors at any one time.

Attribute Controller Address Register

The Attribute Controller Address Register is a write only register which at I/O address 3C0h. When written to, its contents represent an index into the Attribute Controller register set which also resides at I/O address 3C0. The processor must first output the Index value followed immediately by the register value to be written. Any divergence from this two byte output scheme will cause following operations to confuse Index and data values.

Palette Registers (00h - 0Fh)

The sixteen Palette Registers reside at index positions 00h through 0Fh in the attribute controller and the bit assignments for each is as follows:

BitFunctionVideo Pin
7 - 6Not Used.-
5Secondary Red Video2 (r)
4Secondary Green/Intensity6 (g/I)
3Secondary Blue/Mono Video7 (b/V)
2Primary Red3 (R)
1Primary Green4 (G)
0Primary Blue5 (B)

The Palette registers are each six bits wide and the bits are arranged such that the output color signals will correspond (from MS to LS bits) in the order rgbRGB. The major point to note is that secondary green and Intensity are on the same video output pins. The IGA ROM BIOS will initially load the palette registers such that the secondary green bit (bit 4) will be set for all the high order registers which require Intensity set for the four wire IRGB 16 color displays. This scheme allows the color selection to resemble a CGA's color selection. Any of the color fields which contain four bits (i.e. attribute bytes and color planes) actually select their respective palette register for the selection of color signals are to be output.

Mode Control Register (10h)

The Mode Control Register is a write only register which resides at index 10h in the attribute controller at I/O address 3C0. This register specifies the major operational mode and some other characteristics of selected modes. The Mode Control Register format is as follows:

BitFunction
7 - 4Not Used.
3Background Intensity / Enable Blink.
2Enable Line Graphics.
1Display Type.
0Graphics/AlphaNumeric (AN) Mode.

In Alphanumeric mode bit 3 ties up with the MS bit of the text attribute byte to enable MS attribute bit to either be the Blink Enable bit when bit 3 is set or to enable the MS attribute bit to be that Background Intensity bit when bit 3 is reset. The blink rate is 16 display frames ON and 16 display frames OFF which is half the cursor blink rate. In Color Graphics Mode, setting bit 3 allows for a specific pixel to alternate between two colors by toggling COL3 at the blink rate.

Bit 2 when set enables the special line graphics characters originally designed for the MDA by causing the ninth dot to be the same as the eight dot for an effective 9x14 character cell.

Bit 1 when set selects the monochrome display attributes and when clear selects color display attributes.

Bit 0 selects graphics mode when set and Alphanumeric mode when reset.

Extended Graphics Border Register (11h)

The Extended Graphics Border Register is located at index 11h in the attribute controller registers at I/O address 3C0. It is also called the Overscan register and is a 6-bit wide write only register. Its function is to specify the Extended graphics mode border color. It can be locked out by setting bit 5 in the IGA Extended Mode Control Register (See page 29).

The format of the Extended Graphics Border register is the same as the Palette Registers (see page 36). When in monochrome mode the Extended Graphics Border register should be set to zero.

Color Plane Enable Register (12h)

The Color Plane Enable Register is a write only register residing at index 12h in the attribute controller at I/O address 3C0. Its function is to enable or disable which color planes are active for producing video, thus acting as an overall palette selector. The format is as follows:

BitFunction
7 - 6Not Used.
5 - 4Video Status Multiplex (MUX)
3Enable Color Plane 3
2Enable Color Plane 2
1Enable Color Plane 1
0Enable Color Plane 0.

When bits 0-3 are set to '1's, the corresponding color plane is enabled.

The two bits 4 and 5 allow for diagnostics to be run on the hardware by selecting which two color plane's outputs will be gated to bits 4 and 5 of the Status Port Register at 3BA / 3DA. The Following table gives the correspondence between the video status MUX bits and the Status Port.

Video Status MUX Status Port Reg
(3C0) (3XA)
Bits 5 4 Bits 5 4
00 RB
01 rg
10 bG

The upper case letters represent the primary colors and the lower case letters represent the secondary colors. The 1, 1 case is not used.

Horizontal Panning Register (13h)

The Horizontal Panning Register is a write only register residing at index 13h in the attribute controller at I/O address 3C0. Its function is to select the number of pixels to shift the video date horizontally left. Panning is available in both alphanumeric and graphics modes. The monochrome alphanumeric shift factor is a maximum of 9 pixels. The maximum shift factor for all other modes is 8 pixels. The bit layout of the Horizontal Panning Register is as follows:

BitFunction
7 - 4Not Used.
3 - 0Horizontal Panning Value. (Bits 3-0)

For the 9-bit maximum monochrome alphanumeric mode the shift sequence is pixel 8, then pixels 0 through 7. For all other modes the pixel shift sequence is pixels 0 through 7.

Sequencer Registers

The Sequencer is a hardware grouping within the Extended graphics controller which controls video memory accessing, character clocking and character generator mapping. The Sequencer registers consist of an address register with four control registers which are indexed by the address register. Index position zero though listed to select the Reset register is not required in the PC1640 IGA and is not implemented. The remaining registers corresponding to index values 1 through 4 respectively are the Clocking Mode register, the Plane Mask register, the Character Set Select Register, and the Memory Mode register.

Sequencer Address Register

The Sequencer Address Register is a write only register at I/O address 3C4 which selects which sequencer register is configured to I/O address 3C5. The bit layout of the Sequencer address register is as follows:

BitFunction
7 - 3Not Used.
2 - 0Sequencer Address (Bits 2 - 0)

Clock Mode Register (3C5, 1)

The Clock Mode Register is a write only register which resides at I/O address 3C5 when the index register contains 1. Its format is as follows:

BitFunction
7 - 4Not Used.
3Dot Clock Rate.
2Shift Register Load.
1Not Used.
08/9 Dot Clocks.

Bit 3 controls whether the dot clock will be a direct function of the master clock rate or divided by two. Setting bit 3 causes the input clock to be divided by two. This is used for 320 pixel wide graphics.

Bit 2 when cleared causes the serial video shift registers to be loaded every character clock. Setting bit 2 causes the load rate to be every second character clock. Bit 2 should be cleared when two of the shift registers are chained together for 16-bit character columns.

Bit 0 controls the number of dot clocks generated by character row. It should be cleared for monochrome mode (9-bit wide characters) and set for color mode characters (8-bits wide).

Color Plane Select Register (3C5, 2)

The Color Plane Select Register is a write only register which resides at I/O address 3C5 when the index register contains 2. Its format is as follows:

BitFunction
7 - 4Not Used.
3Write Enable Memory Plane 3.
2Write Enable Memory Plane 2.
1Write Enable Memory Plane 1.
0Write Enable Memory Plane 0.

Setting Bits 0 - 3 write enables the respective memory plane. The CPU can write to any combination of display memory planes in one write cycle by setting the respctive bits. Bits 0 &1 and bits 2 & 3 should have the same values when odd/even modes are selected. (See page page 42 for Odd/Even mode details.)

Character Set Select Register (3C5, 3)

The Color Plane Select Register is a write only register which resides at I/O address 3C5 when the index register contains 3. Its format is as follows:

BitFunction
7 - 4Not Used.
3 - 2Character Set Select A.
1 - 0Character Set Select B.

There are four alternate character sets per character map each containing 128 characters each thus allowing up to 512 characters to be accessible for any given screen. In addition the IGA Extended Mode register (bit 3) enables an alternate set of character maps to be selected for an extended total of 1024 available characters. The alternate map character selections is disabled then character map select A equals character map select B (that is, bits 0 & 1 equal bits 2 & 3. When enabled, attribute bit 3 selects when reset selects character map A and when set selects character map B. The following table gives the character set selections for the combinations of bits 0 - 3.

Character Set Selected Map vs
Sel A Sel B Attribute Bit 3
3 2 1 0 1 0
0000 ----
0001 0001
0010 0002
0011 0003
0100 0100
0101 ----
0110 0102
0111 0103
1000 0200
1001 0201
1010 ----
1011 0203
1100 0300
1101 0301
1110 0302
11 11 ----

The dashes mean disabled and that attribute bit 3 becomes the intensity select bit.

When the IGA Extended Mode Register bit 3 is set then an alternate set of character maps are enabled from plane 3 and in this case the map numbers in the table should be logically incremented by 4. The following figure illustrates the complete PC1640 character set organization.

Plane 2 Plane 3
8 KbChar Set 0 Char set 4
8 KbNot Used. Not Used.
8 KbChar Set 1 Char set 5
8 KbNot Used. Not Used.
8 KbChar Set 2 Char set 6
8 KbNot Used. Not Used.
8 KbChar Set 3 Char set 7
8 KbNot Used. Not Used.

Memory Mode Select Register (3C5, 4)

The Memory Mode Select Register is a write only register which resides at I/O address 3C5 when the index register contains 4. Its format is as follows:

BitFunction
7 - 3Not Used.
2Odd/Even.
1Extended Memory. (1)
0Not Used.

Bit 1 indicates that 256Kb of display RAM is present and should always be set on the PC1640.

Bit 2 when set selects chained addressing mode whereby even CPU address access character sets 0 and 2 while odd CPU addresses access character sets 1 and 3. When bit 1 is cleared, unchained addressing mode is selected and CPU accesses sequentially access data within the character bit maps.

Graphics Controller Registers

The Graphics Controller is a hardware grouping within the Extended graphics Controller which directs memory data to the attribute controller and to the CPU. In graphics modes serialised memory data is sent to the attribute controller. The Graphics Controller and the Attribute Controller are the two logic groupings which make up a total functional logic grouping called the Video Controller. The Graphics Controller registers consists of an address register and nine write only data registers.

Graphics Controller Address (3CE)

The Graphics Controller Address Register is a write only register at I/O address 3CE which serves as an address pointer for nine data registers at I/O address 3CF. The bit layout is as follows:

BitFunction
7 - 4Not Used.
3 - 0Graphics Address Pointer.

Bits 0 - 3 select the active register at I/O address 3DF.

Set/Reset (3CF, 0)

The Set/Reset Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 0. Its format is as follows:

BitFunction
7 - 4Not Used.
3Set/Reset Bit 3
2Set/Reset Bit 2
1Set/Reset Bit 1
0Set/Reset Bit 0

The value in Bits 0 - 3 is written to plane 0 - 3 respectively, providing that the corresponding bit in the Enable Set/Reset register (below) is also set and that Graphics Mode Register 1 is programmed for write mode 0 and that the CPU data bit being written contains a 1.

For example if it were desired to write bits 7, 5 and 0 of a particular display location with light cyan then the Set/Reset register bits 3-0 would be set to 1011 binary (the pattern for light cyan), then the Enable Set/Reset register (page 44) is set to 0Fh and the particular display memory location would be written with 1010001 binary. The bit positions containing zeroes would remain unchanged and the pixels corresponding to bits 7, 5, and 0 would be light cyan. The equation for bit number to pixel number translation is: Pixel Number = (7 - Bit Number).

Enable Set/Reset (3CF, 1)

The Enable Set/Reset Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 1. Its format is as follows:

BitFunction
7 - 4Not Used.
3Enable Set/Reset Bit 3
2Enable Set/Reset Bit 2
1Enable Set/Reset Bit 1
0Enable Set/Reset Bit 0

Setting Bits 0 - 3 will qualify the corresponding Set/Reset register bit to be written as described above. If write mode is 0 and Set/Reset is not enabled on a color plane, the plane's original contents are preserved.

Color Plane Compare Register (3CF, 2)

The Color Plane Compare Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 2. The Color Plane Compare register is activated when the Graphics Mode Register 1 (page 47) bit 3 is set enabling compare mode. When color compare mode is active, CPU reads of the display RAM area will return the results of a comparison between the Color Plane Compare Register and the color planes rather than the actual memory contents.

The Color Plane Compare Register is as follows:

BitFunction
7 - 4Not Used.
3Color Plane Compare 3.
2Color Plane Compare 2.
1Color Plane Compare 1.
0Color Plane Compare 0.

The color pattern in bits 0 - 3 is compared with the memory location being read by the CPU. The bits returned represent which bits actually match the color pattern. The Color No Care register (described below) specify which planes participate in the comparison.

In the example for writing light cyan using the Set/Reset register, loading the color compare register with 1011 binary and reading the same display memory location would return the 1010001 binary value written. This is interpreted to mean that the pixels corresponding to bits 7, 5 and 0 are light cyan and the other pixels are some other color(s). To determine what other colors are in the same byte would require either performing a color compare scan of the 15 other color combinations or discreetly reading each of the color planes and considering what color the four bits for each pixel actually represent.

Data Rotate Register (3CF, 3)

The Data Rotate Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 3. This register controls a number of logical operations which can be performed when the CPU writes to the display RAM. Its layout is as follows:

BitFunction
7 - 5Not Used.
4 - 3Function Select.
2 - 0Rotate Count.

The Function select field (bits 3 & 4) select one of four functions which can be performed between the existing contents of a memory plane and the new data being written. These operations are as follows:

Bit
4 3

Selected Function
0 0Replace Existing Data.
0 1Logical 'AND'.
1 0Logical 'OR'.
1 1Logical 'XOR'.

When bits 3 and 4 are both reset, data from the CPU replaces the existing data and no logical operation is performed.

When a logical operation is enabled, the planes which are write enabled (see Color Plane Enable register) will be read and the specified logical operation performed between the existing contents and the data from the CPU and the resultant value stored in the respective display memory plane.

Bits 0 - 3 control a Rotate Right function on CPU data being written to the display planes. When write mode zero is programmed in the Graphics Mode register 1 (See Below), the contents of bits 0 - 3 represent the shift count which will be performed on the data from the CPU. The rotate is end around, the LS bits are rotated to the MS bits and the resultant value is written to the selected memory plane(s).

Color Plane Read (3CF, 4)

The Color Plane Read Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 4. Its format is as follows:

BitFunction
7 - 2Not Used.
1 - 0Read Select.

The CPU reads from whichever of the four color planes in display RAM selected according to the Read Select field. If the original contents of the color paletter registers are maintained then the selection relates to the IRGB color signals as follows:

Bit
1 0

Selected Color Plane
0 0Blue. (Plane 0)
0 1Green. (Plane 1)
1 0Red. (Plane 2)
1 1Intensity. (Plane 3)

Bit 2 is also connected with the read select decoding and should be maintained reset else no plane will be selected for reading.

Graphics Mode Register 1 (3CF, 5)

The Graphics Mode Register 1 is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 5. Its format is as follows:

BitFunction
7 - 6Not Used.
5Shift Register Format.
4Not Used.
3Read Mode.
2Not Used.
1 - 0Write Mode

Bit 5 controls the configuration of the four serializer shift registers within the graphics controller. In the normal case when bit 5 is reset, data from planes 0 - 3 are shifted out of shift registers 0 - 3 respectively going out MS bit first. When bit 5 is set to one then the even numbered bits are shifted out of the even numbered shift registers and the odd numbered bits are shifted out of the odd shift registers. This means that shift register 0 shifts bits 6, 4, 2 & 0 of Plane 0, followed by bits 6, 4, 2 & 0 of plane 1. Shift register 1 shifts bits 7, 5, 3 & 1 of Plane 0 followed by bits 7, 5, 3 & 1 of Plane 1. Shift registers 2 and 3 perform the same even/odd shifting pattern for color planes 2 & 3 as described above.

Bit 3 when clear enables the Color Plane Read register to control the color plane selection of CPU reads. When bit 3 is set then the Color Plane Compare register controls the CPU data read back (as described on page 44).

Bits 0 and 1 form a two bit Write Mode field which specifies the manner in which the IGA handles graphics data written to the memory planes. The following table gives the valid options:

Bits
1 0

Selected Write Mode Description
0 0CPU data written to planes 0 - 3 is controlled by Color Plane Write register, the Data Rotate Register, the Set/Reset Registers as described in the register descriptions.
0 1When a CPU write cycle is performed Planes 0 - 3 are written with data from the previous CPU read operation.
1 0Planes 0 - 3 are written with 1's or 0's based on bits 0 - 3. For example, if the value of data bit 3 = 1 then plane 3 would be written with FFh.

The 1,1 state is not legal and should not be used.

Graphics Mode Register 2 (3CF, 6)

The Graphics Mode Register 2 is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 6. Its format is as follows:

BitFunction
7 - 4Not Used.
3 - 2Memory Mapping Mode.
1Enable Odd/Even Chaining.
0Not Used.

Bits 2 and 3 form a two bit field which specifies the regeneration buffer origin and size parameters as follows:

Bit
3 2

Origin

Size
0 0A000h128K Bytes
0 1A000h64K Bytes
1 0B000h32K Bytes
1 1B800h 32K Bytes

Setting bit 1 causes the processor address bit A0 control the selection of odd/even memory planes rather than contiguous odd/even addresses. The usual function performed by address bit A0 is shifted to the high order address bit.

Color No Care Register (3CF, 7)

The Color No Care Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 7. Its format is as follows:

BitFunction
7 - 4Not Used.
3Color Plane 3 No Care.
2Color Plane 2 No Care.
1Color Plane 1 No Care.
0Color Plane 0 No Care.

This register ties up with the Color Compare register and can be considered a color compare mask in that setting bits in the 'No Care' register inhibits the corresponding color plane from participating in the comparison process when a color compare read is performed.

Write Mask Register (3CF, 7)

The Write Mask Register is a write only register which resides at I/O address 3CF when the Graphics Controller Address Register contains 8. Its format is as follows:

BitFunction
7 - 0 Write Mask. (Bits 7 - 0)

Resetting bits in the Write Mask register disables the respective bits from being written to in the display planes. The Write Mask register is programmed to all ones during display mode initialization so that the all eight bits are normally stored into display memory.

The Write Mask register affects all data written by the CPU including the rotate and logical operations. The hardware performs a read-before-write operation in order to preserve the protected bits.

EGA Mode CRT Controller Registers

The CRT Controller is a hardware grouping within the IGA which controls horizontal and vertical synchronization as well as cursor, underline and blink timing. It also generates addressing for the display regeration buffer and dynamic RAM refresh controls.

The CRT Controller contains data 27 registers which are accessed through an index register which must be loaded prior to accessing a particular CRTC data register. The CRTC data registers reside at either I/O address 3B5 or I/O address 3D5 depending on whether the IGA is operating in monochrome mode or color mode respectively.

This alternate I/O addressing scheme is so that an alternate adapter such as a MDA or a CGA can be fitted in the expansion slots and there will be no I/O address conflicts with the other display adapter's CRTC. This means that the system can only support one color adapter and one monochrome adapter at the same time. If the IGA is driving a monochrome monitor then a CGA can be fitted in the expansion slots. Conversely, if the IGA is driving a color display then only a monochrome adapter can be fitted in the expansion slots. In no case can an EGA be fitted in the expansion slots when the IGA is active because the other EGA will overlay the IGA's ROM BIOS as well as the registers in the 3CX I/O address range. It is also possible to configure the IGA to overlay other display adapter's display RAM.

An additional register, the Status PORT Register, is not technically part of the CRTC but is closely associated with it also explained with this hardware grouping.

CRT Controller Address Register

The CRT Controller Address Register is a write only register which resides at either I/O address 3B4 or I/O address 3D4. When written to, its contents represent an index into the CRTC data registers at I/O addres 3X5 (X=B for Monochrome and X=D for color).

BitFunction
7 - 5Unused.
4 - 0 CRT Controller Address. (00h - 18h)

Values greater than 18h are not valid and should not be used.

Horizontal Total Register (3B5/3D5, 0)

The Horizontal Total Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 00h. Its format is as follows:

BitFunction
7 - 0 Horizontal Total Value. (-2)

The Horizontal Total Register specifies the number of characters (minus 2) in the horizontal scan interval inclusive of the retrace period. This value is the basis of all horizontal (and vertical) timing.

Horizontal Display End Register (3B5/3D5, 0)

The Horizontal Display End Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 01h. Its format is as follows:

BitFunction
7 - 0 Horizontal Display End Value. (-1)

The Horizontal Display End value is the number of characters to be displayed per horizontal line. The actual number of characters displayed per horizontal line is one less than the contents of this register.

Start Horizontal Blanking Register (3B5/3D5, 2)

The Start Horizontal Blanking Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 02h. It is formatted as follows:

BitFunction
7 - 0 Start Horizontal Blanking Value.

The Horizontal blanking signal becomes active when the horizontal character count is equal to the value in this register.

End Horizontal Blanking Register (3B5/3D5, 3)

The End Horizontal Blanking Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 03h. It is formatted as follows:

BitFunction
7Unused.
6 - 5Display Enable Skew Value.
4 - 0 End Horizontal Blanking Value.

The Horizontal blanking signal becomes inactive when the lower 5 bits of the horizontal character count is equal to the value stored in bits 0 - 4 of this register.

Because of the sequential access to display memory by the CRTC, the video data is skewed relative to the horizontal timing. The Display Enable Skew value corrects for this skew by causing a delay of a number of character clocks equal to the value stored in bits 5 and 6.

The following equation specifies the value for bits 0 - 4: End Horizontal Blanking = (Start Blanking Value + Width of Blanking) Modulo 32.

Start Horizontal Retrace Register (3B5/3D5, 4)

The Start Horizontal Retrace Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 04h. Its format is as follows:

BitFunction
7 - 0 Start Horizontal Retrace Value.

The Horizontal retrace signal becomes active when the horizontal character count is equal to the value in this register.

End Horizontal Retrace Register (3B5/3D5, 5)

The End Horizontal Retrace Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 5. Its bit assignment is as follows:

BitFunction
7Even/Odd Starting Address.
6 - 5Horizontal Retrace Skew.
4 - 0 End Horizontal Retrace Value.

The Horizontal Retrace signal becomes inactive when the lower 5 bits of the horizontal character count is equal to the value stored in bits 0 - 4 of this register.

Setting bit 7 specifies that the CRT memory address after a horizontal retrace be an odd memory address. Resetting bit 7 specifies an even starting address. Generally this bit should be reset but it is useful in applications where horizontal pixel panning is required.

The value bits 5 and 6 specify the horizontal retrace skew (0 - 3) in character clock counts. The horizontal retrace signal will be delayed by this value. A number of internal timing signals are generated by the falling edge of horizontal retrace. To guarantee proper latching, retrace is started before the end of display enable, and then skewed by several character clocks for correct screen centering.

The following equation specifies the value for bits 0 - 4: End Horizontal Retrace = (Start Horizontal Retrace Value + Width of Retrace) Modulo 32.

Vertical Total Register (3B5/3D5, 6)

The Vertical Total Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 06h. Its format is as follows:

BitFunction
7 - 0 Vertical Total Value. (-2)

The Vertical Total Register specifies the low 8 bits of a 9 bit value. The 9th bit is located in the CRTC Overflow register. The value in this register represents the total number of scan lines per frame minus two.

CRTC Overflow Register (3B5/3D5, 7)

The CRTC Overflow Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 07h. It is formatted as follows:

BitFunction
7 - 5Unused.
4Line Compare Bit 8.
3Start Vertical Blanking Bit 8.
2Start Vertical Retrace Bit 8.
1Vertical Display Enable End Bit 8.
0 Vertical Total Bit 8.

This register specifies the 9th bit of several other control registers and will be set for a value specifying a scan line greater than 255.

Preset Row Scan Register (3B5/3D5, 8)

The Preset Row Scan Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 08h. Its format is as follows:

BitFunction
7 - 5Unused.
4 - 0 Row Scan Preset Value.

Bits 0 - 4 specify the value of the starting row scan count after a vertical retrace.

Maximum Scan Line Register (3B5/3D5, 9)

The Maximum Scan Line Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 09h. Its bit assignment is as follows:

BitFunction
7 - 5Unused.
4 - 0 Maximum Scan Line. (-1)

The value programmed into bits 0 - 4 specifies the number of scan lines per character row minus one.

Each horizontal retrace increments the horizontal row scan counter. The horizontal row scan counter is cleared when it equals the Maximum Scan Line Register.

Cursor Start Register (3B5/3D5, 0A)

The Cursor Start Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Ah. Its bit assignment is as follows:

BitFunction
7 - 6Unused.
5Cursor Off.
4 - 0 Row Scan Cursor Begins. (-1)

Setting bit 5 turns the cursor off and resetting bit 5 enables the cursor.

Bits 0 - 4 specifies the row scan number of a character line where a cursor is begin. Programming Cursor Start greater than Cursor End disables the cursor.

Cursor End Register (3B5/3D5, 0B)

The Cursor End Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Bh. Its bit assignment is as follows:

BitFunction
7Unused.
6 - 5Cursor Skew Control.
4 - 0 Row Scan Cursor Ends. (+1)

The value stored in bits 0 - 4 represents the last line in each character for displaying the cursor plus one.

Bits 5 & 6 specify the number of character clocks to delay the cursor. For each clock count the cursor moves right by one position.

Programming Cursor Start and Cursor End may not always produce the expected results especially in instances where cursor end is greater than max line scan.

Start Address High Register (3B5/3D5, 0C)

The Start Address High Register is a read/write register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Ch. Its bit assignment is as follows:

BitFunction
7 - 0 Display Start Address. (High Order Bits)

The Start Address High and the Start Address Low registers form a 16 bit value stored which is added to the display origin programmed by Graphics Mode Register 2 to form current display buffer starting address. In text modes the IGA ROM BIOS sets up the CRTC such that the programmed display start address value specifies character/attribute byte pairs from the display origin address for an effective two to one (word oriented) offset ratio. In graphics modes the value is a straight one to one byte to offset ratio.

Start Address Low Register (3B5/3D5, 0D)

The Start Address Low Register is a read/write register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Ch. Its bit assignment is as follows:

BitFunction
7 - 0 Display Start Address. (Low Order Bits)

This register specifies the 8 low order bits of the display start address value.

Cursor Location High Register (3B5/3D5, 0E)

The Cursor Location High Register is a read/write register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Eh. Its format is as follows:

BitFunction
7 - 0 Cursor Location. (High Order Bits)

The cursor location is a 16 bit quantity similar to the start address register. The Cursor Location High register contains the 8 high order bits of the cursor location.

Cursor Location Low Register (3B5/3D5, 0F)

The Cursor Location Low Register is a read/write register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Fh. Its format is as follows:

BitFunction
7 - 0 Cursor Location. (Low Order Bits)

The Cursor Location Low register specifies the 8 low order bits of the cursor location.

Start Vertical Retrace Register (3B5/3D5, 10 Write)

The Start Vertical Retrace Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Fh. It is formatted as follows:

BitFunction
7 - 0 Vertical Retrace Position. (Lower 8 bits)

The Start Vertical Retrace register is a 9-bit register and the value stored specifies the position of the leading edge of the vertical retrace signal in terms of scan lines. This register contains the 8 low order bits of the Vertical Retrace start value and the 9th bit is located in the CRTC Overflow register.

End Vertical Retrace Register (3B5/3D5, 11 Write)

The End Vertical Retrace Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 0Fh. It is formatted as follows:

BitFunction
7 - 6Unused.
5Vertical Interrupt Enable.
4Vertical Interrupt Clear.
3 - 0 End vertical Retrace Value.

The vertical retrace signal becomes inactive when the lower four bits of the horizontal scan count equal bits 0 - 3 of this register.

Bit 5 when set to 1 causes the IRQ pin to go to a tri-stated high-Z state and when it is zeroed the IGA generates IRQ2 when vertical retrace goes active.

Bit 4 is reset to zero to clear the vertical retrace interrupt signal. The interrupt handler routine for the CRT Interrupt should set this bit low then high in order to clear the interrupt.

The following equation specifies the value for bits 0 - 3: End Vertical Retrace = (Start Vertical Retrace Value + Width of retrace) Modulo 16.

Light Pen High Register (3B5/3D5, 10 Read)

The Light Pen High Register is a read only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 10h. Its format is as follows:

BitFunction
7 - 0 Light Pen Address. (High Order Bits)

The Light Pen Address is a 16-bitvalue representing the value of the CRTC address register when the light pen was triggered. This register returns the eight high order bits.

Cursor Location Low Register (3B5/3D5, 11 Read)

The Light Pen Low Register is a read only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 11h. Its format is as follows:

BitFunction
7 - 0 Light Pen Address. (High Order Bits)

An I/O read of this register returns the eight low order bits of the light pen address value.

Vertical Display End Register (3B5/3D5, 12)

The Vertical Display End Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 12h. Its format is as follows:

BitFunction
7 - 0 Vertical Display End Value. (-1) (8 Low Order Bits)

The vertical display end enable value is the represents the number of scan lines displayed minus one. This register contains the 8 low order bits of the vertical display end value and the 9th bit is located in the CRTC Overflow register.

CRTC Offset Register (3B5/3D5, 13)

The CRTC Offset Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 13h. Its format is as follows:

BitFunction
7 - 0 CRTC Offset Value.

The CRTC Offset value represents the logical line width of the display screen. The value in this register determines the starting address of the next character row and is the number of character/attribute pairs in a display line.

Underline Location Register (3B5/3D5, 14)

The Underline Location Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 14h. Its format is as follows:

BitFunction
7 - 5Unused.
4 - 0 Underline Location Value. (-1)

The value in bits 0 - 4 represents the horizontal row scan count at which the underline will occur. The specified value is one less than the desired scan line number.

Start Vertical Blanking Register (3B5/3D5, 15)

The Start vertical Blanking Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 15h. Its format is as follows:

BitFunction
7 - 0 Start Vertical Blanking Value (8 Low Order Bits)

This register contains the 8 low order bits of the horizontal scan line count at which the vertical blanking signal becomes active. The 9th bit of this value is located in the CRTC Overflow register.

End Vertical Retrace Register (3B5/3D5, 16)

The End Vertical Blanking Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 16h. Its format is as follows:

BitFunction
7 - 5Unused.
4 - 0 End Vertical Blanking Value.

The vertical blanking signal becomes inactive when the lower 5 bits of the horizontal scan count match bits 0 - 4 of this register.

The following equation specifies the value for bits 0 - 4: End Vertical Blanking = (Start Vertical Blanking Value + Width of Blanking) Modulo 32.

CRTC Mode Register (3B5/3D5, 17)

The CRTC Mode Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 17h. Its is formatted as follows:

BitFunction
7H/V Retrace Enable.
6Word/Byte Mode.
564K Address Wrapping.
4Not Used.
3Memory Address Count Mode.
2Horizontal Retrace Clock Select.
1Row Scan Counter Select.
0 200 Line Compatibility Mode Select.

Bit 7 controls whether horizontal and vertical retrace is enabled or disabled. Resetting bit 7 to zero clears horizontal and vertical retrace. Setting bit 7 to one enables H & V retrace signals.

Bit 6 when zero selects word mode and a one selects byte mode. This bit should set to zero in non EGA modes (IGA Extended Mode register bit 6 = 1). In word mode the memory is addressed in two byte pairs and the MS bit of the address counter is tied to address bit 0.

Bit 5 selects address wrap at 64K byte boundaries. Since 256K bytes of display memory are installed on the main board this bit should be set to a one.

Bit 3 when set to one causes the memory address counter to be clocked by character clock input to be divided by two. When bit 3 is zero the memory address counter is clocked by straight character clock input.

Bit 2 selects whether the vertical timing counter is to be clocked by horizontal retrace or by horizontal retrace divided by two. Setting bit 2 selects the divide by two mode allowing double vertical resolution.

Bit 1 selects Row Scan counter output configuration. A zero selects row scan counter bit 1 on memory address output bit 14. A one selects row scan counter bit 14 to memory address output bit 14.

Bit 0 allows CGA compatibility mode support by causing alternate display lines to be displaced by 8K bytes. When bit 0 is zero compatibility mode is selected and row scan bit 0 is connected to memory address bit 13 during active display time. When bit 0 is one memory address bit 13 is connected address counter bit 13.

Line Compare Register (3B5/3D5, 18)

The Line Compare Register is a write only register which resides at I/O address 3X5 when the CRT Controller Address Register contains 18h. Its format is as follows:

BitFunction
7 - 0 Line Compare Value. (8 Low Order Bits)

This register contains the lower eight bits of the line compare target value and the 9th bit is in the CRTC Overflow register. The line compare target value is used to implement a split screen function whereby some areas of the screeen can be made immune to scrolling. When the vertical scan counter equals the line compare target value the memory address generator is cleared to zero. Each subsequent row address is determined by the 16-bit addition of the Start of line latch and the contents of the Offset register.

Status PORT Register (3BA / 3DA)

The Status Port Register resides at either I/O address 3BA or I/O address 3DA depending on the CRTC Mono/Color (bit 0) setting in the IGA External Control Register. Its format is as follows:

BitFunction
7Not Used (Color) / -VSYNC (Mono).
6EGA Mode.
5 - 4Color Diagnostic. (MUX)
3-VSYNC (Color) / Mono Video.
2Light Pen Switch. (-LPSW)
1Light Pen Strobe.
0 Display Enable.

Bit 7 is always a one in EGA emulation mode (IGA Extended Mode Reg bit 6 = 0) or when mapped into color adapter range (3DA).

In MDA emulation mode (at 3BA) bit 7 = 0 when VSYNC is active and bit 7 = 1 when VSYNC is inactive.

Bit 6 is a one in EGA emulation mode and a zero otherwise.

Bit 4 and 5 are used by diagnostic software for testing the color output signals and are used in conjunction with the Video Status MUX in the Color Plane Enable Register. Refer to page 38 for the Video Status MUX details. The following is a repeat of the Video Mux Table.

Video Status MUX Status Port Reg
(3C0) (3XA)
5 4 5 4
00 RB
01 rg
10 bG

The primary colors are represented the by capital (RGB) letters and the secondary colors are represented by the small (rgb) letters.

Bit 3 in EGA or Color Mode (3DA) is zero when VSYNC is active and one when VSYNC is inactive. In MDA mode (3BA) is zero when Mono Video is active and one when Mono Video is inactive.

Bit 2 = 0 when the Light Pen switch is closed and bit 2 = 1 when the Light Pen switch is open.

Bit 1 = 0 when the Light Pen strobe has not been triggered and bit 1 = 1 when the Light Pen strobe has been triggered.

Bit 0 = 0 when the Video signal is enabled and bit 0 = 1 when either the vertical or horizontal retrace signals are active. This is a real time indication of the raster scan line status.

1.11.4 IGA BIOS EGA Mode Initialization

The IGA ROM BIOS contains initialization tables for the EGA Mode compatible registers. The IGA BIOS modes were introduced in 1.11.2.5 and consist of a standard set of hardware setups which the BIOS ROM supports. Obviously other hardware setup configurations could be conceived of by the well informed software engineer. However the ROM BIOS modes are the subset of usable capabilities which will ensure transportability to other compatible hardware. The BIOS setups are as follows:

BIOS Mode 01234 5671314 1516
EGC Ctl (3C2) 2323232323 2323A62323 A2A7
Attribute(0) 0000000000 0000000000 0000
Controller(1) 0101010113 1317080101 0801
Registers(2) 0202020215 1517080202 0002
(3C0)(3) 0303030317 1717080303 0003
(4) 0404040402 0217080404 1804
(5) 0505050504 0417080505 1805
(6) 0606060606 0617080606 0014
(7) 0707070707 0717080707 0007
(8) 1010101010 1017101010 0038
(9) 1111111111 1117181111 0839
(0A) 1212121212 1217181212 003A
(0B) 1313131313 1317181313 003B
(0C) 1414141414 1417181414 003C
(0D) 1515151515 1517181515 183D
(0E) 1616161616 1617181616 003E
(0F) 1717171717 1717181717 003F
(10) 0808080801 01010E0101 0B01
(11) 0000000000 0000000000 0000
(12) 0F0F0F0F03 03010F0F0F 050F
(13) 0000 0000 0000 0008 0000 0000
Sequencer(1) 0B0B01010B 0B01000B01 0101
Registers(2) 0303030303 0301030F0F 0F0F
(3C5)(3) 0000000000 0000000000 0000
(4) 0303 0303 0202 0603 0606 0606
Grapics (0) 0000000000 0000000000 0000
Controller(1) 0000000000 0000000000 0000
Registers(2) 0000000000 0000000000 0000
(3CF)(3) 0000000000 0000000000 0000
(4) 0000000000 0000000000 0000
(5) 1010101030 3000100000 0000
(6) 0E0E0E0E0F 0F0D0A0505 0505
(7) 0000000000 0000000F0F 0F0F
(8) FFFF FFFF FFFF FFFF FFFF FFFF
CRTC(0) 3737707037 3770603770 605B
Registers(1) 27274F4F27 274F4F274F 4F4F
(3B5/3D5)(2) 2D2D5C5C2D 2D59562D59 5653
(3) 37372F2F37 372D3A372D 3A37
(4) 31315F5F30 305E51305E 5052
(5) 1515070714 1406601406 6000
(6) 0404040404 0404700404 706C
(7) 1111111111 1111111111 1F1F
(8) 0000000000 0000000000 0000
(9) 0707070701 01010D0000 0000
(0A) 0606060600 00000B0000 0000
(0B) 0707070700 00000C0000 0000
(0C) 0000000000 0000000000 0000
(0D) 0000000000 0000000000 0000
(0E) 0000000000 0000000000 0000
(0F) 0000000000 0000000000 0000
(10) E1E1E1E1E1 E1E05EE1E0 5E5E
(11) 2424242424 24232E2423 2E2B
(12) C7C7C7C7C7 C7C75DC7C7 5D5D
(13) 1414282814 1428281428 2828
(14) 0808080800 00000D0000 0D0F
(15) E0E0E0E0E0 E0DF5EE0DF 5E5F
(16) F0F0F0F0F0 F0EF6EF0EF 6E0A
(17) A3A3A3A3A2 A2C2A3E3E3 E3E3
(18) FFFF FFFF FFFF FFFF FFFF FFFF

1.11.5 Color Graphics Adpater Compatible Registers.

When the PC1640 IGA is in 6845 compatible mode and attached to a PC-CD display (or to a PC-ECD display) it supports the older style 200-line mode text and graphics. Its CRT controller and memory mapping are are different from the EGA environment in a number of important ways and the software support environment is different in that the system ROS ROM supports the video interrupt 16 calls. The IGA ROM BIOS initializes the IGA for the CGA mode emulation and then sets the video int 16 vectors so that the standard ROS calls will be used for CGA mode support.

In CGA emulation mode there are two programmable registers for CGA mode and color selection. These consist of the CGA Mode Control Register and the CGA Color Select Register.

1.11.5.1 CGA Control Register

The CGA Mode Control Register is a write only register located at I/O address 3D8h. It is used to control the state of the video circuitry, selecting Alpha or Graphics mode and the various sub options available within Alpha and Graphics modes.

The layout of the CGA Mode control register is as follows:

BitOutput Use
7No effect
6No effect
5Enable Blinking Chars (disable intensified backgrounds)
4Select Graphics Mode 2 (de-select graphics mode 1)
3Enable Video Display
2Select Palette 2 (de-select palettes 0,1)
1Select Graphics modes (de-select Alpha modes)
0Select Alpha 80 Char mode (de-select 40 Char mode)

When bit 5 is set in Alpha modes, the foreground will blink for all displayed characters with attribute bit 7 also set. Bit 5 has no effect in Graphics modes.

Bit 4 (Select Graphics Mode 2) has no effect in Alpha modes.

Clearing bit 3 causes the display to be blanked if bit 2 in the IGA Extended Mode Control register is cleared. The standard CGA emulation mode initialization process sets bit 2 of the IGA Extended Mode control register so that blanking is disabled. The DISPLAY program has a command line parameter, CGAB, which allows the standard blanking function to be enabled.

The Select Palette 2 bit (bit 2) has no effect in Alpha modes or in Graphics mode 2. It is used in conjunction with bit 5 of the CGA colour select register to control graphics mode 1 palette. To select palette 2, bit 5 of the CGA colour select register (below) should be reset and bit 2 of theGA mode control register should then be set.

Bit 0 (Select Alpha 80 Char mode) has no effect in Graphics modes.

To avoid unsightly effects on the screen, this register should be updated during frame flyback time. Any kind of mode changing should preferably be done with video disabled. Mode changing involves the use of bits 1 and 0 and usually some re-programming of the CRTC.

1.11.5.2 CGA Color Select Register

The CGA Color Select Register is a write only register located at I/O address 03D9h and is used for controlling border colour in alpha modes and for selecting palette, border and pixel colour options in the graphics modes. The layout of the CGA Colour select register is as follows:

BitAlpha ModesGraphics Mode 1Graphics Mode 2
7,6No EffectNo EffectNo effect
5No EffectSelect Palette 1 (Deselect palette 0)No effect
4No EffectForeground Intensity for palettes 0, 1 & 2No effect
3Intensity (Border)Intensity (Backgnd and Border)Intensity (Pixel)
2Red (Border) Red (Background and Border)Red (Pixel)
1Green (Border)Green (Background and Border)Green (Pixel)
0Blue (Border) Blue (Background and Border) Blue (Pixel)

In 640 x 200 two-color graphics mode the overall screen palette is controlled by setting the CGA Color Select register (which is initialized to 07h by the ROS on selection of mode 6). This means that the colour resolution is really one of 16 colours for foreground on a black background. Most applications software however control 640 x 200 mode graphics as black and white graphics.

To avoid unsightly effects on the screen this register should only be updated during frame flyback time.

1.11.5.3 CGA Status Register

The CGA Status Register is a read only register located at I/O address 03DA. It may be read at any time to determine the following:

BitInput Use
7 - 4Not used.
3Frame Flyback (VSYNC) Time.
2Light-pen switch open.
1Light-pen latch set.
0Display Enabled.

Frame flyback time starts at the same time as the bottom border and lasts for 46 horizontal scan periods, ending 16 scans before the end of the subsequent top border.

Bit 2 reflects the state of the light-pen push button switch. Bit 2 = 0 when the light-pen switch is closed and bit 2 = 1 when the light-pen switch is open.

When bit 1 is set, it indicates that the light pen latch is set, triggered either by a pulse from the light pen or by writing data to set the light pen channel. Writing any data to the Clear Light Pen channel clears the latch.

Bit 0 = zero when the Video signal is enabled and bit 0 = "1" when either the vertical or horizontal retrace signals are active. This is a real time indication of the raster scan line status.

1.11.5.4 CGA Mode 6845 CRTC emulation.

The CRT Controller is an emulation of a MC6845 CRT Controller device. All 6845 registers are programmable in the AMSTRAD PC1640 and function the same as the actual device.

The registers must be programmed according to the CGA mode of operation required in conjunction with the CGA Mode and Color Select Registers previously described. A mode changing operation should be performed in the following sequence: Disable video, reprogram the CRTC as required, reprogram the Mode and Color select registers as required, (maintaining video disabled), initialize display ram as required, enable video.

The 6845 CRTC is controlled by way of two I/O addresses, the CRTC Address register and the CRTC Data I/O location. The CRTC Address register is a write only register located at I/O address 3D4 and the lower 5 bits are used select the data register at I/O address 3D5. Addresses greater than 17 (11h) produce no results.

The CRTC registers are initialized as follows:

Register
Number
(Hex)
Register Name Alpha 40
Char Mode
(Decimal)
Alpha 80
Char Mode
(Decimal)
Graphics
Modes
(Decimal)
R/W
Type
00Horizontal Total (-1) 5611356WO
01Horizontal Displayed 4080 40WO
02Horiz. Sync Position 4590 45WO
03Horiz. Sync Width 1010 10WO
04Vertical Total 3131127WO
05Vertical Total Adjust 6 6 6WO
06Vertical Displayed 2525100WO
07Vertical Sync Position 2828112WO
08Interlace 2 2 2WO
09Max. Scan Address 7 7 1WO
0ACursor Start 6 6 6WO
0BCursor End 7 7 7WO
0CStart Address High 0 0 0WO
0DStart Address Low 0 0 0WO
0ECursor Location High 0 0 0RW
0FCursor Location Low 0 0 0RW
10Light Pen Posn. High - - -RO
11Light Pen Posn. Low - - -RO

Values greater than 31 in register 0Ah turn the cursor off. This is because bit 5 is the cursor off bit. Bit 6 in register 0Ah selects alternate blink rate.

CRTC Display Addressing

In Alpha modes, the CRTC register values for start address and light pen position are in the 8K range 0000h to 1FFFh. The register value corresponding to a character position in display RAM must be derived from the even byte address in the 16K range B8000h to BBFFFh by subtracting B8000h and halving.

In Graphics modes, the CRTC register values for start address and light pen position are in the 4K range 0000h to 0FFFh, and wraparound occurs above this range. A register value corresponds to two pairs of pixel bytes in display RAM on word boundaries, one pair displayed on an even scan and the other pair displayed on the following odd scan in the same horizontal position.

The register corresponding to the pixel byte pair position in display RAM must be derived from the even byte address in the 8K range B8000h to B9FFFh (for an even scan) by subtracting the address offset B8000h and halving. Similarly for the odd scan line the offset BA000h is subtracted from an even byte address in the range BA000h to BBFFFh and halved.

1.11.6 Monochrome Display Adapter Compatible Registers.

When the PC1640 IGA is in 6845 compatible mode and attached to a PC-MD display it supports the monochrome mode text. Its CRT controller and memory mapping are are different from the EGA environment in a number of ways and the software support environment is different in that the system ROS ROM supports the older VIDEO Int 16 calls. The IGA ROM BIOS initializes the IGA for the MDA mode emulation and then sets the video int 16 vectors so that the standard ROS calls will be used for MDA mode support.

1.11.6.1 MDA Mode Control Register

The MDA Mode Control Register is a write only register located at I/O address 3B8h. It is used to control the state of the video circuitry.

The format of the MDA Mode control register is as follows:

BitOutput Use
7No effect
6No effect
5Enable Blinking Chars (disable intensified background)
4No effect
3Enable Video Display
2No effect
1No effect
0No effect

When bit 5 is set in the foreground will blink for all displayed characters with the blink (7) bit set in their attribute bytes.

Bit 3 must be set in order to enable the video output and when bit 3 is zero the display is blanked.

1.11.6.2 MDA Status Register

The MDA Status Register is a read only register located at I/O address 03BA. It may be read at any time to determine the following:

BitInput Use
7 - 4Not used (0).
3Video.
2 - 1Not used (0).
0 Display Enabled.

Bit 0 = zero when the Video signal is enabled and bit 0 = one when either the vertical or horizontal retrace is active.

Bit 3 = one when the mono video output pin (7) is active. This is a real time status of the raster scan line output.

1.11.6.3 6845 CRTC Emulation.

The CRT Controller is an emulation of a MC6845 CRT Controller device. All MC6845 are programmable in the AMSTRAD PC1640 and function the same as the actual device.

The CRTC is controlled by way of two I/O addresses, the CRTC Address register and the CRTC Data I/O location. The CRTC Address register is a write only register located at I/O address 3B0 and the lower 5 bits are used select the data register at I/O address 3B1. Addresses greater than 17 (11h) produce no results.

The CRTC registers names and initial values are as follows:

Register
Number
(Hex)
Register Name Initial
Value
(Decimal)
R/W
Type
Type
00Horizontal Total (-1)97WO
01Horizontal Displayed80WO
02Horiz. Sync Position82WO
03Horiz. Sync Width15WO
04Vertical Total (-1)25WO
05Vertical Total Adjust6WO
06Vertical Displayed25WO
07Vertical Sync Position25WO
08Interlace2WO
09Maximum Scan13WO
0ACursor Start11WO
0BCursor End12WO
0CStart Address High0WO
0DStart Address Low0WO
0ECursor Location High0RW
0FCursor Location Low0RW
10Light Pen Address High-RO
11Light Pen Address Low-RO

Setting bit 5 in register 0Ah turns the cursor off. Bit 6 in 0Ah selects alternate blink rate.

1.11.7 Hercules Compatible Emulation.

For the most part, the Hercules Monochrome (HMGA) emulation mode resembles the MDA emulation in text modes and the control/status register bits have the same meanings. There are, however extra functions available in the HMGA emulation which must be considered.

1.11.7.1 HMGA Mode Control Register

The HMGA Mode Control Register is a write only register located at I/O address 3B8h. It is used to control the state of the video circuitry.

The format of the MDA Mode control register is as follows:

BitOutput Use
7Display Page Select.
6No effect.
5Enable Blinking Chars (disable intensified background)
4No effect.
3Enable Video.
2No effect.
1Text/Graphics Mode Select.
0No effect.

Bit 7 = '0' selects display page 0 (B0000-B7FFF), which is the Power-Up default state. Bit 7 = '1' selects display page 1 (B8000 - BFFFF). Note that this will overlay an alternate color mode (CGA) adapter's display buffer which ranges from B8000 to BBFFF. This bit is disabled from being set to '1' by the Hercules Mode register (bit 1) at I/O address 3BFh. See page 30.

When bit 5 is set in the foreground will blink for all displayed characters with the blink (7) bit set in their attribute bytes.

Bit 3 must be set in order to enable the video output and when bit 3 is zero the display is blanked.

Bit 1 = '0' selects text mode, which is the Power-Up default state. Bit 1 = '1' selects graphics mode. This bit is disabled from being set to '1' by the Hercules Mode register (bit 0) at I/O address 3BFh. See page 30.

In Text mode display buffer spans from B8000 to B0FFF and the PC1640 ROS supports 4 display pages in 4K increments from the origin. See 1.11.2.5 - BIOS Mode 7. The character/attribute pairs are as described under Monochrome Text description.

In Graphics Mode there two 32K display pages as controlled by bit 7 above. The byte/pixel mapping is segmeted into four groups of scan lines in the display buffer with a x and y range of 0 to 719 and 0 to 347 respectively. The following 'C' language program illustrates the display mapping.

/*--------------------------* HERCMAP.C *------------------------------------*/

#include <stdio.h>

int HGR_Offset(x,y)
int x,y;
{
	return (0x2000 * (y % 4)) + (90 * (y/4)) + (x/8);
}

main()
{
	int x,y;

	for (x = y = 0; y < 10; y++)
		printf(1x=%d, y=%3d: Offset = %4xh\r\n1,x,y,HGR_Offset(x,y));
	for (y = 338; y < 348; y++)
		printf(1x=%d, y=%3d: Offset = %4xh\r\n1,x,y,HGR_Offset(x,y));
}
/*--------------------------* HERCMAP.C *------------------------------------*/

And this program produces the following output:

	x = 0, y =   0: Offset = 0000h
	x = 0, y =   1: Offset = 2000h
	x = 0, y =   2: Offset = 4000h
	x = 0, y =   3: Offset = 6000h
	x = 0, y =   4: Offset = 005Ah
	x = 0, y =   5: Offset = 205Ah
	x = 0, y =   6: Offset = 405Ah
	x = 0, y =   7: Offset = 605Ah
	x = 0, y =   8: Offset = 00B4h
	x = 0, y =   9: Offset = 20B4h
	x = 0, y = 338: Offset = 5D88h
	x = 0, y = 339: Offset = 7D88h
	x = 0, y = 340: Offset = 1DE2h
	x = 0, y = 341: Offset = 3DE2h
	x = 0, y = 342: Offset = 5DE2h
	x = 0, y = 343: Offset = 7DE2h
	x = 0, y = 344: Offset = 1E3Ch
	x = 0, y = 345: Offset = 3E3Ch
	x = 0, y = 346: Offset = 5E3Ch
	x = 0, y = 347: Offset = 7E3Ch

This output illustrates the first 10 display lines and the last 10 display lines in the display buffer. Each 720 pixel display line occupies 90 (5Ah) bytes. And every fourth line starts at the next contiguous 90th byte position. The four groupings are separated by 2000h in the buffer (as the first four output lines (0-3) illustrate. The final line in each grouping ends at a byte offset of 1E95h from its group origin. The (016Ah byte) void space after each line is not used.

Note the '+ (x/8)' term in the equation for HGR Offset. It represents the fact that there are eight pixels per byte and they're numbered from 0 to 7 which is inverse to the bit numbering. The equation for the pixel's bit number within a byte would then be: Bit Number = (7 - (x Mod 8))

1.11.7.2 HMGA Status Register

The HMGA Status Register is a read only register located at I/O address 03BA. It may be read at any time to determine the following:

BitInput Use
7-Vertical SYNC.
6 - 4Not used (0).
3-Mono Video.
2 - 1Not used (0).
0 Display Enabled.

Bit 7 = '0' indicates that the vertical SYNC signal is active and the display is blanked. Bit 7 = '1' indicates that the display is active. It is a good idea to wait until bit 7 is clear before updating the screen.

Bit 3 = '0' when the mono video output pin (7) is active. This is a real time status of the raster scan line output.

Bit 0 = '0' when the Video signal is enabled and bit 0 = '1' when either the vertical or horizontal retrace signals are active (and the display is blanked).

1.11.7.3 6845 CRTC Emulation.

The CRT Controller is an emulation of a MC6845 CRT Controller device. All MC6845 are programmable in the AMSTRAD PC1640 and function the same as the actual device.

The CRTC is controlled by way of two I/O addresses, the CRTC Address register and the CRTC Data I/O location. The CRTC Address register is a write only register located at I/O address 3B0 and the lower 5 bits are used select the data register at I/O address 3B1. Addresses greater than 17 (11h) produce no results.

The CRTC registers names and initial values are as follows:

Register
Number
(Hex)
Register Name Alpha (80)
Char Mode
(Decimal)
Graphics
Mode
(Decimal)
R/W
Type
00Horizontal Total (-1)9753WO
01Horizontal Displayed8045WO
02Horiz. Sync Position8246WO
03Horiz. Sync Width157WO
04Vertical Total (-1)2591WO
05Vertical Total Adjust62WO
06Vertical Displayed2587WO
07Vertical Sync Position2587WO
08Interlace22WO
09Maximum Scan133WO
0ACursor Start110WO
0BCursor End120WO
0CStart Address High00WO
0DStart Address Low00WO
0ECursor Location High00RW
0FCursor Location Low00RW
10Light Pen Position High--RO
11Light Pen Position Low--RO

In text mode, setting bit 5 in register 0Ah turns the cursor off. Bit 6 in 0Ah selects alternate blink rate.

The PC1640 ROS ROM only supports text mode (7) and contains no setup tables for HMGA graphics. The values given are therefore a typical setup and represent a setup for graphics page zero. Consult the MC6845 CRTC data sheets for additional device details to derive alternate setups.

1.12 Floppy Disk Controller

The floppy disk controller is based on the NEC uPD765A single chip controller, and supports one or two 5.25 inch single or double sided, MFM double density floppy disk drives with a data rate of 250 kilobits per second.

The FDC is controlled by way of the Drive Selection register at I/O Address 3F2. It is defined as follows:

Bit (Dn)Output Use
7 - 6No effect
5Switch motor(s) on and enable drive 1 selection
4Switch motor(s) on and enable drive 0 selection
3Allow 765A FDC to interrupt and request DMA
2- 765A reset
1Drive Select Bit 1 (DS1)
0Drive Select Bit 0 (DS0)

The Drive Select bits (DS1, DS0) are only valid for values of 00 and 01 for drives 0 and 1 respectively. The drive selection qualification is only completed when either bit 4 (for drive 0) or bit 5 (for drive 1) is set. In addition setting bits 4 or 5 will have no effect until the value of DS1, DS0 is correspondingly set.

Bit 2 (- 765A reset) must brought low (output as '0') and held low for at least 3.5 uS in order to reset the 765A. It must then be set high in order to release the reset signal.

On power-up or following a system reset, all bits in this register are cleared to zero.

1.12.1 FDC Hardware Conditions

The hardware imposes the following conditions on the use of the 765A controller and disk drives:

  1. The clock frequency of the 765A FDC is fixed at 4.0 MHz.
  2. Disk data transfers are done by DMA using the on-board DMA controller. The 765A DRQ output may connected to or disconnected from the DMA controller DRQ2 input by software using Drive Selection Register bit 3.
  3. An interrupt level is available for use by the 765A to signal command completion and attention status to the CPU. The 765A INT output may be connected to or disconnected from the interrupt controller IRQ6 input by software using Drive Selection Register bit 3.
  4. Drive 0 is always present. Drive 1 is optional. Drives 2 and 3 are not implemented and can never be accessed. (No select signal decode is implemented for these drives.) Drive Ready output signal from the currently selected drive is connected to the 765A RDY input. For drives which do not a drive ready output the 765A RDY input may be optionally fixed to the true condition.
  5. The 765A Drive Select outputs US1 and US0 are not used to select the drives. This function together with motor control is done via the Drive Selection Register which is external to the FDC 765A.
  6. The FLT (Fault) input 765A is forced permanently false.
  7. A Two-Sided status signal from the drive(s) is not provided but interface to the drives allows the use of double sided drives.
  8. Write precompensation of 250 ns is provided.
  9. The 765A may be individually reset by software using Drive Selection Register bit 2.

1.13 RS232C Asynchronous Serial Port

The asynchronous serial port is configured to I/O addresses 3F8h - 3FFh and is based on the National INS8250 ACE (or UART), single channel device.

The clock frequency input of the 8250 is 1.8432 MHz ( 0.1%).

The 8250 BAUD OUT output is connected to the RCLK input.

An interrupt level is available for use by the 8250. When the 8250 OUT2 output is driven low (i.e. a '1' is written to bit 2 of the 8250 MODEM Control Register) then the INTRPT signal is connected to the interrupt control IRQ4 input.

1.13.1 Serial Channel Interface

The serial interface uses a 25-way subminiature D type plug (male) connector emulating a DTE (Data Terminal Equipment).

The electrical levels of signal lines on this interface conform with EIA (Electronics Industry Association) standard RS-232C (and the equivalent CCITT V.24 interface standard).

The RS232C drivers and receivers between the 8250 and the serial channel connector are all inverting.

1.13.2 Serial Channel Pin Arrangement

PinEIACCITTDescription
2BA103TxD - Serial Data Output
3BB104RxD - Serial Data Input
* 4CA105RTS - Request to Send Output
5CB106CTS - Clear to Send Output
6CC107DSR - Data Set Ready Input
7AB102Signal Ground (Common Return)
8CF109DCD - Data Carrier Detect Input
* 20CD108.2DTR - Data Terminal Ready Output
22DE125 RI - Ring Indicator Input

* These interchange circuits, where implemented, shall be used to detect either a power off condition in the equipment across the interface, or the disconnection of the interconnecting cable. The terminator for these circuits shall interpret the power off condition or the disconnection of the interconnecting cable as an OFF condition.

[RS232 pinout diagram]

See Appendix 4 for additional details of serial signals and cable connections.

1.14 Parallel Printer Interface

The parallel printer port is described in Section 1.10 and is a general purpose 'Centronics' style 8-bit interface. The printer interface uses a 25-way subminiature 'D' socket (female) connector located at the back of the PC1640.

The Pin assignments for the printer connector is as follows:

PinAssignment
1Not Data Strobe
2Data Bit 0
3Data Bit 1
4Data Bit 2
5Data Bit 3
6Data Bit 4
7Data Bit 5
8Data Bit 6
9Data Bit 7
10Not Printer Acknowledge
11Printer Busy
12Paper Out
13Select Printer
14Not Select Auto Feed
15Not Printer Error
16Not Reset Printer
17Not Printer Selected
18GND
19GND
20GND
21GND
22GND
23GND
24GND
25GND
[Parallel pinout]

Appendix 5 contains the Amstrad PL-2 printer lead specification for the DMP3000 printer.

1.15 Keyboard Interface

Keyboard data input to the CPU is via the 8255 PPI Port A, and the keyboard interrupt (level 1) of the 8259A PIC. Both of these have been previously described in sections 1.6 and 1.8.

1.15.1 Serial Clock and Serial Data

The Serial Clock and Serial Data signals are used for keyboard interface. These two bidirectional signals are used by the keyboard microcontroller to send keycodes to the main electronics board. The main electronics board also uses the same two signals to indicate readiness to receive another keycode back to the microcontroller. In addition these two signals are used to reset the microcontroller under hardware or software control.

1.15.2 Keyboard to Main Board Interface

The quiescent state for both Serial Clock and Serial Data is high. A minimum of 5 us must separate a transition of one signal from another transition of the same signal, or any transition of the other signal.

Keycodes are sent from the keyboard microcontroller to the main board in 8-bit serial form MS bit first. Keycode data received by the main board is clocked into a shift register as either a "1" bit sequence or as a "0" bit sequence. To be interpreted as a "1" bit, the Serial Data signal must remain high during the time period when Serial Clock goes low and returns to the high state. To be interpreted as a "0" bit, Serial Data must be low prior to the Serial Clock transition from high to low, Serial Data will then go high followed by Serial Clock. The "1" bit or the "0" bit is clocked into the shift register on the falling edge of Serial Clock.

1.15.3 Main Board to Keyboard Interface

Upon receiving a keystroke from the microcontroller, within 5 us of the last clock falling edge, the main board electronics drives the Serial Data line low and maintains it low until it is ready to receive a new keystroke. When the main board returns the Serial Data signal to the high state the microcontroller is free to send another keystroke. This response to the reception of a keycode is termed the ACKNOWLEDGE sequence.

The mainboard electronics causes a RESET to the keyboard microcontroller by driving the Serial Clock line low for 10 milliseconds or more. The state of the Serial Data signal does not affect the reset sequence.

1.15.4 Keycodes

The 8-bit keyboard data is capable of 128 'make' codes correspondingly 128 'break' codes. For any key which is pressed, the 'make' keycode produced is in the range of 0 - 127 decimal. When a key is released, the 'break' keycode produced is the same as the make keycode except that the top bit is set so that the value is in the range of 128 - 511 (decimal).

After a key is pressed and the keycode has been sent to the main board electronics, if no new keys are pressed and the key has remained pressed for more that one half second, then the keyboard microcontroller re-sends the keycode every 83 milliseconds provided that the main board indicates by an Acknowledge sequence that is ready to accept a new keycode. The Pause/Break key does not repeat.

The keycode 0AAh is sent after a reset to indicate successful completion of power-up tests.

The PC1640 ROM BIOS receives the keycodes via an interrupt subroutine and it 'tokenizes' them into a two-bytes value for further conversion to ascii values by applications software which use the tokenized keyboard information. The keycodes and their corresponding token values are covered in the ROS firmware (Section 2.3.5). Programs such as KEYBUK.EXE replace the ROM BIOS keyboard vectors and perform their own tokenization process. Since certain of the keycodes are actually Mouse Button and Joystick information, non AMSTRAD versions of KEYBUK will ignore these 'extraneous' keycodes resulting in a loss of a certain level of functionality in these areas.

1.15.5 Keyboard Connector

The Keyboard connector is a 6-way Din socket. The pin assignment is as follows:

PinAssignment
1KBCLK Viewed from left hand side of machine
[Mouse pinout]
2KBDATA
3M1 (Mouse Button 1)
4GND
5+5 Volts DC
6M2 (Mouse Button 2)

The M1 and M2 signals are connected directly to the keyboard controller in order to produce keycodes.

1.16 Mouse Interface

The mouse interface consists of two switch inputs from push buttons and two 8-bit X & Y coordinate counters. The two mouse switches (M1 & M2) are arranged to form part of the keyboard matrix and are handled as keyboard data (producing low level keycodes 7E and 7D respectively).

The Mouse X-Coordinate (I/O Address 078h) is an 8-bit counter which can be read by the CPU. Any write access regardless of the value written to the X-Coordinate location clears the counter. Similarly the Mouse Y-Coordinate (I/O Address 07Ah) can be read by the CPU or cleared by any write access to its I/O address.

The counters are incremented or decremented according to the direction of movement of the mouse, and their values indicate the mouse movement since last read or cleared. The X-Coordinate counter increments for "Right" motion and decrements for "Left" motion. The Y-Coordinate counter increments for "UP" motion and decrements for "Down" motion. In order to properly track mouse motion, software should read and clear the coordinate counters at a rate high enough to prevent overflow from positive values to negative values or negfative values to positive values for a fairly high rate of mouse movement. The scaling of mouse movement is such that one increment of the counter represents 1/8 mm of physical mouse motion.

The delivered operating systems have AMSTRAD specific mouse drivers which actively perform the Read-and-Clear operation (every 18 ms) using the ticker interrupt. This can cause the appearance of no mouse motion to the casual observer sampling the mouse coordinate counters. See Appendix 1 for additional details concerning Mouse Software Interfaces.

1.16.1 Mouse Connector

The mouse connector is a 9 way D type (female) connector located on the left hand side of the case and it has an AMSTRAD specific pinout. Attaching any other manufacturer's hardware (even though the connector may be similar) to the PC1640 mouse connector may cause serious damage to either the main board electronics or to the alternative (mouse) hardware.

The mouse connector pin assignments are as follows:

PinAssignment
1XA [Mouse pinout]
mouse connector
2XB
3YA
4YB
5Spare
6M1
7+5 Volts DC
8GROUND
9M2

The first four pins contain optically encoded phase XA, XB, YA and YB square waves. For positive motion the square wave on the A phase leads the B phase by 90 degrees with the reverse being true for negative motion.

The remaining pins carry Mouse Button 1 (M1), 5V power, Ground and Mouse Button 2 (M2) signals.

[Mouse waveform diagrams]

1.17 Joystick Interface

The AMSTRAD PC supports an industry standard joystick interface. The joystick inputs are handled as keycodes from the keyboard interface. The low level keycodes are in the range of 7C down to 77 (hexadecimal) corresponding to Up, Down, Left, Right, Fire1 and Fire2 respectively. The ROS firmware (See section 2) translates the directional codes to cursor key tokens and the Fire buttons can be assigned variable tokens depending on NVR settings.

1.17.1 Joystick Connector

The joystick connector is a 9 way D type (male) connector with an industry standard pinout. Attaching an incorrect device (even though the connector may be similar) to the PC1640 joystick connector may cause serious damage to either the main board electronics or to the incorrect (joystick) hardware.

The Joystick Socket is located on the rear left corner of the keyboard. Its pinout is as follows:

PinAssignment
1Up [Joystick pinout]
joystick connector
2Down
3Left
4Right
5Spare
6Fire 2
7Fire 1
8Common
9Not Connected


Viewed from rear of keyboard

1.18 Light Pen Connector

The AMSTRAD PC1640 Supports a standard light pen interface via the emulated MC6845. The Light Pen connector is located by removing the expansion slot cover at the rear of the machine. The connector is located inside the PC case on the right hand edge of the main board just forward of the expansion card connectors. It consists of a 6-way berg strip and is labeled PL8 (LIGHT PEN) in large letters. Pin 1 is the forward most pin viewed from in front of the machine (the disk drive end).

The pin assignment is as follows:

PinAssignment
1-Light Pen Input.
2(Keyway)
3-Light Pen Switch.
4Ground.
5+5 Volts DC.
6+12 Volts DC.

[Lightpen pinout]

1.19 Expansion Card Interface

The AMSTRAD PC1512 has three slots for additional peripheral cards. These consist to a set of connectors in the right rear of the main board. The Pin numbering of the each connector is the same and is such that the left (ground plane) side is numbered B1 - B31 top to bottom and the right (component) side is numbered A1 - A31 top to bottom. The following table defines the pin assignments of the expansion interface:

PinSignalIn/Out
A01Not I/O CHCKIn
A02I/O Data Bit D7In/Out
A03I/O Data Bit D6In/Out
A04I/O Data Bit D5In/Out
A05I/O Data Bit D4In/Out
A06I/O Data Bit D3In/Out
A07I/O Data Bit D2In/Out
A08I/O Data Bit D1In/Out
A09I/O Data Bit D0In/Out
A10I/O RDYIn
A11AEN - Address EnableOut
A12I/O + Mem/Address Bit A19Out
A13I/O + Mem/Address Bit A18Out
A14I/O + Mem/Address Bit A17Out
A15I/O + Mem/Address Bit A16Out
A16I/O + Mem/Address Bit A15Out
A17I/O + Mem/Address Bit A14Out
A18I/O + Mem/Address Bit A13Out
A19I/O + Mem/Address Bit A12Out
A20I/O + Mem/Address Bit A11Out
A21I/O + Mem/Address Bit A10Out
A22I/O + Mem/Address Bit A09Out
A23I/O + Mem/Address Bit A08Out
A24I/O + Mem/Address Bit A07Out
A25I/O + Mem/Address Bit A06Out
A26I/O + Mem/Address Bit A05Out
A27I/O + Mem/Address Bit A04Out
A28I/O + Mem/Address Bit A03Out
A29I/O + Mem/Address Bit A02Out
A30I/O + Mem/Address Bit A01Out
A31I/O + Mem/Address Bit A00Out
B01Ground--
B02RESETOut
B03+ 5 Volts DC--
B04IRQ2In
B05- 5 Volts DC--
B06DREQ2In
B07- 12 Volts DC--
B08Not Connected (Reserved)In
B09+ 12 Volts DC--
B10Ground--
B11-MEW (Memory Write)Out
B12-MRD (Memory Read)Out
B13-IOW (I/O Write)Out
B14-IOR (I/O Read)Out
B15-DACK3Out
B16DREQ3In
B17-DACK1Out
B18DREQ1In
B19-DACK0Out
B20CLKOut
B21IRQ7In
B22IRQ6In
B23IRQ5In
B24IRQ4In
B25IRQ3In
B26-DACK2Out
B27T/COut
B28ALEOut
B29+ 5 Volts DC--
B30CK14Out
B31Ground--

[Expansion bus pinout]
Expansion Bus Connector
Viewed from above while standing in front of machine

The I/O expansion slots are laid out the same as the industry standard 16-bit Personal Computer bus. The translation from the internal 16-bit 8086 bus to the 8-bit I/O bus layout is done by main board circuitry. Any 16-bit CPU I/O transfers will be broken down into two 8-bit cycles (with wait states) by this circuitry.

All signals are TTL compatible and can support a maximum of two low-power schottky (LSTTL) loads per slot. Power supply loading per slot should be limited to a maximum of 700 milliamperes on the + 5 Volt supply, to 100 milliamperes on the - 5 Volt supply, to 700 milliamperes on the + 12 Volt supply and to 100 milliamperes on the - 12 Volt supply.

Note that direct access to the on-board 16-bit fast memory bus is not available via the I/O expansion slots.

Additional engineering details for prototyping adapter boards should be supplied as part of the documentation for that particular hardware.

1.20 Video Connector

The video connector is a 9-way D type (female) socket located in the rear of the computer. Its pinout is as follows:

PinAssignment
1Ground [Monitor pinout]
Video Connector
2Secondary Red (r) or Ground (GND)
3Primary Red (R)
4Primary Green (G)
5Primary Blue (B)
6Secondary Green (g) or Intensity (I)
7Secondary Blue (b) or Mono Video (V)
8Horizontal SYNC
9Vertical SYNC

The same pinout is used for all three display types but the interpretation of a particular pin's function varies with the connected device. In addition certain devices require that pin 2 exhibit a full ground characteristic and this is accomplished by switch 8 (sw8) at the rear of the PC1640. When sw8 is in the OFF position pin2 is grounded. When sw8 is in the ON position then the secondary red (r) signal is routed through to pin 2 (See section 1.22 - PC1640 Switch Settings.)

1.21 Power Connector

The power connector is a 14-way Din socket located in the rear of the computer. Power is routed from the power supply located in the monitor to the main board electronics through the power connector. Its pinout is as follows:

PinAssignment
1Not Connected [Power pinout]
Power Connector
20 Volts DC
3+ 5 Volts DC
40 Volts DC
5+ 5 Volts DC
6Not Connected
7Not Connected
80 Volts DC
9- 12 Volts DC
100 Volts DC
11+ 12 Volts DC
120 Volts DC
13- 5 Volts DC
14Not Connected

1.22 PC1640 Display Selector Switch Settings.

The Internal Graphics Adapter initial mode switches are as follows:

sw4 sw3 sw2 sw1 Primary Adapter Secondary Adapter
OFF ON OFF OFF MD (Mono) Internal CGA (CO80) External
OFF ON OFF ON MD (Mono) " CGA (CO40) "
OFF ON ON OFF ECD350 (CO80) " MDA/HERC (Mono) "
OFF ON ON ON * ECD200 (CO80) " MDA/HERC " "
ON OFF OFF OFF * CD (CO80) " MDA/HERC " "
ON OFF OFF ON CD (CO40) " MDA/HERC " "
ON OFF ON OFF CGA (CO80) External MD (Mono) Internal
ON OFF ON OFF CGA (CO40) " MD (Mono) "
ON ON OFF OFF MDA/HERC (Mono) " ECD350 (CO80) "
ON ON OFF ON MDA/HERC " " * ECD200 (CO80) "
ON ON OFF ON MDA/HERC " " * CD CO80 "
ON ON ON ON MDA/HERC " " CD (CO40) "

* See note 3 below.

sw5:
OFF for true EGA mode.
ON for CGA/MDA/HERC emulation modes.
(Also called 6845 compatible modes.)
sw8:
OFF for CD (Standard RGB) Monitors.
ON for ECD (Enhanced RGB) Monitors.

The IGA foreign font switches are as follows:

sw10 sw9 sw7 sw6
OFFOFF -- --English Font
OFF ON ON ONEnglish Font
OFF ONOFFOFFDanish Font
OFF ONOFF ONPortugese Font
OFF ON ONOFFGreek Font

Switches sw6, sw7 and sw10 are used by the IGA BIOS ROM to select an alternate set of characters to be loaded into the IGA fonts RAM for characters in the range of 128 to 255.

Switch sw9 (when set to 'OFF') has the effect of switching off the foreign fonts section of the IGA ROM (in the address range C4000h - C7FFFh). This forces the IGA BIOS to select the english fonts which are stored below address C4000. Switching sw9 to OFF also enables any controller device using this address range to place its controller ROM in the C4000 to C7FFF address space and it will not conflict with the foreign fonts section of the IGA ROM.

The IGA can be switched off by turning sw10 to the 'ON' position. When this is done, switches sw1 to sw5, sw8 and sw9 have no effect and in addition, switches sw6 and sw7 assume a different function in that they are used by the PC1640 ROS for setting the default display mode (DDM) as follows:

sw10 sw9 sw7 sw6
ON --OFFOFFExternal EGA installed.
ON --OFF ONExternal CGA in 40 Column Mode
ON -- ONOFFExternal CGA in 80 Column Mode
ON -- ON ONExternal Monochrome Adapter (MDA or Herc)

Notes:

  1. During bootstrap all messages will be sent to the primary adapter.
  2. In order to switch text output to the secondary adapter the MODE utility is required. The sw1 - sw4 table gives the required MODE parameter enclosed in parenthesis for text output to the device.
  3. The ECD350 and ECD200 switch settings specify whether the default text display will be in high resolution (350 line) mode or in low resolution (200 line) mode. ECD200 appears the same as CD (CO80) in the default text mode. However graphics software may examine the switch settings to determine if 350 line mode is achievable. An incorrect switch setting may cause software to switch the display setup to 350 lines and if a PC-ECD display is not truly fitted, incorrect synchronization will be output. While this may not actually damage the (PC-CD) display the screen will continuously roll and the system may have to be bootstrapped to recover.
  4. Secondary Adapter(s) listed in the sw1 - sw4 table section are optional where they are noted as being external and the respective switch settings merely inform software such as the ROM BIOS and MODE.EXE what the desired setup characteristics will be if the device is sensed as being installed. When the primary adapter is listed as an external device then it is required and system initialization will fail if the device is not installed.

Contents Index Section 2