Subject: comp.periphs.printers - FAQ - Part 4 of 11
Version: 3.09
Last-Modified: 1997/01/05
Summary: This posting contains a list of Frequently Asked
         Questions (and their answers) about printers and
         should be read by anyone wishing to post to the
         comp.periphs.printers newsgroup.
Posting-Frequency: monthly
Date: Sun, 5 Jan 1997 05:26:13 GMT
Archive-Name: comp-periphs-printers-faq

Subject: 04 Printer Interfaces

_______________

Subject: 04.01 Centronics (parallel) Interface

The Centronics interface transfers data in a parallel fashion
to a printer. As opposed to a serial cable that only sends data
down one wire, the parallel protocol sends data down 8 wires at
once, thus being generally much faster. The standard interface
is only able to transfer data in one direction the "communication"
in the reverse direction is done by status lines, e.g. paper error
or busy), but there is a newer specification called Bi-Tronics
(from HP) with bidirectional communication and higher transfer rates.

This interface is typically used for connecting a printer to a PC
(with any OS) or a workstation, since the cable is very limited
in length.

If you want the gory details, you can order the spec from the
IEEE. Call 1-800-701-4333 and ask for document # SH17335.
$56.50 plus $6.00 UPS ground shipping (From an article posted
by <customer@quake.net>, dated 18 Apr 1995).

Basically, IEEE-1284 specifies the timing and protocol for
several modes, including compatibility ("Centronics"), nibble
(the reverse-channel part of HP's Bi-Tronics), and ECP (a fast,
parallel bi-directional interlocked handshake). ECP should be
able to transfer data in either direction at speeds approaching
2 MB/sec.

IEEE-1284 also specifies the electrical interface and cable
length properties, and allows for cable lengths up to 10 meters.
With pre-1284 specs (e.g. by HP) the maximum length was 3 meters.

The parallel connection may well work with longer cables (I have
heard of 15 to 20 meters), but it very much depends on the setup
(electrical wires near the cable may cause noise on the cable,
power of the +5 volt supply, sensitivity of the printer's input
decoder and so on). If you need a longer cable, you should
consider using either a serial connection (RS232 or RS422) or a
parallel repeater or extender kit.

In either case the maximum length is limited by IEEE-1284 since
the maximum propagation delay of the cable must be less that 58 ns.
When calculating with the speed of light this would result in a
theoretical maximum length of about 17 meters.

Parallel interfaces run anywhere from less than 25 kbps to greater
than one megabyte/sec, the high end is seen in newer PC's with ports
supporting ECP/EPP/IEEE1284.

_______________

Subject: 04.02 RS232 (serial) Interface

The RS232 "standard" is one of those wonderful computer things
everyone talks about and uses, but hardly anyone understands.
This is a new attempt at explaining it, based upon the previous
text, but with some more data about pinouts and other information.

The RS232 serial interface transfers asynchronous data bit by
bit, one at a time. The bytes are separated from each other by
one start bit and one or two stop bits. Besides the data lines
this interface defines a couple of control lines between the
two devices (see diagram below).  This interface is able to
transfer data simultaneously in both directions, allowing for
printer status or error messages to be easily passed back to
the computer.

The RS232 standard defines two types of equipment, DTE (computer,
terminal, most printers) and DCE (some printers, modems). When
connecting two DTE's you would need a null-modem cable, that is
a cable which swaps TxD and RxD around and connects some control
lines on both sides. The type of cable needed, especially which
pins must be connected with each other, depends on the devices
you want to connect. Note that some devices don't support all
control lines.

There exist different connectors for the RS232 serial line. The
standard type is called DB-25 (two lines of pins, one with 12 and
the other one with 13 pins). There is another type called DB-9 (e.g.
the HP LaserJet 4P is equipped with this type), this connector
doesn't support all control lines, but it may well be connected
with a DB-25 connector on the computer side.

And here are the pinouts for both DB-25 and DB-9 connectors (pins
not mentioned are unused). The first number given is for the DB-25
type, the second number in parentheses is for the DB-9 type if
supported. The text describes the common name for the pin and the
signal direction from the device in question.

  1 (-)  Frame Ground (DB-9 type: use the connectors box instead)
  2 (2)  TxD: Transmitted Data (out)
  3 (3)  RxD: Received Data (in)
  4 (1)  RTS: Request To Send (out)
  5 (-)  CTS: Clear To Send (in)
  6 (4)  DSR: Data Set Ready (in)
  7 (5)  Signal Ground
  8 (-)  DCD: Data Carrier Detected (in)
 19 (-)  Reverse Channel (out)
 20 (8)  DTR: Data Terminal Ready (out)

Finally the pinout for a null-modem cable (with TxD and RxD
swapped). In this diagram only the DB-25 pins are mentioned
(use the pinout above for a DB-9 cable).

   1 __ Frame Ground __ 1
   2 __  TxD -> RxD  _> 3
   3 <_  RxD <- TxD  __ 2
   4 -+     connect      +- 4
   5 <+    RTS & CTS     +> 5
   7 __ Signal Grnd. __ 7
   6 <+     connect      +> 6
   8 <+    DSR & DCD     +> 8
  20 -+     with DTR     +- 20

