Contents | Index | Section 2 |
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.
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:
Operation | Wait States | Bus Cycle |
---|---|---|
8-bit (Memory) | 4 | 1.0 uS |
16 to 8-bit convert (Memory) | 12 | 2.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.
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
|
|||
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.
The interfaces on the main board occupy the 8086 I/O addresses as follows:
ADDRESS(hex) | OUTPUT USE | INPUT USE |
---|---|---|
000 - 00F | 8237 DMA Controller | 8237 DMA Controller |
010 - 01F | Do Not Use | Do Not Use |
020 - 021 | 8259 Interrupt control | 8259 Interrupt control |
022 - 03F | Do Not Use | Do Not Use |
040 - 042 | 8253 PIT Load Count (0-2) | 8253 PIT Read Count (0-2) |
043 | 8253 PIT Load Mode | Undefined |
044 - 05F | Do Not Use | Do Not Use |
060 | No Effect | Port A - Keyboard Code or System Status 1 |
061 | Port B - System Control | Port B - (Readback) |
062 | No Effect | Port C - System Status-2 |
063 | No Effect | Do Not Use |
064 | Write System Status-1 | Do Not Use |
065 | Write System Status-2 | Do Not Use |
066 | System Reset | Do Not Use |
067 - 06F | Do Not Use | Do Not Use |
070 | 146818 RTC Address | Do Not Use |
071 | 146818 RTC Data | 146818 RTC Data |
072 - 077 | Do Not Use | Do Not Use |
078 | Clear Mouse X-Coordinate | Mouse X-Coordinate |
079 | Do Not Use | Do Not Use |
07A | Clear Mouse X-Coordinate | Mouse X-Coordinate |
07B - 07F | Do Not Use | Do Not Use |
080 | Do Not Use | Do Not Use |
081 | DMA Page Register Ch 2 | Do Not Use |
082 | DMA Page Register Ch 3 | Do Not Use |
083 | DMA Page Register Ch 0,1 | Do Not Use |
084 - 09F | Do Not Use | Do Not Use |
0A0 | NMI Mask Control | Do Not Use |
0A1 - 0BF | Do Not Use | Do Not Use |
0C0 - 0FF | Reserved | Reserved |
378 | Printer Data Latch | Printer Data Latch |
379 | Do Not Use | Printer Status |
37A | Printer Control Latch | Printer Control Latch |
37B - 37F | Do Not Use | Do Not Use |
3B0 - 3BF | Mono Mode CRTC Registers | Mono Mode CRTC Registers |
3C0 - 3CF | Video Controller Registers | Video Controller Registers |
3D0 - 3DF | Color Mode CRTC Registers | Color Mode CRTC Registers |
3F0 - 3F1 | Do Not Use | Do Not Use |
3F2 | Drive Selection | Do Not Use |
3F3 | Do Not Use | Do Not Use |
3F4 | Do Not Use | 765 FDC Status |
3F5 | 765 FDC Data | 765 FDC Data |
3F6 - 3F7 | Do Not Use | Do Not Use |
3F8 - 3FF | 8250 UART Tx Data/Control | 8250 UART Rx Data/Control |
The 8086 CPU I/O addresses on the expansion bus are as follows:
ADDRESS(hex) | USE |
---|---|
200 - 20F | External Game Control Interface |
210 - 217 | External Bus Expansion Unit |
220 - 24F | Reserved |
278 - 27F | External Printer Port |
2F0 - 2F7 | Reserved |
2F8 - 2FF | External Asynchronous Serial RS232C Port |
300 - 31F | External Prototyping Card |
320 - 32F | External Hard Disk Controller |
380 - 38F | External SDLC Serial RS232C Port |
3A0 - 3AF | Reserved |
3B0 - 3BB | External Monochrome VDU Controller |
3BC - 3BF | Printer Port |
3C0 - 3CF | External Graphics Controller |
3D0 - 3DF | External 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.
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 Channel | USE |
---|---|
0 | 8253 Timer/Counter OUT1 output - for memory refresh. |
1 | Spare for use by expansion bus. Used by external SDLC Serial Port. |
2 | 765 Floppy Disk Controller DRQ output. Available on the expansion bus. |
3 | Spare for use by expansion bus. Used by external Hard Disk Controller. |
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:
Bit | Output Use |
---|---|
7-4 | Not Connected |
3 | Address bit A19 |
2 | Address bit A18 |
1 | Address bit A17 |
0 | Address bit A16 |
Following a reset, system (ROS) initialisation firmware (in the ROS) sets up the 8237 DMA controller for channel 0 (dynamic refresh) operation as follows:
Function | Initialised State |
---|---|
Word Count | 64K 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.
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.
The interrupt levels are assigned as follows:
Level | Assigned Function |
---|---|
NMI | Memory Parity Error and 8087 NDP INT output. |
0 | 8253 Timer/Counter Out0 output. |
1 | Keyboard Scan Code Receiver. |
2 | 146818 Real Time Clock IRQ output. Available on the expansion bus. |
3 | Spare for use by expansion bus. Used by external (secondary) Asynchronous Serial Port and external SDLC Serial Port. |
4 | 8250 UART INTRPT output.
Available on the expansion bus. Used by external SDLC Serial Port. |
5 | Hard Disk Controller. Available on the expansion bus. |
6 | 765 Floppy Disk Controller INT output. Available on the expansion bus. |
7 | Parallel 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.
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.
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:
Bit | Output Use |
---|---|
7 | Enable NMI. |
6 - 0 | Not 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).
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:
Counter | Use |
---|---|
0 | General Purpose Timer. |
1 | Used by DMA channel 0 (for dynamic ram refresh). |
2 | Tone Generation for Speaker. |
The 8253 timers are configured as follows:
Function | Configuration |
---|---|
CLK 0,1,2 | 1.193 MHz +/- 0.1% (54.925493 ms per count) |
GATE 0,1 | Always 'ON'. |
GATE 2 | Controlled via Port B (System Control Channel) Speaker Modulate output. |
OUT 0 | Interrupts on 8259 PIC IR0 input. |
OUT 1 | Requests on 8237 DMA DREQ0 input. |
OUT 2 | Logical 'AND' with Port B (System Control Channel) Speaker Drive output. Also goes to Port C (System Status-2 Channel) as an input. |
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.
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.
The System Control channel is located at I/O Address 061h. Its bit assignment is as follows:
Bit (PBn) | Output Use |
---|---|
7 | Enable Status-1/Disable Keyboard Code on Port A. |
6 | Enable incoming Keyboard Clock. |
5 | Prevent external parity errors from causing NMI. (Also Disable any pending NMI). |
4 | Disable parity checking of on-board system Ram. |
3 | Undefined (Not Connected). |
2 | Enable Port C LSB / Disable MSB. (See 1.8.3) |
1 | Speaker Drive. |
0 | 8253 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.
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-1 | Keyboard Input |
---|---|---|
7 | Always 0. | KBD7 |
6 | Second Floppy disk drive installed. | KBD6 |
5 | DDM1 - Default Display Mode bit 1. | KBD5 |
4 | DDM0 - Default Display Mode bit 0. | KBD4 |
3 | Always 1. | KBD3 |
2 | Always 1. | KBD2 |
1 | 8087 NDP installed. | KBD1 |
0 | Always 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:
DDM1 | DDM0 | Default Display Mode Selected |
---|---|---|
0 | 0 | Internal Graphics Adapter (IGA)
Enabled or Extended Adapter Installed in Expansion Bus. |
0 | 1 | Colour Graphics Adapter Installed
in the Expansion Bus with alpha, 40 X 25 chars, bright white on black. |
1 | 0 | Colour Graphics Adapter Installed
in the Expansion Bus with alpha, 80 X 25 chars, bright white on black. |
1 | 1 | External 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.
Port C is a read only location located at I/O Address 062h. Its bit assignments are as follows:
Bit (PCn) | Input Use | |||||
---|---|---|---|---|---|---|
7 | On-board system RAM parity error. | |||||
6 | External parity error (I/OCHCK from expansion bus). | |||||
5 | 8253 PIT OUT2 output. | |||||
4 | Undefined. | |||||
LSB or MSB (depends on PB2) | ||||||
3 | RAM3 | Undefined | ||||
2 | RAM2 | Undefined | ||||
1 | RAM1 | Undefined | ||||
0 | RAM0 | RAM4 |
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 | |
---|---|---|---|---|---|
0 | 1 | 1 | 1 | 0 | 512K bytes. |
0 | 1 | 1 | 1 | 1 | 544K bytes. |
1 | 0 | 0 | 0 | 0 | 576K bytes. |
1 | 0 | 0 | 0 | 1 | 608K bytes. |
1 | 0 | 0 | 1 | 0 | 640K 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.
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:
Bit | Output Use |
---|---|
7 | No effect. |
6 | PA6 - Second Floppy disk drive installed. |
5 | PA5 - DDM1. |
4 | PA4 - DDM0. |
3 | No effect. |
2 | No effect. |
1 | PA1 - 8087 NDP installed. |
0 | No effect. |
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:
Bit | Output Use |
---|---|
7 | PC2 (MSB) - Undefined. |
6 | PC1 (MSB) - Undefined. |
5 | PC0 (MSB) - Undefined. |
4 | PC3 (MSB) - RAM4. |
3 | PC3 (LSB) - RAM3. |
2 | PC2 (LSB) - RAM2. |
1 | PC1 (LSB) - RAM1. |
0 | PC0 (LSB) - RAM0. |
Since the PC1640 comes with 640K on the main board the expected value of PC3 - PC0 is binary 10010.
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.
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.
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.
The printer data latch is a read/write record at I/O address 378 and its layout is as follows:
Bit (Dn) | Output/Input Use | Cable Polarity |
---|---|---|
7 | Data 7 | Hi |
6 | Data 6 | Hi |
5 | Data 5 | Hi |
4 | Data 4 | Hi |
3 | Data 3 | Hi |
2 | Data 2 | Hi |
1 | Data 1 | Hi |
0 | Data 0 | Hi |
The contents of the data latch are undefined following a power-up or system reset.
The printer control latch is a read/write record at I/O address 37A and its layout is as follows:
Bit | Output/Input Use | Reset State | Cable Polarity |
---|---|---|---|
7 | PC1640 SW7 [RO] | ||
6 | PC1640 SW6 [RO] | ||
5 | OPT (1640)/1 (1512) [RO] | ||
4 | Enable Int on ACK | False | |
3 | Select Printer | False | Low |
2 | Not Reset Printer | True | Low |
1 | Select Auto Feed | False | Low |
0 | Data Strobe | False | Low |
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.
The Printer Status Channel is a read only register at I/O Address 0379h. Its layout is as follows:
Bit | Input Use | Cable Polarity |
---|---|---|
7 | -Printer Busy | High |
6 | -Printer Acknowledge | Low |
5 | Paper Out | High |
4 | Printer Selected | High |
3 | -Printer Error | Low |
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.
LK1 | LK2 | LK3 | ROS Language |
---|---|---|---|
OFF | OFF | OFF | English. |
OFF | OFF | ON | German. |
OFF | ON | OFF | French. |
OFF | ON | ON | Spanish. |
ON | OFF | OFF | Danish. |
ON | OFF | ON | Swedish. |
ON | ON | OFF | Italian. |
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.
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:
Intensity | Red | Green | Blue | Colour |
---|---|---|---|---|
0 | 0 | 0 | 0 | Black |
0 | 0 | 0 | 1 | Blue |
0 | 0 | 1 | 0 | Green |
0 | 0 | 1 | 1 | Cyan |
0 | 1 | 0 | 0 | Red |
0 | 1 | 0 | 1 | Magenta |
0 | 1 | 1 | 0 | Brown |
0 | 1 | 1 | 1 | White |
1 | 0 | 0 | 0 | Grey |
1 | 0 | 0 | 1 | Light Blue |
1 | 0 | 1 | 0 | Light Green |
1 | 0 | 1 | 1 | Light Cyan |
1 | 1 | 0 | 0 | Light Red |
1 | 1 | 0 | 1 | Light Magenta |
1 | 1 | 1 | 0 | Yellow |
1 | 1 | 1 | 1 | Intense 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.
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 |
---|---|
7 | Intensity or Enable Blink (Background) |
6 | Red (Background) |
5 | Green (Background) |
4 | Blue (Background) |
3 | Intensity (Foreground) or Character Map A/B Select |
2 | Red (Foreground) |
1 | Green (Foreground) |
0 | Blue (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.
Reg | r g b | R G B | Color |
---|---|---|---|
0 | 0 0 0 | 0 0 0 | Black |
1 | 0 0 0 | 0 0 1 | Blue |
2 | 0 0 0 | 0 1 0 | Green |
3 | 0 0 0 | 0 1 1 | Cyan |
4 | 0 0 0 | 1 0 0 | Red |
5 | 0 0 0 | 1 0 1 | Magenta |
6 | 0 0 0 | 1 0 0 | Brown |
7 | 0 0 0 | 1 1 1 | White (Grey1) |
8 | 1 1 1 | 0 1 0 | Grey (Grey2) |
9 | 1 1 1 | 0 0 1 | Light Blue |
A | 1 1 1 | 0 0 0 | Light Green |
B | 1 1 1 | 0 1 1 | Light Cyan |
C | 1 1 1 | 1 1 0 | Light Red |
D | 1 1 1 | 1 0 1 | Light Magenta |
E | 1 1 1 | 1 1 0 | (Light) Yellow |
F | 1 1 1 | 1 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.
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.
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.
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:
Colour | Palette 0 | Palette 1 | Palette 2 |
---|---|---|---|
0 | Background | Background | Background |
1 | Green | Cyan | Cyan |
2 | Red | Magenta | Red |
3 | Yellow | White | White |
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 |
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.
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.
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 Mode | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | Text | Text | Text | Text | Graph | Graph | Graph | Text | Graph | Graph | Graph | Graph |
Columns | 40 | 40 | 80 | 80 | 320 | 320 | 640 | 80 | 320 | 640 | 640 | 640 |
Rows | 25 | 25 | 25 | 25 | 200 | 200 | 200 | 25 | 200 | 200 | 350 | 350 |
Colour(s) | 16 | 16 | 16 | 16 | 4 | B/W | 2 | Mono | 16 | 16 | Mono | 16/64 |
Char Cell Size | 8x8 | 8x8 | 8x8 | 8x8 | 8x8 | 8x8 | 8x8 | 9x14 | 8x8 | 8x8 | 9x14 | 8x14 |
Regen Origin | B8000 | B8000 | B8000 | B8000 | B8000 | B8000 | B8000 | B0000 | A0000 | A0000 | A0000 | A0000 |
Regen Size | 32768 | 32768 | 32768 | 32768 | 32768 | 32768 | 32768 | 32768 | 65536 | 65536 | 65536 | 65536 |
Page Size | 2048 | 2048 | 4096 | 4096 | 16384 | 16384 | 16384 | 4096 | 8192 | 16384 | 32768 | 32768 |
Number Pages | 16 | 16 | 8 | 8 | 2 | 2 | 2 | 8 | 8 | 4 | 2 | 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.
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.
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:
Name | Port Address |
---|---|
IGA Extended Mode Control | 3DB/3BB |
Hercules Control Register | 3BF |
Plantronics Control Register | 3DD |
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:
Bit | Output Function |
---|---|
7 | Vsync Polarity, Border Blanking. |
6 | Enable Special Modes. |
5 | Disable Palette and Overscan Registers. |
4 | Lock CRTC Timing Registers. |
3 | Enable Alternate Character Sets on plane 3. |
2 | Disable Blanking. |
1 | Enable 132 Character Mode. |
0 | Enable 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.
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:
Bit | Function |
---|---|
7 - 2 | Not Used. |
1 | Enable Mode Reg Bit 7. (The Full/Half Graphics bit) |
0 | Enable 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 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:
Bit | Function |
---|---|
7 | Not Used. |
6 | Color Plane 0/1 Position. |
5 | Enable Extended color palette 1 |
4 | Enable Extended color palette 2 |
3 - 0 | Not 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.
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:
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.
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.
The EGC Control Register is a write only register which resides at I/O address 3C2. Its format is as follows.
Bit | Function |
---|---|
7 | VSYNC Polarity. |
6 | HSYNC Polarity. |
5 | Alternate (64K) Text page Select. |
4 | External Video Enable. |
3-2 | Clock Rate Select / Switch Sense Select. |
1 | Display RAM Enable. |
0 | CRTC 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.
The EGC Status Register is a read only register which resides at I/O address 3C2. Its format is as follows.
Bit | Function |
---|---|
7 | VSYNC Interrupt Active. |
6 - 5 | Not Used. |
4 | Switch Sense. |
3 - 0 | Not 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) |
||
---|---|---|---|
Bit | 3 | 2 | Bit 4 |
1 | 1 | -Switch 1 | |
1 | 0 | -Switch 2 | |
0 | 1 | -Switch 3 | |
0 | 0 | -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.
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.
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.
The sixteen Palette Registers reside at index positions 00h through 0Fh in the attribute controller and the bit assignments for each is as follows:
Bit | Function | Video Pin |
---|---|---|
7 - 6 | Not Used. | - |
5 | Secondary Red Video | 2 (r) |
4 | Secondary Green/Intensity | 6 (g/I) |
3 | Secondary Blue/Mono Video | 7 (b/V) |
2 | Primary Red | 3 (R) |
1 | Primary Green | 4 (G) |
0 | Primary Blue | 5 (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.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Background Intensity / Enable Blink. |
2 | Enable Line Graphics. |
1 | Display Type. |
0 | Graphics/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.
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.
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:
Bit | Function |
---|---|
7 - 6 | Not Used. |
5 - 4 | Video Status Multiplex (MUX) |
3 | Enable Color Plane 3 |
2 | Enable Color Plane 2 |
1 | Enable Color Plane 1 |
0 | Enable 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 |
0 | 0 | R | B | ||
0 | 1 | r | g | ||
1 | 0 | b | G |
The upper case letters represent the primary colors and the lower case letters represent the secondary colors. The 1, 1 case is not used.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 - 0 | Horizontal 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.
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.
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:
Bit | Function |
---|---|
7 - 3 | Not Used. |
2 - 0 | Sequencer Address (Bits 2 - 0) |
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Dot Clock Rate. |
2 | Shift Register Load. |
1 | Not Used. |
0 | 8/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).
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Write Enable Memory Plane 3. |
2 | Write Enable Memory Plane 2. |
1 | Write Enable Memory Plane 1. |
0 | Write 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.)
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 - 2 | Character Set Select A. |
1 - 0 | Character 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 |
0 | 0 | 0 | 0 | -- | -- |
0 | 0 | 0 | 1 | 00 | 01 |
0 | 0 | 1 | 0 | 00 | 02 |
0 | 0 | 1 | 1 | 00 | 03 |
0 | 1 | 0 | 0 | 01 | 00 |
0 | 1 | 0 | 1 | -- | -- |
0 | 1 | 1 | 0 | 01 | 02 |
0 | 1 | 1 | 1 | 01 | 03 |
1 | 0 | 0 | 0 | 02 | 00 |
1 | 0 | 0 | 1 | 02 | 01 |
1 | 0 | 1 | 0 | -- | -- |
1 | 0 | 1 | 1 | 02 | 03 |
1 | 1 | 0 | 0 | 03 | 00 |
1 | 1 | 0 | 1 | 03 | 01 |
1 | 1 | 1 | 0 | 03 | 02 |
1 | 1 | 1 | 1 | -- | -- |
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 Kb | Char Set 0 | Char set 4 |
8 Kb | Not Used. | Not Used. |
8 Kb | Char Set 1 | Char set 5 |
8 Kb | Not Used. | Not Used. |
8 Kb | Char Set 2 | Char set 6 |
8 Kb | Not Used. | Not Used. |
8 Kb | Char Set 3 | Char set 7 |
8 Kb | Not Used. | Not Used. |
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:
Bit | Function |
---|---|
7 - 3 | Not Used. |
2 | Odd/Even. |
1 | Extended Memory. (1) |
0 | Not 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.
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.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 - 0 | Graphics Address Pointer. |
Bits 0 - 3 select the active register at I/O address 3DF.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Set/Reset Bit 3 |
2 | Set/Reset Bit 2 |
1 | Set/Reset Bit 1 |
0 | Set/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).
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Enable Set/Reset Bit 3 |
2 | Enable Set/Reset Bit 2 |
1 | Enable Set/Reset Bit 1 |
0 | Enable 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.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Color Plane Compare 3. |
2 | Color Plane Compare 2. |
1 | Color Plane Compare 1. |
0 | Color 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.
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:
Bit | Function |
---|---|
7 - 5 | Not Used. |
4 - 3 | Function Select. |
2 - 0 | Rotate 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 0 | Replace Existing Data. |
0 1 | Logical 'AND'. |
1 0 | Logical 'OR'. |
1 1 | Logical '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).
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:
Bit | Function |
---|---|
7 - 2 | Not Used. |
1 - 0 | Read 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 0 | Blue. (Plane 0) |
0 1 | Green. (Plane 1) |
1 0 | Red. (Plane 2) |
1 1 | Intensity. (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.
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:
Bit | Function |
---|---|
7 - 6 | Not Used. |
5 | Shift Register Format. |
4 | Not Used. |
3 | Read Mode. |
2 | Not Used. |
1 - 0 | Write 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 0 | CPU 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 1 | When a CPU write cycle is performed Planes 0 - 3 are written with data from the previous CPU read operation. |
1 0 | Planes 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.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 - 2 | Memory Mapping Mode. |
1 | Enable Odd/Even Chaining. |
0 | Not 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 0 | A000h | 128K Bytes |
0 1 | A000h | 64K Bytes |
1 0 | B000h | 32K Bytes |
1 1 | B800h | 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.
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:
Bit | Function |
---|---|
7 - 4 | Not Used. |
3 | Color Plane 3 No Care. |
2 | Color Plane 2 No Care. |
1 | Color Plane 1 No Care. |
0 | Color 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.
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:
Bit | Function |
---|---|
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.
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.
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).
Bit | Function |
---|---|
7 - 5 | Unused. |
4 - 0 | CRT Controller Address. (00h - 18h) |
Values greater than 18h are not valid and should not be used.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 | Unused. |
6 - 5 | Display 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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 | Even/Odd Starting Address. |
6 - 5 | Horizontal 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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 5 | Unused. |
4 | Line Compare Bit 8. |
3 | Start Vertical Blanking Bit 8. |
2 | Start Vertical Retrace Bit 8. |
1 | Vertical 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.
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:
Bit | Function |
---|---|
7 - 5 | Unused. |
4 - 0 | Row Scan Preset Value. |
Bits 0 - 4 specify the value of the starting row scan count after a vertical retrace.
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:
Bit | Function |
---|---|
7 - 5 | Unused. |
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.
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:
Bit | Function |
---|---|
7 - 6 | Unused. |
5 | Cursor 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.
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:
Bit | Function |
---|---|
7 | Unused. |
6 - 5 | Cursor 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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 0 | Display Start Address. (Low Order Bits) |
This register specifies the 8 low order bits of the display start address value.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 0 | Cursor Location. (Low Order Bits) |
The Cursor Location Low register specifies the 8 low order bits of the cursor location.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 6 | Unused. |
5 | Vertical Interrupt Enable. |
4 | Vertical 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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 5 | Unused. |
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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 - 5 | Unused. |
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.
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:
Bit | Function |
---|---|
7 | H/V Retrace Enable. |
6 | Word/Byte Mode. |
5 | 64K Address Wrapping. |
4 | Not Used. |
3 | Memory Address Count Mode. |
2 | Horizontal Retrace Clock Select. |
1 | Row 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.
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:
Bit | Function |
---|---|
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.
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:
Bit | Function |
---|---|
7 | Not Used (Color) / -VSYNC (Mono). |
6 | EGA Mode. |
5 - 4 | Color Diagnostic. (MUX) |
3 | -VSYNC (Color) / Mono Video. |
2 | Light Pen Switch. (-LPSW) |
1 | Light 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 | ||
0 | 0 | R | B | ||
0 | 1 | r | g | ||
1 | 0 | b | G |
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.
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 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EGC Ctl (3C2) | 23 | 23 | 23 | 23 | 23 | 23 | 23 | A6 | 23 | 23 | A2 | A7 | |
Attribute | (0) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
Controller | (1) | 01 | 01 | 01 | 01 | 13 | 13 | 17 | 08 | 01 | 01 | 08 | 01 |
Registers | (2) | 02 | 02 | 02 | 02 | 15 | 15 | 17 | 08 | 02 | 02 | 00 | 02 |
(3C0) | (3) | 03 | 03 | 03 | 03 | 17 | 17 | 17 | 08 | 03 | 03 | 00 | 03 |
(4) | 04 | 04 | 04 | 04 | 02 | 02 | 17 | 08 | 04 | 04 | 18 | 04 | |
(5) | 05 | 05 | 05 | 05 | 04 | 04 | 17 | 08 | 05 | 05 | 18 | 05 | |
(6) | 06 | 06 | 06 | 06 | 06 | 06 | 17 | 08 | 06 | 06 | 00 | 14 | |
(7) | 07 | 07 | 07 | 07 | 07 | 07 | 17 | 08 | 07 | 07 | 00 | 07 | |
(8) | 10 | 10 | 10 | 10 | 10 | 10 | 17 | 10 | 10 | 10 | 00 | 38 | |
(9) | 11 | 11 | 11 | 11 | 11 | 11 | 17 | 18 | 11 | 11 | 08 | 39 | |
(0A) | 12 | 12 | 12 | 12 | 12 | 12 | 17 | 18 | 12 | 12 | 00 | 3A | |
(0B) | 13 | 13 | 13 | 13 | 13 | 13 | 17 | 18 | 13 | 13 | 00 | 3B | |
(0C) | 14 | 14 | 14 | 14 | 14 | 14 | 17 | 18 | 14 | 14 | 00 | 3C | |
(0D) | 15 | 15 | 15 | 15 | 15 | 15 | 17 | 18 | 15 | 15 | 18 | 3D | |
(0E) | 16 | 16 | 16 | 16 | 16 | 16 | 17 | 18 | 16 | 16 | 00 | 3E | |
(0F) | 17 | 17 | 17 | 17 | 17 | 17 | 17 | 18 | 17 | 17 | 00 | 3F | |
(10) | 08 | 08 | 08 | 08 | 01 | 01 | 01 | 0E | 01 | 01 | 0B | 01 | |
(11) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(12) | 0F | 0F | 0F | 0F | 03 | 03 | 01 | 0F | 0F | 0F | 05 | 0F | |
(13) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 08 | 00 | 00 | 00 | 00 | |
Sequencer | (1) | 0B | 0B | 01 | 01 | 0B | 0B | 01 | 00 | 0B | 01 | 01 | 01 |
Registers | (2) | 03 | 03 | 03 | 03 | 03 | 03 | 01 | 03 | 0F | 0F | 0F | 0F |
(3C5) | (3) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
(4) | 03 | 03 | 03 | 03 | 02 | 02 | 06 | 03 | 06 | 06 | 06 | 06 | |
Grapics | (0) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
Controller | (1) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
Registers | (2) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
(3CF) | (3) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
(4) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(5) | 10 | 10 | 10 | 10 | 30 | 30 | 00 | 10 | 00 | 00 | 00 | 00 | |
(6) | 0E | 0E | 0E | 0E | 0F | 0F | 0D | 0A | 05 | 05 | 05 | 05 | |
(7) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 0F | 0F | 0F | 0F | |
(8) | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF | |
CRTC | (0) | 37 | 37 | 70 | 70 | 37 | 37 | 70 | 60 | 37 | 70 | 60 | 5B |
Registers | (1) | 27 | 27 | 4F | 4F | 27 | 27 | 4F | 4F | 27 | 4F | 4F | 4F |
(3B5/3D5) | (2) | 2D | 2D | 5C | 5C | 2D | 2D | 59 | 56 | 2D | 59 | 56 | 53 |
(3) | 37 | 37 | 2F | 2F | 37 | 37 | 2D | 3A | 37 | 2D | 3A | 37 | |
(4) | 31 | 31 | 5F | 5F | 30 | 30 | 5E | 51 | 30 | 5E | 50 | 52 | |
(5) | 15 | 15 | 07 | 07 | 14 | 14 | 06 | 60 | 14 | 06 | 60 | 00 | |
(6) | 04 | 04 | 04 | 04 | 04 | 04 | 04 | 70 | 04 | 04 | 70 | 6C | |
(7) | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 11 | 1F | 1F | |
(8) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(9) | 07 | 07 | 07 | 07 | 01 | 01 | 01 | 0D | 00 | 00 | 00 | 00 | |
(0A) | 06 | 06 | 06 | 06 | 00 | 00 | 00 | 0B | 00 | 00 | 00 | 00 | |
(0B) | 07 | 07 | 07 | 07 | 00 | 00 | 00 | 0C | 00 | 00 | 00 | 00 | |
(0C) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(0D) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(0E) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(0F) | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | |
(10) | E1 | E1 | E1 | E1 | E1 | E1 | E0 | 5E | E1 | E0 | 5E | 5E | |
(11) | 24 | 24 | 24 | 24 | 24 | 24 | 23 | 2E | 24 | 23 | 2E | 2B | |
(12) | C7 | C7 | C7 | C7 | C7 | C7 | C7 | 5D | C7 | C7 | 5D | 5D | |
(13) | 14 | 14 | 28 | 28 | 14 | 14 | 28 | 28 | 14 | 28 | 28 | 28 | |
(14) | 08 | 08 | 08 | 08 | 00 | 00 | 00 | 0D | 00 | 00 | 0D | 0F | |
(15) | E0 | E0 | E0 | E0 | E0 | E0 | DF | 5E | E0 | DF | 5E | 5F | |
(16) | F0 | F0 | F0 | F0 | F0 | F0 | EF | 6E | F0 | EF | 6E | 0A | |
(17) | A3 | A3 | A3 | A3 | A2 | A2 | C2 | A3 | E3 | E3 | E3 | E3 | |
(18) | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF | FF |
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.
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:
Bit | Output Use |
---|---|
7 | No effect |
6 | No effect |
5 | Enable Blinking Chars (disable intensified backgrounds) |
4 | Select Graphics Mode 2 (de-select graphics mode 1) |
3 | Enable Video Display |
2 | Select Palette 2 (de-select palettes 0,1) |
1 | Select Graphics modes (de-select Alpha modes) |
0 | Select 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.
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:
Bit | Alpha Modes | Graphics Mode 1 | Graphics Mode 2 |
---|---|---|---|
7,6 | No Effect | No Effect | No effect |
5 | No Effect | Select Palette 1 (Deselect palette 0) | No effect |
4 | No Effect | Foreground Intensity for palettes 0, 1 & 2 | No effect |
3 | Intensity (Border) | Intensity (Backgnd and Border) | Intensity (Pixel) |
2 | Red (Border) | Red (Background and Border) | Red (Pixel) |
1 | Green (Border) | Green (Background and Border) | Green (Pixel) |
0 | Blue (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.
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:
Bit | Input Use |
---|---|
7 - 4 | Not used. |
3 | Frame Flyback (VSYNC) Time. |
2 | Light-pen switch open. |
1 | Light-pen latch set. |
0 | Display 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.
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 |
---|---|---|---|---|---|
00 | Horizontal Total (-1) | 56 | 113 | 56 | WO |
01 | Horizontal Displayed | 40 | 80 | 40 | WO |
02 | Horiz. Sync Position | 45 | 90 | 45 | WO |
03 | Horiz. Sync Width | 10 | 10 | 10 | WO |
04 | Vertical Total | 31 | 31 | 127 | WO |
05 | Vertical Total Adjust | 6 | 6 | 6 | WO |
06 | Vertical Displayed | 25 | 25 | 100 | WO |
07 | Vertical Sync Position | 28 | 28 | 112 | WO |
08 | Interlace | 2 | 2 | 2 | WO |
09 | Max. Scan Address | 7 | 7 | 1 | WO |
0A | Cursor Start | 6 | 6 | 6 | WO |
0B | Cursor End | 7 | 7 | 7 | WO |
0C | Start Address High | 0 | 0 | 0 | WO |
0D | Start Address Low | 0 | 0 | 0 | WO |
0E | Cursor Location High | 0 | 0 | 0 | RW |
0F | Cursor Location Low | 0 | 0 | 0 | RW |
10 | Light Pen Posn. High | - | - | - | RO |
11 | Light 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.
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.
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.
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:
Bit | Output Use |
---|---|
7 | No effect |
6 | No effect |
5 | Enable Blinking Chars (disable intensified background) |
4 | No effect |
3 | Enable Video Display |
2 | No effect |
1 | No effect |
0 | No 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.
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:
Bit | Input Use |
---|---|
7 - 4 | Not used (0). |
3 | Video. |
2 - 1 | Not 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.
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 |
---|---|---|---|
00 | Horizontal Total (-1) | 97 | WO |
01 | Horizontal Displayed | 80 | WO |
02 | Horiz. Sync Position | 82 | WO |
03 | Horiz. Sync Width | 15 | WO |
04 | Vertical Total (-1) | 25 | WO |
05 | Vertical Total Adjust | 6 | WO |
06 | Vertical Displayed | 25 | WO |
07 | Vertical Sync Position | 25 | WO |
08 | Interlace | 2 | WO |
09 | Maximum Scan | 13 | WO |
0A | Cursor Start | 11 | WO |
0B | Cursor End | 12 | WO |
0C | Start Address High | 0 | WO |
0D | Start Address Low | 0 | WO |
0E | Cursor Location High | 0 | RW |
0F | Cursor Location Low | 0 | RW |
10 | Light Pen Address High | - | RO |
11 | Light Pen Address Low | - | RO |
Setting bit 5 in register 0Ah turns the cursor off. Bit 6 in 0Ah selects alternate blink rate.
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.
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:
Bit | Output Use |
---|---|
7 | Display Page Select. |
6 | No effect. |
5 | Enable Blinking Chars (disable intensified background) |
4 | No effect. |
3 | Enable Video. |
2 | No effect. |
1 | Text/Graphics Mode Select. |
0 | No 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))
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:
Bit | Input Use |
---|---|
7 | -Vertical SYNC. |
6 - 4 | Not used (0). |
3 | -Mono Video. |
2 - 1 | Not 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).
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 |
---|---|---|---|---|
00 | Horizontal Total (-1) | 97 | 53 | WO |
01 | Horizontal Displayed | 80 | 45 | WO |
02 | Horiz. Sync Position | 82 | 46 | WO |
03 | Horiz. Sync Width | 15 | 7 | WO |
04 | Vertical Total (-1) | 25 | 91 | WO |
05 | Vertical Total Adjust | 6 | 2 | WO |
06 | Vertical Displayed | 25 | 87 | WO |
07 | Vertical Sync Position | 25 | 87 | WO |
08 | Interlace | 2 | 2 | WO |
09 | Maximum Scan | 13 | 3 | WO |
0A | Cursor Start | 11 | 0 | WO |
0B | Cursor End | 12 | 0 | WO |
0C | Start Address High | 0 | 0 | WO |
0D | Start Address Low | 0 | 0 | WO |
0E | Cursor Location High | 0 | 0 | RW |
0F | Cursor Location Low | 0 | 0 | RW |
10 | Light Pen Position High | - | - | RO |
11 | Light 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.
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 - 6 | No effect |
5 | Switch motor(s) on and enable drive 1 selection |
4 | Switch motor(s) on and enable drive 0 selection |
3 | Allow 765A FDC to interrupt and request DMA |
2 | - 765A reset |
1 | Drive Select Bit 1 (DS1) |
0 | Drive 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.
The hardware imposes the following conditions on the use of the 765A controller and disk drives:
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.
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.
Pin | EIA | CCITT | Description |
---|---|---|---|
2 | BA | 103 | TxD - Serial Data Output |
3 | BB | 104 | RxD - Serial Data Input |
* 4 | CA | 105 | RTS - Request to Send Output |
5 | CB | 106 | CTS - Clear to Send Output |
6 | CC | 107 | DSR - Data Set Ready Input |
7 | AB | 102 | Signal Ground (Common Return) |
8 | CF | 109 | DCD - Data Carrier Detect Input |
* 20 | CD | 108.2 | DTR - Data Terminal Ready Output |
22 | DE | 125 | 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.
See Appendix 4 for additional details of serial signals and cable connections.
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:
Pin | Assignment |
---|---|
1 | Not Data Strobe |
2 | Data Bit 0 |
3 | Data Bit 1 |
4 | Data Bit 2 |
5 | Data Bit 3 |
6 | Data Bit 4 |
7 | Data Bit 5 |
8 | Data Bit 6 |
9 | Data Bit 7 |
10 | Not Printer Acknowledge |
11 | Printer Busy |
12 | Paper Out |
13 | Select Printer |
14 | Not Select Auto Feed |
15 | Not Printer Error |
16 | Not Reset Printer |
17 | Not Printer Selected |
18 | GND |
19 | GND |
20 | GND |
21 | GND |
22 | GND |
23 | GND |
24 | GND |
25 | GND |
Appendix 5 contains the Amstrad PL-2 printer lead specification for the DMP3000 printer.
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.
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.
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.
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.
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.
The Keyboard connector is a 6-way Din socket. The pin assignment is as follows:
Pin | Assignment | |
---|---|---|
1 | KBCLK |
Viewed from left hand side of machine
|
2 | KBDATA | |
3 | M1 (Mouse Button 1) | |
4 | GND | |
5 | +5 Volts DC | |
6 | M2 (Mouse Button 2) |
The M1 and M2 signals are connected directly to the keyboard controller in order to produce keycodes.
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.
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:
Pin | Assignment | |
---|---|---|
1 | XA |
mouse connector
|
2 | XB | |
3 | YA | |
4 | YB | |
5 | Spare | |
6 | M1 | |
7 | +5 Volts DC | |
8 | GROUND | |
9 | M2 |
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.
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.
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:
Pin | Assignment | |
---|---|---|
1 | Up |
joystick connector
|
2 | Down | |
3 | Left | |
4 | Right | |
5 | Spare | |
6 | Fire 2 | |
7 | Fire 1 | |
8 | Common | |
9 | Not Connected |
Viewed from rear of keyboard
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:
Pin | Assignment |
---|---|
1 | -Light Pen Input. |
2 | (Keyway) |
3 | -Light Pen Switch. |
4 | Ground. |
5 | +5 Volts DC. |
6 | +12 Volts DC. |
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:
Pin | Signal | In/Out |
---|---|---|
A01 | Not I/O CHCK | In |
A02 | I/O Data Bit D7 | In/Out |
A03 | I/O Data Bit D6 | In/Out |
A04 | I/O Data Bit D5 | In/Out |
A05 | I/O Data Bit D4 | In/Out |
A06 | I/O Data Bit D3 | In/Out |
A07 | I/O Data Bit D2 | In/Out |
A08 | I/O Data Bit D1 | In/Out |
A09 | I/O Data Bit D0 | In/Out |
A10 | I/O RDY | In |
A11 | AEN - Address Enable | Out |
A12 | I/O + Mem/Address Bit A19 | Out |
A13 | I/O + Mem/Address Bit A18 | Out |
A14 | I/O + Mem/Address Bit A17 | Out |
A15 | I/O + Mem/Address Bit A16 | Out |
A16 | I/O + Mem/Address Bit A15 | Out |
A17 | I/O + Mem/Address Bit A14 | Out |
A18 | I/O + Mem/Address Bit A13 | Out |
A19 | I/O + Mem/Address Bit A12 | Out |
A20 | I/O + Mem/Address Bit A11 | Out |
A21 | I/O + Mem/Address Bit A10 | Out |
A22 | I/O + Mem/Address Bit A09 | Out |
A23 | I/O + Mem/Address Bit A08 | Out |
A24 | I/O + Mem/Address Bit A07 | Out |
A25 | I/O + Mem/Address Bit A06 | Out |
A26 | I/O + Mem/Address Bit A05 | Out |
A27 | I/O + Mem/Address Bit A04 | Out |
A28 | I/O + Mem/Address Bit A03 | Out |
A29 | I/O + Mem/Address Bit A02 | Out |
A30 | I/O + Mem/Address Bit A01 | Out |
A31 | I/O + Mem/Address Bit A00 | Out |
B01 | Ground | -- |
B02 | RESET | Out |
B03 | + 5 Volts DC | -- |
B04 | IRQ2 | In |
B05 | - 5 Volts DC | -- |
B06 | DREQ2 | In |
B07 | - 12 Volts DC | -- |
B08 | Not Connected (Reserved) | In |
B09 | + 12 Volts DC | -- |
B10 | Ground | -- |
B11 | -MEW (Memory Write) | Out |
B12 | -MRD (Memory Read) | Out |
B13 | -IOW (I/O Write) | Out |
B14 | -IOR (I/O Read) | Out |
B15 | -DACK3 | Out |
B16 | DREQ3 | In |
B17 | -DACK1 | Out |
B18 | DREQ1 | In |
B19 | -DACK0 | Out |
B20 | CLK | Out |
B21 | IRQ7 | In |
B22 | IRQ6 | In |
B23 | IRQ5 | In |
B24 | IRQ4 | In |
B25 | IRQ3 | In |
B26 | -DACK2 | Out |
B27 | T/C | Out |
B28 | ALE | Out |
B29 | + 5 Volts DC | -- |
B30 | CK14 | Out |
B31 | Ground | -- |
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.
The video connector is a 9-way D type (female) socket located in the rear of the computer. Its pinout is as follows:
Pin | Assignment | |
---|---|---|
1 | Ground |
Video Connector
|
2 | Secondary Red (r) or Ground (GND) | |
3 | Primary Red (R) | |
4 | Primary Green (G) | |
5 | Primary Blue (B) | |
6 | Secondary Green (g) or Intensity (I) | |
7 | Secondary Blue (b) or Mono Video (V) | |
8 | Horizontal SYNC | |
9 | Vertical 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.)
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:
Pin | Assignment | |
---|---|---|
1 | Not Connected |
Power Connector
|
2 | 0 Volts DC | |
3 | + 5 Volts DC | |
4 | 0 Volts DC | |
5 | + 5 Volts DC | |
6 | Not Connected | |
7 | Not Connected | |
8 | 0 Volts DC | |
9 | - 12 Volts DC | |
10 | 0 Volts DC | |
11 | + 12 Volts DC | |
12 | 0 Volts DC | |
13 | - 5 Volts DC | |
14 | Not Connected |
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.
The IGA foreign font switches are as follows:
sw10 | sw9 | sw7 | sw6 | |
---|---|---|---|---|
OFF | OFF | -- | -- | English Font |
OFF | ON | ON | ON | English Font |
OFF | ON | OFF | OFF | Danish Font |
OFF | ON | OFF | ON | Portugese Font |
OFF | ON | ON | OFF | Greek 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 | -- | OFF | OFF | External EGA installed. |
ON | -- | OFF | ON | External CGA in 40 Column Mode |
ON | -- | ON | OFF | External CGA in 80 Column Mode |
ON | -- | ON | ON | External Monochrome Adapter (MDA or Herc) |
Notes:
Contents | Index | Section 2 |