Tuesday, May 18, 2010

Parallel Port - Overview

The Parallel Port is the most commonly used port for interfacing home made projects. This port will allow the input of up to 9 bits or the output of 12 bits at any one given time, thus requiring minimal external circuitry to implement many simpler tasks. The port is composed of 4 control lines, 5 status lines and 8 data lines.

Newer Parallel Port’s are standardized under the IEEE 1284 standard first released in 1994. This standard defines 5 modes of operation which are as follows,

  • Compatibility Mode.
  • Nibble Mode. (Protocol not Described in this Document)
  • Byte Mode. (Protocol not Described in this Document)
  • EPP Mode (Enhanced Parallel Port).
  • ECP Mode (Extended Capabilities Mode).

Interface details are as follows:

Pin No
(D-Type 25)
Pin No
(Centronics)
SPP SignalDirection In/outRegister
11nStrobeIn/OutControl
22Data 0OutData
33Data 1OutData
44Data 2OutData
55Data 3OutData
66Data 4OutData
77Data 5OutData
88Data 6OutData
99Data 7OutData
1010nAckInStatus
1111BusyInStatus
1212Paper-Out / Paper-EndInStatus
1313SelectInStatus
1414nAuto-LinefeedIn / OutControl
1532nError / nFaultInStatus
1631nInitializeIn / OutControl
1736nSelect-Printer / nSelect-InIn / OutControl
18-2519-30GroundGND-

Program interface:
In versions of Windows that did not use the Windows NT kernel (as well as DOS and some other operating systems), programs could access the parallel port with simple outportb() and inportb() subroutine commands. In operating systems such as Windows NT and Unix (NetBSD, FreeBSD, Solaris, 386BSD, etc), the microprocessor is operated in a different security ring, and access to the parallel port is inhibited, unless using the required driver. This improves security and arbitration of device contention. On Linux, inb() and outb() can be used when a process is run as root and an ioperm() command is used to allow access to its base address.

Unidirectional parallel ports:
In early parallel ports the data lines were unidirectional (data out only) so it was not easily possible to feed data in to the computer. However, a workaround was possible by using 4 of the 5 status lines. A circuit could be constructed to split each 8-bit byte into two 4-bit nibbles which were fed in sequentially through the status lines. Each pair of nibbles was then re-combined into an 8-bit byte. This same method (with the splitting and recombining done in software) was also used to transfer data between PCs using a laplink cable.

No comments:

Post a Comment