0% found this document useful (0 votes)
50 views8 pages

Understanding PC Parallel Ports

The parallel port is designed primarily to connect printers to computers. It uses multiple data lines to transfer a whole byte of data at once, making it faster than serial ports but requiring more transmission lines. The parallel port is accessible via registers that correspond to its data, control, and status lines, allowing it to be easily programmed to control devices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views8 pages

Understanding PC Parallel Ports

The parallel port is designed primarily to connect printers to computers. It uses multiple data lines to transfer a whole byte of data at once, making it faster than serial ports but requiring more transmission lines. The parallel port is accessible via registers that correspond to its data, control, and status lines, allowing it to be easily programmed to control devices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The PC Parallel Port

• The primary use of parallel port is to connect


printers to computer and is specifically designed
By for this purpose.
Uvais A. Qidwai, Ph.D. – Thus it is often called as printer Port or
Computer Science & Engineering Dept. Centronics port (this name came from a popular
Qatar University, Doha, Qatar. printer manufacturing company ‘Centronics’
who devised some standards for parallel port).
July 22nd, 2006
• On almost all the PCs only one parallel port is
@ NED University of Engineering & Technology,
present, but you can add more by buying and
Karachi, Pakistan. inserting ISA/PCI parallel port cards.

• Parallel port is a simple and inexpensive tool for


• Parallel ports are easy to program and faster compared to
building computer controlled devices and
the serial ports.
projects.
• But main disadvantage is it needs more number of
• The simplicity and ease of programming makes
transmission lines. Because of this reason parallel ports
parallel port popular in electronics hobbyist
are not used in long distance communications.
world.
• Let us know the basic difference between working of
• The parallel port is often used in Computer
parallel port and serial port.
controlled robots, Atmel/PIC programmers,
– In serial ports, there will be two data lines: One transmission
home automation, ...etc... and one receive line.
• In computers, ports are used mainly for two – To send a data in serial port, it has to be sent one bit after
reasons: another with some extra bits like start bit, stop bit and parity bit
– Device control and to detect errors.
– Communication. We can program PC'
s Parallel ports – But in parallel port, all the 8 bits of a byte will be sent to the
for both. port at a time and a indication will be sent in another line.

Serial port: Data transmission will be Parallel Port: Data transmission is byte wise:
Whole byte at a time
bitwise, one after another

1
D25- Pin Number Centronics 36 Pin Number Function

Pin out 1 1 Strobe


2 to 9 2 to 9 Data Lines
• In the PC there is a D-25 type of female 10 10 Acknowledgement
connector having 25 pins and in the printer,
11 11 Busy
there will be a 36-pin Centronics connector.
12 12 Out of Paper
13 13 Select
14 14 Auto feed
15 15, 32 Error
16 16, 31 Init
17 17, 36 Select In
18 to 25 18 to 30, 33 GND
- 34, 35 N/C

The Pin Grouping


• The lines in DB25 connector are divided in to three
groups, they are

1) Data lines (data bus)


2) Control lines
3) Status lines

As the name refers , data is transferred over data lines,


Control lines are used to control the peripheral and of
course , the peripheral returns status signals back
computer through Status lines. These lines are connected
to Data, Control And Status registers internally .

Note
• All the parallel ports do not have bidirectional
capability.
• Earlier parallel ports had only output enabled in data
pins since printers only inputs data.
• But latter, to make parallel port capable of
communicating with other devises, bidirectional ports
are introduced.
• By default, data port is output port.
• To enable the bidirectional property of the port, we
need to set the bit 5 of control register.