Note: when using this cable type (all control lines disabled)
the computer can't determine whether the printer is on or off.
Well, at least by means of the resp. control line; it is
possible to check the printer state by using ETX/ACK
handshake protocol. On the other hand some systems have
problems when you connect the control lines correctly and the
printer is off at boot time. (The system thinks that there is
no serial line. There are some UNIX systems that block the
open() system call until the printer is switched on.

Typical data transfer rates (for printer connections) are 9600
baud, 19200 baud and 38400 baud (baud is bits per second).
Theoretically this interface may transfer data with up to
115200 baud (this is the maximum speed newer UART's can do, but
with many systems you can't select this speed in a standard way -
it's often necessary to program the UART by yourself). Although
I'm told that the Lexmark IBM 4039 and Lexmark Optra printers
support this speed, I haven't seen it with my own eyes. :)

_______________

Subject: 04.02.01 Connecting an Apple LaserWriter to a PC

Thanks to Tibor Pelan, we now know that there's a web page 
with the necessary information for making yourself a cable 
to connect your Apple LaserWriter to a PC using the serial 
port.

<http://www-cs.intel.com/enduser_reseller/netport_print_servers/6021.HTM#3>

The document describes the cable pinout and switch settings
on several printers for use with Intel's NetPort Express.
I don't have a LaserWriter anymore, so I can't doublecheck
this, but I think the cable they describe should work fine
with for connecting directly to your PC.

_______________

Subject: 04.03 RS422 (serial) Interface

The RS422 serial interface transfers synchronous data in blocks
of bytes each of which begins with a synchronize byte and
ends with a final character. For synchronization a sync line is
supplied. There are separate lines for data transfer in each
direction with two lines for each direction with complementary
polarity. This interface is typically used for AppleTalk
connections.

Transfer rates are up to 230.4 Kbaud for a 300 meter (~328.08
yard) cable. The maximum length is up to 1200 meters.

_______________

Subject: 04.04 HP-IB (parallel) Interface

HP-IB ("Hewlett-Packard Interface Bus") alias GP-IB ("General
Purpose IB") alias IEEE-4888. Old and largely outdated interface
created by HP and used for printers, plotters, disks, tape drives
and measurement devices of various kinds, mostly by HP computers
(HP3000 and HP9000 series, though not standard in current models),
available also for PCs. Today used mainly for measurement devices,
but HP-IB printers may still turn up in surplus sales. Using one
in a PC requires either an HP-IB card or a parallel/HP-IB converter,
both of which are hard to find and may cost more than the peripheral
device. The connector resembles Centronics but locks with screws
rather than clips.

_______________

Subject: 04.05 HP-IL (serial) Interface

HP-IL ("Hewlett-Packard Interface Loop"), was created by HP
for their handheld and portable computers and calculators.
Abandoned by HP a few years back, but HP-IL printers, notably
the HP2225B ThinkJet, still turn up occasionally. It can be
recognized by two small, rounded, trapezoidal-shaped connectors
with two pins each. An HP-IL card for ISA-based PCs exists but
is very hard to find these days, so if you find such a printer
it's probably best to sell it to someone with an old HP-IL-based
HP computer (HP41, HP71B, HP75 and HP-110 at least).

_______________

Subject: 04.06 SCSI Interface

SCSI (Small Computer Systems Interface) is best known as a mass
storage interface, but SCSI-based printers also exist, including
at least one Apple LaserWriter model and some really big and fast
mainframe-class printers that can handle 100-200 ppm or more (at
least Siemens and HP have such).

_______________

Subject: 04.07 Infrared Interface

Infrared interfaces have been used mainly in printers for HP
calculators, but recently such have been announced for laptops
as well, including an infrared-Centronics converter, so it may
become more important in the future.

An organization called the Infrared Data Association (IrDA)
has produced specification that are being adopted as industry
standards. Several laptop and PDA vendors have come out with
models supporting the IrDA specs, and many more manufacturers
appear to be waiting in the wings. The IrDA spec provides for
fully bi-directional communications at distances of 1 meter,
at speeds up to 115,200 bits per second. An enhanced
specification with much higher speeds is currently under proposal.

Recently (at the 1995 CeBIT trade show in Hannover, Germany) HP
presented the new HP LaserJet 5P and 5MP models with an IrDA-
compatible interface. Presumably other printer companies will
follow soon.

_______________

Subject: 04.08 Network Interfaces

Network interfaces directly built into a printer are the most
efficient way to transfer print jobs from any host in a network
(LAN) to the printer. If the network is set up accordingly you
may send print jobs from any host to the printer (with serial or
parallel connected printers you have to route your print job to
the host the printer is connected to). Standard connectors are
10base2, 10baseT and 10base5 (also called AUI).

In addition to the basic Ethernet connections, there are also 4Mb
and 16Mb Token Ring (both STP and UTP) as well as LocalTalk.

Your network interface must support a communication method that
is compatible with your network operating system(s). Examples
include TCP/IP, AppleTalk, SPX/IPX, and DLC (a lower level
interface frequently used in IBM LAN Server/MS LAN Manager/NT
AS environments).

The maximum transfer speed depends on the network type (4, 10, 16
Mbit or 100 Mbit or more) and on the processing speed of the
printer. With network interfaces you may well reach the maximum
possible printer throughput, this is normally not the case with
serial interfaces and maybe even not with parallel interfaces.

_______________

Subject: 04.09 Interface Convertors

For connecting devices with different interfaces you may use a
converter that maps one interface to another. It is possible
to convert a serial RS232 interface into a Centronics parallel
interface, or to convert a serial RS422 interface into a serial
RS232 interface. Commercial solutions for these converters are
available.

It is also possible to connect a printer without network
interface to a network by means of a printer server. The best
choice is a converter from network interface to a parallel
interface (at least if you don't need bidirectional
communication) since then you have the maximum possible
throughput. With a converter to a serial interface you on the one
hand lose transfer performance, but on the other hand you may get
data back from the printer. In both cases you have the advantage
that you can place the printer anywhere in your local network
(typically near you), with a serial or parallel interface it's
normally necessary to place the printer nearby the host it is
connected to.

_______________

=====
End of Part 4 of 11
