[Copyright 2001,2002,2003,2004 Frank Durda IV, All Rights Reserved. Mirroring of any material on this site in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_reference at nemesis.lonestar.org]
In the early 1970s, the printer maker Centronics developed an electrical interface and signal handshake that allowed parallel transmissions to their printers. As this was a fairly simple design, many computer makers of the era adopted it, particularly the computer makers that purchased Centronics printer models and then put their own companies names on them, known as "branding" or "relabeling".
Many competing printer manufacturers also adopted the Centronics interface and handshake, allowing their printers to work on those computer systems that provided Centronics-compatible interfaces.
By 1981, the Centronics interface was universally accepted, and essentially all printers would communicate with a Centronics interface on a host system, or at least had Centronics compatibility available as an option. Computers of that period with Centronics interfaces included all the Tandy/Radio Shack TRS-80 systems, the DEC VAX-11/780 and DECsystem-20, and numerous other large and small computer systems and video terminals.
In August of 1981, IBM and Epson broke the Centronics Interface standard. IBM released the IBM personal computer that August, and to ensure that only IBM printers (at that time, relabeled Epson printers) were used with the IBM PC, these two companies altered the Centronics electrical signals slightly, just enough to make existing Centronics printers not work when connected to the IBM PC. Despite now being incompatible electrically, printers sold by IBM continued to use the same 36-pin "Champ" connector that the Centronics interface used.
The IBM-PC actually provided the parallel printer signals via a DB-25 connector on the computer case, and used a hand-wired cable with a 25-pin subminature "D" connector (also known as a DB-25 connector) on one end and a 36-pin "Champ" connector on the other end.
At the time, IBM didn't dispute the incompatibility that they had created, and instead claimed that they changed the wiring to add functionality. In fact, IBM did add the ability to control whether the printer should perform automatic line feeds (upon receipt of a carriage return character) or not. However, this is a feature that PC-DOS (later MS-DOS) never actually used, nor were there ever any obvious examples of applications that relied on this so-called "feature". Other than remote line-feed control, the IBM-PC added no other printer-specific functionality at the electrical level of the printer interface.
The printer manufacturers quickly responded to what IBM and Epson had done, and they started offering printers that had a switch to select either the Centronics or IBM-compatible host interfaces. Originally, only two signals were handled differently between Centronics and IBM printer interfaces. A few printer models could even automatically detect which type of interface the host had.
Quite a few of the large computer makers completely ignored the IBM-compatible interface, and continued to sell computers that expected a Centronics-compatible printer to be present. However, by 1988, just about every large or small computer maker had given-in and adopted the IBM-compatible interface. This is despite the fact that IBM changed the interface again a year earlier, in order to allow an early form of bi-directional communication between printer and host, even though a few third-party vendors had managed to get some bi-directional data transfers working between two original PCs connected together at the printer port.
The following table provides a summary of the use of each electrical contact in the Centronics and IBM printer interfaces. A detailed discussion of the function of the signals follows.
In this table, Blue indicates lines normally used to send signals from the host computer and to the printer. These are mainly for sending the actual characters to be printed. Orange indicates signals normally sent from the printer to the host computer and are mainly used to indicate printer status. Green indicates ground lines. Due to the TTL signaling used in both the Centronics and IBM printer interfaces, printer cables can generate a lot of unwanted interference and are also susceptible to interference from other devices as well as cross-talk between the various signals in the printer cable.
Also in this table, Yellow indicates signals that convey the data to be printed, Purple indicates printer status signals, while Red indicates signals used to control the transfer of data between host and printer as well as reset the printer.
Printer 36-Pin Connector as used by both Centronics and IBM (Unless stated) | Signal Symbolic Name | Signal Direction | TRS-80 Host 34-Pin DIP/Edge Connector | IBM-PC Host 25-Pin Connector | Signal Function |
1 | STROBE* (aka NOT STROBE) | To Printer | 1 | 1 | When goes LOW for 1.5usec and then HIGH, printer accepts byte from data lines |
2 | Data 0 | To Printer | 3 | 2 | Data Bit 0 (LSB), LOW==0, HIGH==1 |
3 | Data 1 | To Printer | 5 | 3 | Data Bit 1, LOW==0, HIGH==1 |
4 | Data 2 | To Printer | 7 | 4 | Data Bit 2, LOW==0, HIGH==1 |
5 | Data 3 | To Printer | 9 | 5 | Data Bit 3, LOW==0, HIGH==1 |
6 | Data 4 | To Printer | 11 | 6 | Data Bit 4, LOW==0, HIGH==1 |
7 | Data 5 | To Printer | 13 | 7 | Data Bit 5, LOW==0, HIGH==1 |
8 | Data 6 | To Printer | 15 | 8 | Data Bit 6, LOW==0, HIGH==1 |
9 | Data 7 | To Printer | 17 | 9 | Data Bit 7 (MSB), LOW==0, HIGH==1 |
10 | ACK* (aka NOT ACK) | From Printer | 19 | 10 | When LOW, printer has accepted a byte from data lines |
11 | BUSY | From Printer | 21 | 11 | When HIGH, Printer is Busy, do not send more data to printer |
12 | PE | From Printer | 23 | 12 | When HIGH, Printer has an Error Condition |
13 (Centronics) | *BUSY (aka NOT BUSY) | From Printer | 25 | -- | WHEN LOW, Printer is Busy, do not send more data to printer (Inverted copy of BUSY) |
13 (IBM PC) | N/C | N/C | -- | N/C | Not Used |
14 (Centronics) | Ground | Ground | 27 | N/C | Twisted Pair Signal Ground for Fault (32) |
15 (Centronics) | Ground | Ground | 29 | N/C | Ground |
16 | Ground | Ground | 31 | N/C | Ground |
17 (Centronics) | Chassis Ground | Chassis Ground | 33 | N/C | Chassis Ground |
17 (IBM PC) | Not Used | Not Used | -- | N/C | Not Used |
18 (Centronics) | +5 VCC | From Printer | N/C | -- | When HIGH, Printer has power, See Notes |
18 (IBM PC) | SLCT | From Printer | N/C | 13 | When HIGH, Printer is "selected", See Notes |
19 | Ground | Ground | 2 | N/C | Twisted Pair Signal Ground for STROBE* |
20 | Ground | Ground | 4 | N/C | Twisted Pair Signal Ground for Data 0 |
21 | Ground | Ground | 6 | N/C | Twisted Pair Signal Ground for Data 1 |
22 | Ground | Ground | 8 | N/C | Twisted Pair Signal Ground for Data 2 |
23 | Ground | Ground | 10 | 18 | Twisted Pair Signal Ground for Data 3 |
24 | Ground | Ground | 12 | 19 | Twisted Pair Signal Ground for Data 4 |
25 | Ground | Ground | 14 | 20 | Twisted Pair Signal Ground for Data 5 |
26 | Ground | Ground | 16 | 21 | Twisted Pair Signal Ground for Data 6 |
27 | Ground | Ground | 18 | 22 | Twisted Pair Signal Ground for Data 7 |
28 | Ground | Ground | 20 | 23 | Twisted Pair Signal Ground for Ack |
29 | Ground | Ground | 22 | 24 | Twisted Pair Signal Ground for Busy |
30 | Ground | Ground | 24 | 25 | Ground |
31 (Centronics) | PRIME* (aka NOT PRIME) | To Printer | 26 | -- | When LOW, Printer Resets |
31 (IBM PC) | Auto FD XT/FDC* (aka NOT Auto FD) | To Printer | -- | 14 or N/C, See Notes | When LOW, Printer performs automatic Line Feed |
32 | FAULT* (aka NOT FAULT) | From Printer | 28 | 15 | When LOW, Printer has a Fault Condition |
33 (Centronics) | N/C | N/C | -- | -- | N/C |
33 (IBM PC) | INIT* (aka NOT INIT) | To Printer | 30 | 16 | When LOW, Printer Resets |
34 | N/C | N/C | 32 | N/C | Not Used |
35 | N/C | N/C | N/C | N/C | Not Used |
36 (Centronics) | N/C | N/C | N/C | N/C | Not Used |
36 (IBM PC) | SLCTIN* (aka NOT SLCTIN) | To Printer | -- | 17 or N/C, See Notes | Bi-Directional Control, See Notes |
Printer 36-Pin Connector as used by both Centronics and IBM (Unless stated) | Signal Symbolic Name | Signal Direction | TRS-80 Host 34-Pin DIP/Edge Connector | IBM-PC Host 25-Pin Connector | Signal Function |
DIP header connectors and edge connectors both number the contacts by wire-order, in that the first conductor of the ribbon cable goes to pin 1 of the connectors, conductor two goes to pin 2, and so on. However, the 36-pin Champ connector number all the pins down one row of contacts, then continues numbering on the next row of contacts. To some extent, this is because the Champ-style connector predates the introduction of ribbon cabling. The result is that when Champ or DB-25 and DIP or edge connectors are used together on ribbon cabling, pin 1 on the DIP header or edge connector becomes pin 1 on the Champ or DB-25 connector, but pin 2 on the DIP header or edge connector becomes pin 19 on the Champ or DB-25 connector.
All that means is that these Tandy/Radio Shack cables actually use straight-thru wiring, despite the odd look of the numbering, and subsequently are easily-made cables.
The IBM PC printer port numbering reflects IBMs use of a 25-pin DB connector and the subsequent re-arranging of signals that must be done to connect to all of the needed signals to their counterparts, which is typically done in the shell for the 36-pin Champ connector.
When the host transmits data to the printer, it first places an eight-bit byte to be sent on the DATA lines, DATA0 through DATA7. Once those electrical levels are stable, the STROBE* line goes LOW for 1.5 microseconds, plus or minus 500nsec. The printer is alerted to the presence of new data when the STROBE* line goes LOW.
Although Centronics-compatible computers typically used a one-shot timer to ensure that the STROBE* pulsed for the correct minimum amount of time with no other intervention by the host processor, the IBM PC elected to omit the electronics needed to do this, and instead the host processor software should execute an OUT instruction to the printer control port to make STROBE* go LOW, and then execute a second OUT instruction to return STROBE* to a HIGH state. (The data on the DATA lines must remain unchanged until further notice.)
Because different computers operate at different speeds, the timing of STROBE* required by IBM PC compatible printers is quite lax, with some allowing the pulse to be as long as 100msec. Despite this enormous amount of time (compared to the 1.5usec typical), slower IBM PC compatible computer operating systems may have to briefly disable interrupts in the printer driver software in order to perform the two OUT instructions that are needed to control the STROBE* signal on that platform.
When STROBE* goes low, BUSY must be set HIGH by the printer within 500nsec. This is less than the minimum duration of the STROBE* pulse.
The IBM PC/AT Serial/Parallel Printer Adapter design allows the STROBE* signal to be driven by the printer as well as the host, and the host can view the state of the line in case the printer is using the line for bi-directional communication. This capability is not needed for traditional printing operations.
When the host sets the STROBE* line LOW to initiate the transfer of a byte of data to the printer, the printer must immediately raise the BUSY signal. BUSY must go HIGH within 500nsec of STROBE* going low. Typically, when the printer detects the STROBE* line going LOW, it sets BUSY HIGH prior to even reading the data byte from the DATA lines. This is acceptable because the host is forbidden from changing the contents of the DATA lines until the printer indicates that it has read the DATA lines.
Once the printer has read the data byte from the DATA lines, the printer may process that character, perform printing operations, or allow the host to send additional data. Until the printer sets the BUSY line to LOW, the host must not send any additional bytes. There is no limit on how long the BUSY line may remain HIGH, and some slower printers keep the BUSY line high while printing an entire line or even an entire page of text.
The printer may also set the BUSY line to HIGH at any time to prevent new data from being sent to the printer. There is a potential race condition here where the host might examine the BUSY line and find it LOW, but by the time it is able to STROBE a byte of data, the BUSY line has gone HIGH, such as what can happen when the printer is taken off-line manually. To prevent this race condition from losing data, Centronics-compatible printers will accept one more byte of data after setting BUSY high due to a non-data-handshake condition. IBM-PC compatible printers also follow this practice.
In the Centronics interface, a second signal called BUSY* is also available on pin 13. This is an inverted copy of the BUSY signal, and has identical timing. BUSY* is a historical signal, provided to make it easier for marginally-compatible computer systems to be adaptable to working with Centronics printers. Most systems with Centronics-compatible printer interfaces ignore the BUSY* signal, using only the BUSY signal. The IBM PC printer cabling system does not make a connection to pin 13, as only BUSY is used.
Some systems transfer data between host and printer by using only the STROBE* and BUSY signals. On the IBM PC, it is up to the software to use BUSY or ACK* or both in deciding when to transmit the next character of data.
The typical interrupt-driven printer driver will check the printer to see if it is BUSY. If not, a byte of data is placed on the DATA lines and the STROBE signal is set to LOW and then HIGH. The printer driver will then exit. Later, an interrupt caused by the ACK signal going from HIGH to LOW will cause the printer driver to execute again. The printer driver will then repeat the steps of checking the BUSY line and if the printer is not BUSY, sending an additional byte of data to the printer.
If the printer driver finds the printer to be BUSY, then the driver must arrange to be re-executed at some future time to see if the printer is now ready to accept more data. This is called "polling". Most operating systems have internal clocks or wakeup routines that allow a driver to ask to be re-run at some future time.
On systems where the ACK* signal doesn't generate an interrupt or the operating system driver doesn't use the ACK* interrupt, a polling mechanism must be used for all printing activity.
The data lines are set to the values for the character to be transmitted, then the STROBE line is set LOW and then HIGH. The data lines must remain exactly as they were set until the ACK* signal goes LOW and then HIGH, or BUSY goes LOW, whichever is later. Data lines always hold the same state for at least 2.75usec following the ACK* signal.
On IBM-PC and compatible systems, the DATA signals can be used in a bi-directional fashion, in that either the printer or the host can place data on them and it can be seen by the other device. This is accomplished by allowing the DATA lines to pulled-up to a HIGH signal level (2.0VDC or more). Unlike the status and control lines where there is a pull-up resistor available to force each signal to a HIGH state and either party simply pulls the line to ground to make a LOW or "0" state, IBM didn't provide this mechanism on the DATA lines. Instead, if the host wants to send data to the printer, it sets the DATA lines as it normally would to a "1" or "0" state. If the host is expecting data from the printer, it must set the data lines to all "1"s, thus providing the "pull-up" electricity. Any lines that the printer wants to have set to a "0" or LOW state, the printer simply provides a very low-resistance path to ground (less than 27 ohms) on that data line, which pulls the voltage on that data line to 0.8VDC or less, which is considered to be a "0". When the host reads the data port, the host will see the data pattern the printer wished to send to the host, even though the printer only contributed the "0" values. The "1" values were contributed by the host.
There are no standards for how bi-directional communication should be performed on the IBM PC printer interface, so what signals are used for what purpose vary by the application that implements bi-directional communication.
In the IBM PC Serial/Parallel adapter (or compatible designs), the Read/Write Data I/O port is used to place or read data from the DATA lines. These systems use port 0x378 for LPT1 or 0x278 for LPT2.
When the FAULT* signal goes LOW, the printer also sets the BUSY signal to a HIGH state to prevent data from being sent to the printer.
When the PE* signal goes LOW, the printer also sets the BUSY signal to a HIGH state to prevent data from being sent to the printer.
This is frequently the only wire that must be re-positioned in order to allow a computer with a Centronics printer interface to communicate with an IBM PC compatible printer, or IBM PC communicate with Centronics-compatible printer.
For various reasons, some Centronics-compatible host systems tried to use this signal instead to indicate the presence of a printer. If power was present, a printer was present, even if it was not necessarily available at this moment. This thinking is somewhat flawed, because the host operating system really could not behave any differently based on this information. The computer would still have to check for a printer in case one was turned-on or connected after the operating system had made its initial check, since no one would accept a system where you had to shut-down and restart a mainframe computer to which a printer was attached, just because the printer wasn't turned on first the last time the mainframe was started.
The IBM-PC uses the signal on pin 18 of the printer connector as "SLCT", which is supposed to indicate that the printer is selected. However, if you examine the schematics of the typical printer, you will find that the printer simply places +5 on pin 18 at all times (per the Centronics standard), so on IBM PC systems this signal doesn't indicate if the printer is selected or not, it merely indicates that the printer has power. Unlike other signals on the IBM PC printer interface, this signal is not pulled-high, so it should accurately reflect whether electricity is flowing from a connected printer or not.
There is no Centronics equivalent for this signal, as Centronics-compatible printers are not bi-directional.
Although not used in standard print operations, this signal (like some of the others in the IBM PC design), can be used for bi-directional transmissions between devices other than printers, including another computer, provided a cable is used that actually connects this signal to something.
PC-DOS and subsequent MS-DOS operating systems did not utilize this hardware feature, and at some point IBM printer cables (and compatible makers cables) no longer connected pin 14 of the DB-25 connector to pin 31 of the 36-pin connector.
Computer makers who still had Centronics-compatible printers in their lines also did not make this connection, since pin 31 in Centronics printers is used to reset the printer.
The Centronics design required that each DATA line, STROBE*, ACK*, BUSY, PE, and FAULT* all had a twisted-pair ground to help protect the signals from cross-talk. The ground for each signal was on the adjacent wire in the cable, as there were types of ribbon cabling where every two wires were twisted together and those pairs were then shaped into a ribbon. When ribbon-cabling was used, pin 1 would be a signal, pin 2 a ground, pin 3 a signal, pin 4 a ground, and so on, up to FAULT*, which exchanged even and odd wire numbers for signal and ground. In addition, the Centronics printer design included a chassis ground on pin 17.
In the IBM PC printer interface, there were insufficient connections to provide one ground for each signal via the DB-25 connector used on the Serial/Parallel adapter or the Monochrome Graphics/Printer adapter. Instead, a subset of grounds are provided, and two signals that infrequently change (FAULT* and INIT*) are used as pseudo-signal grounds, placing them on lines between signals that would otherwise not have interleaved grounds. This forces all IBM PC compatible printer cables to be assembled by hand.
:<-----2.75usec min--------->: --------\ /----------/ /-------------\ /---------------- DATA LINES | DATA VALID | --------/ \----------/ /-------------/ \---------------- :: --->::<--- 0usec min. (G) --->::<--- 0usec min. (A) : ------------+ +----/ /------------------------------ STROBE* --->| |<--- : 1.5usec +/- 500nsec (B) +---+ : --->::<--- : : : 500nsec max. (C) +-------/ /--------+ : BUSY | : | : -------------+ : +---------------------- : : : --->: :<--- 5usec max. (F) --->: :<--- 5usec max. (E) ---------------------/ /-----+ +------------------- ACK* --->| |<--- 5usec min. (D) +-----+ : : Timing Event Order (A) DATA must be valid prior to STROBE going LOW. (B) STROBE* must go LOW for 1.5usec +/- 500nsec, then go HIGH. (C) BUSY must go HIGH within 500nsec of STROBE going LOW. (D) When the printer is ready to acknowledge the data, ACK* must go LOW for at least 5usec before going HIGH. (E) BUSY must go LOW within 5usec of ACK* going LOW. (F) ACK* must go HIGH within 5usec of BUSY going LOW. (G) DATA may go invalid after ACK goes HIGH.
[Copyright 2001,2002,2003,2004 Frank Durda IV, All Rights Reserved. Mirroring of any material on this site in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_reference at nemesis.lonestar.org]
Visit the nemesis.lonestar.org home page and index