| |
Overview
The printer port, sometimes referred to as the parallel port,
on a PC compatible computer has been part of a PC since the very early
days of the old XT and AT versions which ran operating systems such as
MSDOS and Windows 3.1 on the back of a processor such as a 33MHz 80386 or
80486. Sometimes it was referred to, somewhat incorrectly, as the
Centronics port, which is actually an independent communications interface
designed almost exclusively for printers. Whatever it was called it’s
primary function was to allow printers to be connected to a PC.
Traditionally printers had been connected by a serial communications link
up to that point in keeping with their “cousins” in the mainframe arena of
computing where the main output was text. Text, requiring a very modest
bandwidth of data comms, was well within the spec of the serial link
running at around 9600 baud (bits per second). However, with the rapidly
growing capabilities and speed of dot matrix printers and their ability to
reproduce high-resolution graphics, the serial interface was mostly
dropped in favour of the parallel one. The advantage that the parallel
port had over the serial was that it provided 8 bits of data in “parallel”
(simultaneously) to the printer rather than bit-by-bit like the serial
interface. This gave it an immediate 8-fold increase in data comms speed.
In fact, it was more than 8 when you consider other overheads in serial
data transmission such as start bit, stop bit and parity etc. The only
slight disadvantage was the extra wires required in the connecting cable.
It wasn’t long before PC users realised that this collection of
controllable digital signals was a very useful asset on the PC. What’s
more the signals were a friendly, digital compatible, 5v rather than the
+/- 12v, 24v of RS232 serial links. Also, at this time, it was easier than
ever to use very simple program statements to access these digital signal
lines due to the much simpler nature of the operating systems and the way
in which all of the resources of the PC were available to the programmer
to “twiddle” with. With a bit of attention to
voltage and current
requirements of anything connected to these signal lines, the door was
open to controlling external devices. Thus was born the use of the
parallel port as a control port. In fairness to the PC market, it was, and
is, possible to get all sorts of add-on boards to plug into your PC to
provide all sorts of connection ports to all sorts of devices. However, to
those on a restricted budget, or those just needing a few control lines,
then the expense of an add-on board was unjustified and the parallel port
performed just fine. The discussion below starts with the assumption that
we are talking about the Standard Parallel Port. There are three other
variants on this, which are the Bidirectional Parallel Port (PS/2), the
Enhanced Parallel Port (EPP) and the Extended Capabilities Port (ECP)
whose differences will be discussed separately.
Parallel Port Fundamentals
The Hardware
Lets start with the hardware. The parallel port is implemented as a 25 way
D-Type Socket on the rear of the PC. Even on laptops this standard is
usually maintained. To connect to this you will need a corresponding 25
way plug. These plugs are available from any electronics supplier but they
do have some options. You can choose to use a “solder bucket” type which
allows you to solder individual wires to each of the 25 pins. This is the
most flexible type to prototype.

You can also use a PCB mounting 25 way d-type which is
designed to be soldered to a PCB before plugging into the port. This can
be useful if all you need to do can be done on that PCB and in the
vicinity of the PC.
A third option is to use an IDC type. IDC stands for Insulation
Displacement Connector and refers to the process of making a connection to
the individual cores of a length of ribbon cable without soldering. You
pass the ribbon cable into the connector and clamp the assembly in a vice
for a second. This causes small blades inside the connector to cut through
the plastic insulation on the ribbon cable cores and make contact with the
copper core of the wire. This technique is a very quick way of making a
connection to all 25 cores with one quick clamp in a vice. It is, however,
more difficult to modify once assembled.
Tip: The most crucial
thing to be aware of when assembling an IDC cable is to ensure that the
ribbon cable is perpendicular to the 25 way plug. If it is even slightly
out, you run the risk of adjacent cores being “shorted” together.
The Parallel Port Pinout
The
pin-out is simply the names of the
signals that appear on each of the 25 pins. There is no single answer to
this part of the specifications since there are a number of variations on
the type use of the port. However we shall ignore these variations until
later and focus on the standard basic implementation.
As you can see from the names used, the intended purpose for
a selection of these signals is quite obviously related to a printer. (eg
paper end, auto feed etc…). There is also a group of general purpose data
bits ranging from DataBit0 through DataBit7. These are the signals of
prime importance to the “would be” PC controller.
Also of importance are the Strobe and Acknowledge signals, which act as a
synchronising mechanism for the Data Bits presented (more on that later).
The Parallel Port Electrical Characteristics
It is fundamentally important to know exactly what the
capabilities and limitations are of any electronic signal that is going to
be used for purposes other than the original intent (i.e. driving a
printer). If we are going to use these signals for switching relays (for
example) we need to know the voltage and current requirements of the
relays are going to be met by the parallel port. Although the following
specification is typical for a PC parallel/printer port it cannot be taken
as “set in stone” as far as specific figures are concerned. These will
vary from PC to PC to a certain extent depending on the particular
“chipset” that the manufacturer has used.
<port electrical specification>
As you can see from the specifications the voltage on the
pins is fixed at 5v and the current capability is adequate only for
attached devices with fairly low current requirements. It is common to
have to fit “buffers” or “drivers” of some sort to these outputs to
increase this current capability but more on that later. Lets consider a
simple example of input and output at this stage before presenting ways of
improving it. The circuit below shows switches connected to the input pins
and LED’s connected to the output pins. This is a very useful circuit to
construct whatever you intend to use the port for. It can serve as a test
bed for your software and a quick confirmation that you are “hitting the
right spot” when your programs are accessing the PC’s hardware.

It is highly recommended that you have something like this in
your available attachments to fall back on when something more
sophisticated doesn’t work and your wondering if the problem is with the
hardware or the software.
You have two choices now with this document. If you only have
a requirement for low current input / output then you can move on to the
discussion on Software and how to control the parallel port. Alternatively
you can progress to the discussion on
How to improve the capabilities of
the Parallel Port hardware |
|