Dvgre ghrtwd fgwrt

Páginas: 20 (4967 palabras) Publicado: 17 de agosto de 2012
Interfacing the Standard Parallel Port

http://www.senet.com.au/~cpeacock

Interfacing the Standard Parallel Port
Disclaimer : While every effort has been made to make sure the information in this document is correct, the author can not be liable
for any damages whatsoever for loss relating to this document. Use this information at your own risk.

Table of Contents
Introduction toParallel Ports

Page 1

Hardware Properties

Page 2

Centronics?

Page 4

Port Addresses

Page 4

Software Registers - Standard Parallel Port (SPP)

Page 6

Bi-directional Ports

Page 8

Using The Parallel Port to Input 8 Bits.

Page 9

Nibble Mode

Page 11

Using the Parallel Port's IRQ

Page 12

Parallel Port Modes in BIOS

Page 14

Parallel Port Modes and theECP’s Extended Control Register

Page 15

Introduction to Parallel Ports
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 8data lines. It's found commonly on the back of your PC as a D-Type 25 Pin female
connector. There may also be a D-Type 25 pin male connector. This will be a serial RS-232 port and
thus, is a totally incompatible port.
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,
1. Compatibility Mode.2. Nibble Mode. (Protocol not Described in this Document)
3. Byte Mode. (Protocol not Described in this Document)
4. EPP Mode (Enhanced Parallel Port).
5. ECP Mode (Extended Capabilities Port).
The aim was to design new drivers and devices which were compatible with each other and
Interfacing the Standard Parallel Port

Page 1

Interfacing the Standard Parallel Porthttp://www.senet.com.au/~cpeacock

also backwards compatible with the Standard Parallel Port (SPP). Compatibility, Nibble & Byte
modes use just the standard hardware available on the original Parallel Port cards while EPP & ECP
modes require additional hardware which can run at faster speeds, while still being downwards
compatible with the Standard Parallel Port.
Compatibility mode or "Centronics Mode" as itis commonly known, can only send data in the
forward direction at a typical speed of 50 kbytes per second but can be as high as 150+ kbytes a
second. In order to receive data, you must change the mode to either Nibble or Byte mode. Nibble
mode can input a nibble (4 bits) in the reverse direction. E.g. from device to computer. Byte mode
uses the Parallel's bi-directional feature (found only onsome cards) to input a byte (8 bits) of data in
the reverse direction.
Extended and Enhanced Parallel Ports use additional hardware to generate and manage
handshaking. To output a byte to a printer (or anything in that matter) using compatibility mode, the
software must.
1. Write the byte to the Data Port.
2. Check to see is the printer is busy. If the printer is busy, it will not acceptany data, thus any
data which is written will be lost.
3. Take the Strobe (Pin 1) low. This tells the printer that there is the correct data on the data
lines. (Pins 2-9)
4. Put the strobe high again after waiting approximately 5 microseconds after putting the strobe
low. (Step 3)
This limits the speed at which the port can run at. The EPP & ECP ports get around this by
letting the hardwarecheck to see if the printer is busy and generate a strobe and /or appropriate
handshaking. This means only one I/O instruction need to be performed, thus increasing the speed.
These ports can output at around 1-2 megabytes per second. The ECP port also has the advantage of
using DMA channels and FIFO buffers, thus data can be shifted around without using I/O
instructions.

Hardware...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS