Lakeview Research home > Parallel Port Central

Parallel Port Central

A collection of files and links to material about the PC's parallel port,
including ECP, EPP, bidirectional, and IEEE-1284 modes (and other I/O ports as well).

brought to you by Jan Axelson

Basics | ECP & EPP | Hardware | Troubleshooting | Connecting 2 PCs

Using Printers | Programming | Books

Parallel Port CompleteParallel Port Complete

For all you ever wanted to know about the parallel port, order a copy of Parallel Port Complete. Read Chapter 1 on-line.

The Basics

Enhanced and Extended Ports

Including the bidirectional (PS/2) port, extended capabilities port (ECP), and enhanced parallel port (EPP), and the IEEE-1284 standard that descibes them all.

General Information

Hardware

Boards

Chips

The data sheets for parallel-port controller chips include timing diagrams, register assignments, and other useful details about accessing and using the new modes. PC-side chips are for use in PCs; peripheral-side chips are for use in peripherals.

Cables

Troubleshooting

Connecting Two PCs

Connecting two PCs via their parallel ports requires a special cable. For software, you can use Windows 95/98's Direct Cable Connection, a third-party product, or write your own program to do the transfers. To find out about Direct Cable Connection, click F1 on the desktop and search for Direct Cable Connection.

About Using Printers

Various Projects

Projects that use the parallel port or an I/O chip like the 8255 Parallel Peripheral Interface chip.

Programming

There are various ways for applications to access the parallel port and other I/O ports in PCs, including directly accessing port addresses, communicating with a driver that accessing port addresses and using Windows' built-in drivers.

Under Windows 3.x/95/98/Me, applications can read and write directly to port addresses. Use your compiler's built-in functions (inp and out or similar) or in-line assembly code. (See the source code in my inpout32.zip below for an example.) This method is simple, but it's slow, it can't protect the port from access by other applications, and it doesn't work at all under Windows NT/2000/Xp. If you use Visual Basic or another language that doesn't have functions for port I/O or allow in-line assembly code, you can use a DLL or a custom control that adds port I/O functions to an application.

A system-level device driver enables faster port access and can manage access by multiple applications. Driver types include VxD (virtual device driver) for Windows 9x/Me, WDM for Windows 98/NT/2000/Me/Xp, and kernel-mode driver for Windows NT/2000/Xp. Hardware interrupts must use a system-level driver under Windows 9x/NT/2000/Me/Xp. If you don't want to write your own driver, there are custom controls and other tools that enable applications to access ports and respond to interrupts via a driver.

A third way to access ports is to use the drivers included with Windows. Windows 3.x/9x/NT have no functions for generic port access, only functions tied to specific uses. For example, there are API calls for accessing printers and for accessing serial ports controlled by UARTs. In Visual Basic, the Printer object and MSComm control are other options for parallel and serial-port access. Built-in functions and controls like these are usually the best solution when their abilities match what you're trying to accomplish.

Windows 2000/Xp add improved drivers for accessing parallel-port devices with support for SPP, PS/2 (Byte), EPP, and ECP modes and daisy-chaining. Parclass is a system class driver for parallel-port devices, and Parport is a system function driver for the parallel port. The Windows DDK has details. Search for Parallel Devices and Drivers in the documentation index.

Below are links to tools that you can use for port access. I've grouped them according to which operating systems they're supported in. The list includes freeware, shareware, and commercial products.

Programming Tools for Port I/O and Interrupts

For Windows 95/98/NT/2000/Me/Xp

For Windows 95/98/Me Only

For Windows NT/2000/Xp Only

16-bit-only Tools

Use these with products such as Visual Basic 3 or 16-bit Visual Basic 4 under Windows 3.x.

For 16- and 32-bit Programs (Windows 3.x, Windows 95/98)

Other Driver Information and Sources

Linux

Books about Parallel Port Hardware and Programming

Here are links to a variety of books about parallel port hardware and programming. The titles are listed alphabetically, except for my book, which is first. :)

Parallel Port Complete: Programming, Interfacing, and Using the PC's Parallel Printer Port
Jan Axelson
1996, Lakeview Research
343 pages, $39.95
Covers all of the port's modes and how to use them in custom applications.

Build Your Own Low-Cost Data Acquisition and Display Devices
by Jeffrey Hirst Johnson
1993, McGraw Hill/TAB Electronics
305 pages, $24.95
Lots of detail about the port hardware (serial ports too) and ISA interfacing, with DOS Pascal program code.

Controlling the World With Your PC
by Paul Bergsman
1994, LLH Technology Pub
257 pages, $35
Many projects with DOS code in BASIC, C and Pascal

Programming the Parallel Port: Interfacing the PC for Data Acquisition & Process Control
by Dhananjay V. Gadre
1998, CMP Books
308 pages, $44.95
Includes source code in C for DOS and Linux.