Centronic printers

Introducton

The Centronics connection is derived from IEE-488 or GPIB bidirectional parallel port that was used between various laboratory devices. It had one full 8bit parallel channels to either direction and full handshaking for both. For some reason this port was downgraded, so that now it lack this original other 8 bit channel. To compensate this amputation the remaining channel was made bidirectional. To compensate this the original PC forgot how to make it work. After that there has been many tries to make it work bidirectionally.


IEE-488 or GPIB port

Forgetting this bidirectionality the LPT or Centronics or parallel port works nice. It send data and handshaking signals to printers and gets handshaking back. Most problems have been generated by the printers. Either they are out of paper or there is a paper jam. There is even speed enough for a normal user.

The need for bidirectional parallel channel rises from the need to drive laboratory (and hobby) devices like external disk drives, plotters, robots, traffic lights, light shows, twin crystal roentgen spectrometers and so on.
There has been variations in printer ports by the manufactures. The best one being IBM itself in PS/2 models before the new EPP and ECP standards. These new models are described by IEEE-1284 standard.

In extreme sittuations there has been need for speed. As the LPT-port has no buffers and in MSDOS uses no IRQ, the printing is totally in the hands of the processor. Besides that the handshaking has been standardised a bit in the slow side. If we spend 500ns before and after the 500ns STROBE pulse, the channel can move max 2MB/sek. That has been fantastic speed for a matrix printer, but new lasers with 1200pixel/inch resolution might need more. Using A4 paper with size 8.26" x 11.69" and printing it bit by bit, you can get a new paper out in 17.4sek. That makes about 5 papers in a minute.
In order to keep the PC responsive actual data rates were on the order of 50KB/S to 150KB/S, because PC processor had to handle all four registers of the port and still be able to make it's homework with keyboard, screen, mouse etc.

In 1284 the hard work of sending data was given to the controller and this enabled data transfer rates of over 1MB/S with reduced host utilization on today's ISA ports and 3-5MB/S on future PCI implementations.

Of course your printer can use PCL or PS language to describe the page. Then you need only send some commands to your printer. Besides that you print only seldom pictures that cover the whole page. Characters are a kind of descriptions of printable spaces.



Centronics D36

D25

Printer connectors You can find a D25 male connector behind your PC. Don't miss it to a possible D25 female in older PC's. That is for RS232 serial connection.



pin19 - 29 = GND, pin 18, 35 = 5V in some printers
Standard printer cable,
an old picture

Centronics D25 Standard Parallel port
From: Pin Name and active state
PC 1 Strobe 500ns LO pulse to tell printer the data is available
PC 2..9 Data XX
LPR 10 Ack, 8ms LO pulse when print is ready to accept mode. Connected to IRQ in PC.
LPR 11 Busy HI when printer needs a little more time
LPR 12 P.End HI (printer out of paper) Affects BUSY too
LPR 13 Printer Select HI (Printer online)
PC 14 Autofeed HI (PC must supply both CF and LF)
LPR 15 Error LO Something wrong in printer
PC 16 Initialize LPR LO (printer reset)
PC 17 Select Input LO(Low=Set online)
Both 18..25 GND

Differences in SPP, ECP and ECP
Pin SPP EPP ECP
1 Strobe Write nStrobe / HostClk
10 Ack Interrupt nAck / PeriphClk
11 Busy Wait Busy / PeriphAck
12 P.End P.End PError / nAckReverse
14 AutoFeed Data Strobe nAutoFeed / HostAck
15 Error Error nFault / nPeriphRequest
16 Init Init nInit / nReverseRequest
17 Select In Address Strobe nSelectIn / 1284Active

Parallel port table from Wikipedia
Pin No (DB25) Pin No (36 pin) Signal name Direction Register - bit Inverted
1 1 *Strobe In/Out Control-0 Yes
2 2 Data0 Out Data-0 No
3 3 Data1 Out Data-1 No
4 4 Data2 Out Data-2 No
5 5 Data3 Out Data-3 No
6 6 Data4 Out Data-4 No
7 7 Data5 Out Data-5 No
8 8 Data6 Out Data-6 No
9 9 Data7 Out Data-7 No
10 10 *Ack In Status-6 No
11 11 Busy In Status-7 Yes
12 12 Paper-Out In Status-5 No
13 13 Select In Status-4 No
14 14 Linefeed In/Out Control-1 Yes
15 32 *Error In Status-3 No
16 31 *Reset In/Out Control-2 No
17 36 *Select-Printer In/Out Control-3 Yes
18-25 19-30,33,17,16 Ground - - -


Data must be valid for 500ns before and after a 500ns Strobe pulse. LPR sets Busy high and then low. If Busy has not come lo in 16 sec, PC gives a timeout.
Printing by polling: PC waits for Busy.
Printing by IRQ: LPR sends a Ack low pulse which causes an IRQ in the PC.
Normally PC doesn't use IRQ while printing, to SPP but MSDOS command 'print' is told to use it. So usually you can use IRQ 5 and 7 for somthing else.


SPP, Standard parallel port

When IBM made their first PC, they contacted Centronics, who was one of the best known printer manufacturers of the time. IBM didn't want to use Centronic's Amphenol 36 connector, but selected a 25 pin D shell connector that was known as DB-25. Since then the printer cable has had male DB-25 connector in the other end and Centronics 36 pin connector in the another.
The cable is unshielded and the wires are straight with no twistings.

