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 |
| 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.
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
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
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.
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 |