Understanding PC Parallel Ports
Understanding PC Parallel Ports
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
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.
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.
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.
baud.
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.
6
Serial Pinouts (D25 and D9 Connectors)
• 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.
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.