EPP port

The EPP connection is essentially the same as SPP. Special differences are that Data lines are bidirectional and data can be used as an address plus that pin 17 is used as a strobe line, when PC wants to send an address. Lines 12 (P.End), 13 (Select), 15 (Error) and 16 (Init) are used to specific needs of the applications.
The cable is special shielded and twisted. The connectors should be shielded by aluminium foil in the both ends. Every ground line got to be separated.

ECP port

ECP is an extension of the EPP design. The first version was published 1992 and has been rewriten many times after that. Both EPP and ECP are backwards compatible with old printers. With new devices ECP can use higher speeds. It has a real protocol and negotiates with the printer about the devices capabilities.
Last versions of ECP can use DMA.

ECP can use RLE data compression up to 128 similas bytes. By using it's own addressing scheme it can address up to 128 different devices


Special use

Parallel port can be used for a general purpose data I/O. In bad old days of MSDOS this was easy. You could command the port by directly reading and writing to the port registers. In the modern date of 'better' operating systems you can not make this. You got to use subsystems of the OS. Even then you got to have rights to do that.
If you have an USB-Centronics cable, the things might be still more complicated. I would recommend you to use special USB I/O cards, if you are building a system, which should work in multiple systems.

Connecting two PC's

Parallel port can be used to connect two PC's as with RS232 to copy data from one to another. With SSP the programs can use 8 bit to another direction and up to 4 to another. To make it symmetric, the programs use 4 bits to both directions and for handshaking the lines that are left over. One of the best known brands is LapLink , who has given his name to a cable that has become a standard. Laplink cable works best between two SPP. Another grand name is PCAnywhere The cables between ECP-ports make the transfer move at top speed. This PC-PC cable connection came with its own programs

Laplink Cable, SPP
Pin, DB-25 #1 Pin, DB-25 #2
1 open
2 15
3 13
4 12
5 10
6 11
7 open
8 open
9 open
10 5
11 6
12 4
13 3
15 2
16 open
18..25 18..25
PC-PC cable, ECP
Pin DB25 #1 connection pin DB-25 #2
1 ------ 10
2 -[1k]- 2
3 -[1k]- 3
4 -[1k]- 4
5 -[1k]- 5
6 -[1k]- 6
7 -[1k]- 7
8 -[1k]- 8
9 -[1k]- 9
10 ------ 1
11 ------ 14
12 ------ 16
13 ------ 17
14 ------ 11
16 ------ 12
17 ------ 13
18..25 ------ 18..25


Future

In the future the printer port might still be faster and sets less load to the PC main processor. For example a new parallel port controller ST78C34 has 83 bytes of FIFO buffer.

In the future Centronics port will disappear. Most new computer come now with USB 1.0 or USB 2.0 connectors and the Centronics port is missing. USB 3.0 is lurking just behind the corner with the awfull new connectors. This is a pity but understandable. USB connector is much cheaper (at least 10 cents) than DB25 to produce and to install on the main board. USB cabling is easier and cheaper to build than Centronics by far. Also the computers are smaller now than before. There is not so much free space in modern laptops.
This future has both positive and negative aspects.

Positive is that the cabling is cheaper and it is easier to connect many devices via a USB hub. Another positive side is that USB has power lines, which were left out from Centronics. It is easier to build devices without power source.

Negative side is that it is rather compilcated to build external devices to an USB port. There just is no simple, cheap and easy way to teach electronics to youngsters or connect laboratory equipement. That is another story


Problems

So far there has been very little problems with the printer port. It is reported that some older printers don't work too well with ECP. The best thing to do is to change the port back to SPP. It can usually be done in The BIOS of the PC. There is some more advice.

There is no Galvanic isolation in the LPT-port. It is possible that there is a voltage between ground lines of the printer and the PC in older buildings. This either makes the link unoperational or destroys the devices in the worst case. You got to take power to your computers from the same connector.

Another source of problems are the other kind of devices than printers. For example external disk drives and scanners. because the SPP is not intended to be used with them, there is no standard how to make a connection. Even if you manage to daisy chain a printer and one device, you can not connect another.
Using the port as ECP or even EPP you get dramatically more speed, but still can not use more devices.

One very common device is ZIP-drive. It can be configured to use SPP, EPP or ECP mode by changing some parameters in the configuration file. Changing is worth the time spent. You can easily get more speed by factor 10x.


Testing printer

You can test your LPR-connector with this device in a case when nothing comes to your printer. If the LED lights up while printing, there is a possibility that your connector and cable is OK. Then the problem lies in your printer
If you want, you can connect a LED to every data line of the connector, but this is the minimun.
With 8 LEDs you can test the individual data lines.
With the first device you can check the cable. With the second you can test the connector in the PC.

Male Centronics -connector: Male D25-connector: Resistors used:
1 - 10
7 -R1- +LED- 19..29
11 - 12 -R2- 19..29
13 - 32 -R3- 31
1 - 10
7 -R1- +LED- 18..25
11 - 12 -R2- 18..25
13 - 15 -R3- 16
R1 = 470
R2 = 1 K
R3 = 1 K


References Warp Nine Engineering Parallel Port Central