2
Parallel port registers
Parallel port modes • The Data, Control and status lines are connected to there
corresponding registers inside the computer.
• The IEEE 1284 Standard which has been published in • By manipulating these registers in program , one can easily read or
1994 defines five modes of data transfer for parallel write to parallel port with programming languages like 'C'and
BASIC.
port. They are, • The registers found in standard parallel port are ,
– data register
1) Compatibility Mode – Status register
2) Nibble Mode – Control register
3) Byte Mode • Data register is connected to Data lines, Control register is
connected to control lines and Status register is connected to Status
4) EPP (Enhanced Parallel Port ) lines.
5) ECP (Extended Capability Port ) – So what ever you write to these registers , will appear in corresponding lines
as voltages,
– Of course, you can measure it with a multimeter. And What ever you give to
([Link] Parallel port as voltages can be read from these registers (with some
restrictions). For example , if we write '1'to Data register , the line Data0
will be driven to +5v. Just like this ,we can programmatically turn on and off
any of the data lines and Control lines.

Where these registers are ? Know your Port!


• In an IBM PC, these registers are IO mapped and will have • To know the details of parallel ports available in
unique address. your computer, follow this procedure:
• For a typical PC, the base address of LPT1 is 0x378 and of – Right click on My Computer, go to "Properties".
LPT2 is 0x278. – Select the tab Hardware, Click Device manager.
• The data register resides at this base address, status register at
– You will get a tree structure of devices; In that
baseaddress + 1 and the control register is at baseaddress + 2.
Expand “Ports(Com1 & LPT)”.
Register LPT1 LPT2 – Double Click on the ECP Printer Port(LPT1) or any
other LPT port if available.
data register (baseaddress + 0) 0x378 0x278
– You will get details of LPT port. Make sure that “Use
status register (baseaddress + 1) 0x379 0x279 this Port (enable)” is selected.
– Select tab recourses. In that you will get the address
control register (baseaddress + 2) 0x37a 0x27a
range of port.

RS232???
• In the early 1960s, a standards committee, today known
as the Electronic Industries Association, developed a
common interface standard for data communications
equipment.
• At that time, data communications was thought to mean
digital data exchange between a centrally located
mainframe computer and a remote computer terminal, or
possibly between two terminals without a computer
involved.
• These devices were linked by telephone voice lines, and
consequently required a modem at each end for signal
translation.
• While simple in concept, the many opportunities for data
error that occur when transmitting data through an analog
channel require a relatively complex design.

3
• It was thought that a standard was needed first to • Also people started using it for a lot more
ensure reliable communication, and second to enable
the interconnection of equipment produced by applications
different manufacturers, thereby fostering the benefits – engineers used it for data acquisition.
of mass production and competition.
– programmers use it to interface additional devices
• From these ideas, the RS232 standard was born.
like the printer or another computer for direct
• It specified signal voltages, signal timing, signal
function, a protocol for information exchange, and talking between the computer.
mechanical connectors. • Today with advances in technology a serial
• Over the 40+ years since this standard was port is used for data transfer to handheld like
developed, the Electronic Industries Association
published three modifications, the most recent being palms.
the EIA232F standard introduced in 1997.
• The USB and the Fire-wire ports are
• Besides changing the name from RS232 to EIA232,
some signal lines were renamed and various new ones conceptual extensions of the RS232 standards.
were defined, including a shield conductor.

The RS232 Specifications RS232 bit streams


• The RS232 standard describes a communication method where
• Communication as defined in the RS232 standard is information is sent bit by bit on a physical channel.
an asynchronous serial communication method. • The information must be broken up in data words.
– The word serial means, that the information is sent one bit • The length of a data word is variable.
at a time. • On PC' s a length between 5 and 8 bits can be selected.
– Asynchronous tells us that the information is not sent in • This length is the net information length of each word.
predefined time slots.
• For proper transfer additional bits are added for synchronization
• Data transfer can start at any given time and it is the and error checking purposes.
task of the receiver to detect when a message starts – Parity bit
and ends. – Hamming Codes
• Asynchronous communication has some advantages • It is important, that the transmitter and receiver use the same
and disadvantages as discussed in the following number of bits. Otherwise, the data word may be misinterpreted,
or not recognized at all.
slides.

• Data bits are sent with a predefined frequency, the


baud rate. RS232 physical properties
• Both the transmitter and receiver must be
programmed to use the same bit frequency. • The RS232 standard describes a communication
method capable of communicating in different
• After the first bit is received, the receiver calculates at environments.
which moments the other data bits will be received.
• This has its impact on the maximum allowable
• It will check the line voltage levels at those moments. voltages etc., on the pins.
• With RS232, the line voltage level can have two • In the original definition, the technical possibilities of
states. that time were taken into account.
• The on state is also known as marking, • The maximum baud rate defined for example is
20 kbps.
• the off state as spacing.
• With current devices like the 16550A UART,
• No other line states are possible. When the line is maximum speeds of 1.5 Mbps are allowed.
idle, it is kept in the marking state.

4
Voltage Levels
• The signal level of the RS232 pins can have two states.
• A high bit, or marking state is identified by a negative voltage
and a low bit or space state uses a positive value.
• This might be a bit confusing, because in normal
circumstances, high logical values are defined by high voltages
also.
• The voltage limits are shown below.

Signal Timing • Changes in signal state from logic '


1'to logic '
0'or vice
versa must abide by several requirements, as follows:
• The EIA232 standard is applicable to data – 1 - Signals that enter the transition region during a change of
rates of up to 20,000 bits per second (the usual state must move through the transition region to the opposite
signal state without reversing direction or reentering.
upper limit is 19,200 baud). – 2 - For control signals, the transit time through the transition
• Fixed baud rates are not set by the EIA232 region should be less than 1ms.
standard. – 3 - For Data and Timing signals, the transit time through the
transition region should be
• However, the commonly used values are 300, • a - less than 1ms for bit periods greater than 25ms,
1200, 2400, 9600, and 19,200 baud. Other • b - 4% of the bit period for bit periods between 25ms and 125µs,
• c - less than 5µs for bit periods less than 125µs.
accepted values that are not often used are 110 The rise and fall times of data and timing signals ideally should be
(mechanical teletype machines), 600, and 4800 equal, but in any case vary by no more than a factor of three.

baud.

Maximum cable lengths


• Cable length is one of the most discussed items in
RS232 world.
• The standard has a clear answer, the maximum cable
length is 50 feet, or the cable length equal to a
capacitance of 2500 pF.
• The latter rule is often forgotten.
• This means that using a cable with low capacitance
allows you to span longer distances without going
beyond the limitations of the standard.
• If for example UTP CAT-5 cable is used with a
typical capacitance of 17 pF/ft, the maximum
allowed cable length is 147 feet.

5
DTE ??? DCE ???
• Devices, which use serial cables for their
communication, are split into two categories.
– DCE (Data Communications Equipment) and
– DTE (Data Terminal Equipment.)
• Data Communications Equipments are devices such
as your modem, plotter etc while
• Data Terminal Equipment is your Computer or
Terminal.
• DTE to DCE is the speed between your modem and
computer, sometimes referred to as your terminal
speed.

• Most people today will have 28.8K, 33.6K, or 56K


modems. Therefore, we should expect the DCE to
DCE speed to be either 28.8K, 33.6K, or 56K.
• Considering the high speed of the modem we should
expect the DTE to DCE speed to be about 115,200
BPS. (Maximum Speed of the 16550 a UART) .
• If we were transferring that text file at 28.8K (DCE-
DCE), then when the modem compresses it you are
actually transferring 115.2 KBPS between computers
and thus have a DCE- DTE speed of 115.2 KBPS.
• This is why the DCE- DTE should be much higher
than the modem' s connection speed. Therefore, if our
DTE to DCE speed is several times faster than our
DCE to DCE speed the PC can send data to your
modem at 115,200 BPS.

6
Serial Pinouts (D25 and D9 Connectors)

D-Type-25 Pin D-Type-9 Pin No. Abbreviation Full Name


No.
Pin 2 Pin 3 TD Transmit Data
Pin 3 Pin 2 RD Receive Data
Pin 4 Pin 7 RTS Request To Send
Pin 5 Pin 8 CTS Clear To Send
Pin 6 Pin 6 DSR Data Set Ready
Pin 7 Pin 5 SG Signal Ground
Pin 8 Pin 1 CD Carrier Detect
Data Terminal
Pin 20 Pin 4 DTR
Ready
Pin 22 Pin 9 RI Ring Indicator

• Just like the LPT ports, the base addresses for the COM
Serial Port’s Registers (PC'
s) ports can be read from the BIOS Data Area.

Start
Port Addresses & IRQ'
s Function
Address
0000:0400 COM1'
s Base Address
Name Address IRQ 0000:0402 COM2'
s Base Address
COM 1 3F8 4 0000:0404 COM3'
s Base Address
COM 2 2F8 3 0000:0406 COM4'
s Base Address

COM 3 3E8 4 • The above table shows the address at which we can find the
Communications (COM) ports addresses in the BIOS Data
COM 4 2E8 3 Area. Each address will take up 2 bytes.

DB9 All-Line Direct Extension


• This is a 9-pin DTE-to-DCE serial cable.
• All 9 pins plus shield are directly extended from DB9
Female to DB9 Male.
• There are no crossovers or self-connects present.
• Use this cable to connect modems, printers, or any
device that uses a DB9 connector to a PC' s serial port.
• This cable may also serve as an extension cable to
increase the distance between a computer and serial
device. DTE DCE
• Caution: do not exceed 25 feet separation between
devices without a signal booster!

7
DB9 Loopback Connector
• A loopback connector usually consists of a connector without
a cable and includes internal wiring to reroute signals back to
the sender.
• This DB9 female connector would attach to a DTE device
such as a personal computer.
• When the computer receives data, it will not know whether the
signals it receives come from a remote DCE device set to echo
characters, or from a loopback connector.
• Use loopback connectors to confirm proper operation of the
computer' s serial port.
• Once confirmed, insert the serial cable you plan to use and
attach the loopback to the end of the serial cable to verify the
cable.

DB9 Null Modem Cable


• Use this female-to-female cable in any application where you
wish to connect two DTE devices (for example, two
computers).
• A male-to-male equivalent of this cable would be used to
connect two DCE devices.
• The cable shown below is intended for RS232 asynchronous
communications (most PC-based systems).
• If you are using synchronous communications, the null modem
will have additional connections for timing signals, and a
DB25 connector would be necessary.
• NOTE: Not all null modem cables connect handshaking lines
the same way. In this cable, Request-to-Send (RTS, pin 7) DTE DTE
asserts the Carrier Detect (pin 1) on the same side and the
Clear-to-Send (CTS, pin 8) on the other side of the cable.
• This device may also be available in the form of an adapter.

You might also like