Parallel Printer Port information

The output port on the PC is a 25-way D-type female socket:

  13  12  11  10   9   8   7   6   5   4   3   2   1
 ----------------------------------------------------
|  o   o   o   o   o   o   o   o   o   o   o   o   o  |
 \                                                   /
  \  o   o   o   o   o   o   o   o   o   o   o   o  /
    ----------------------------------------------
    25  24  23  22  21  20  19  18  17  16  15  14

The printer lead converts this to a 36-way "Centronics" socket on the printer:

18  17  16  15  14  13  12  11  10   9   8   7   6   5   4   3   2   1
 -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

 -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
36  35  34  33  32  31  30  29  28  27  26  25  24  23  22  21  20  19

The pins are assigned as follows (first column indicates pin numbers on the D-type connector, second column indicates pin numbers on the Centronics connector):

1 1, with ground on 19 STROBE out : normally high, pulsed low for about 1µs to clock the data being output into the printer.
2 2, with ground on 20 DATA 0 out : bit 0 of the ASCII data being output to the printer.
3 3, with ground on 21 DATA 1 out : bit 1 of the ASCII data being output to the printer.
4 4, with ground on 22 DATA 2 out : bit 2 of the ASCII data being output to the printer.
5 5, with ground on 23 DATA 3 out : bit 3 of the ASCII data being output to the printer.
6 6, with ground on 24 DATA 4 out : bit 4 of the ASCII data being output to the printer.
7 7, with ground on 25 DATA 5 out : bit 5 of the ASCII data being output to the printer.
8 8, with ground on 26 DATA 6 out : bit 6 of the ASCII data being output to the printer.
9 9, with ground on 27 DATA 7 out : bit 7 of the ASCII data being output to the printer.
10 10, with ground on 28 ACK in : normally high, pulsed low for about 5µs by the printer to acknowledge it has received and processed the last data byte.
11 11, with ground on 29 BUSY in : normally low, the printer takes this high when it cannot receive data (for example it is initialising, or is processing the last data byte received).
12 12, with ground on 30 PE in : normally low, the printer takes this high when it detects paper has run out.
13 13 SLCT in : the printer takes this high when it is selected (ie. on line).
14 14 AUTOFD out : for the XT computer, if low the printer should line-feed after each line has been printed.
15 32, with ground on 15 ERROR in : normally high, the printer takes this low if it detects an error.
16 31, with ground on 14 INIT out : normally high, taking this low for about 50µs then returning it high will initialise (reset) the printer.
17 36 SLCTIN out : when taken low by the computer, the printer is selected.
18..25 16, 19..30, 33 ground.

The printer ports are accessed using the following I/O ports:

0378H or 037CH (LPT1)
0278H or 027CH (LPT2)
Write: latches data into the output buffer for DATA 7 to DATA 0.
Read: reads the data actually being output on the printer port (should be exactly the same as what was written to the output latch).
0379H or 037DH (LPT1)
0279H or 027DH (LPT2)
Write: has no effect.
Read:
bit 7: reads the printer BUSY output (inverted, so low=busy).
bit 6: reads the printer ACK output (pulsed low).
bit 5: reads the printer PE output (high=out of paper).
bit 4: reads the printer SLCT output (high=printer selected).
bit 3: reads the printer ERROR output (low=error).
bit 2: not used.
bit 1: not used.
bit 0: not used.
037AH or 037EH (LPT1)
027AH or 027EH (LPT2)
Write:
bit 7: not connected.
bit 6: not connected.
bit 5: not connected.
bit 4: interrupt enable, enables ACK input through to a jumper selectable IRQ line (low=enabled, high=high impedance output to IRQ).
bit 3: drives the SLCTIN output (inverted, so high=selected).
bit 2: drives the INIT output (low=reset printer).
bit 1: drives the AUTOFD output (inverted, so high=auto line feed).
bit 0: drives the STROBE output (inverted, so should be pulsed high).
Read:
bit 7: not used.
bit 6: not used.
bit 5: not used.
bit 4: reads back the state of the interrupt enable (high=enabled).
bit 3: reads back the SLCTIN output (inverted, so high=selected).
bit 2: reads back the INIT output (low=printer being reset).
bit 1: reads back the AUTOFD output (inverted, so high=auto line feed).
bit 0: reads back the STROBE output (inverted, so pulses high).

Last updated 31st July 2001, Peter Dziwior.