TheDirectData.com Page 1
1. What is an interface 1
What is hardware interfacing 1
2. Printer port 2
Pin Assignment 3
Introduction to parallel port 4
Hardware properties 5
Port addresses 8
Program to obtain addresses of printer port 9
Parallel port programming considerations 10
Software registers-standard parallel port (spp) 10
Parallel port modes in bios 12
How to use parallel port output capabilities 13
2.10.1 How to calculate your own values to send to program 13
2.11 controlling some real life electronics 14
2.11.1 Circuit to operate DC devices 14
2.11.2 Circuit to operate AC devices 14
2.12 PC to PC file transfer 15
2.12.1 Objective 15
2.12.2 Description 15
2.12.3 Requirements 15
2.12.4 Details 16
3. Serial port 17
3.1 The serial connection 18
3.1.1 Rs-232 serial (com) pc port connector db-9 18
3.1.2 Rs-232 serial (com) pc port connector db-25 19
3.1.3 D type 9 pin to 9 pin serial cable 19
3.1.4 D type 25 pin to 9 pin serial cable 20
3.1.5 D type 9 pin and d type 25 pin connectors 20
3.2 Pin functions 21
3.3 Port addresses & Irq's 21
3.4 Com port addresses in the bios data area 21
4. USB Port 22
4.1 What is USB? 22
4.2 Running out of ports 25
4.3 How USB ports work 27
4.4 USB 2.0 28
4.5 USB Converter 29
4.5.1 USB to Serial Converter 29
TheDirectData.com Page 2
4.5.2 USB to Parallel Converter 29
4.5.3 USB to PS/2 and ADB converter 29
4.5.4 USB 2.0 to IDE/ATAPI Converter 30
4.5.5 USB to SCSI-2 Converter 30
4.5.6 USB to IRDA Converter 30
4.5.7 USB to Game port Converter 30
4.6 Connect 4 serial devices to your computer 30
4.6.1 Features 31
4.7 USB cables data and extension 31
4.7.1 USB Link Cable 31
4.7.2 USB 2.0 Link Cable 31
4.7.3 USB Extension Cable 31
4.7.4 USB 2.0 Extension Cable 32
4.7.5 USB Network Cable 32
4.8 USB hubs 32
4.8.1 USB 2.0 Ultra Slim 4-Port Hub 32
4.8.2 USB 2.0 4-Port Hub 32
4.8.3 USB 2-Port Compact Hub 32
4.9 USB computer peripherals 33
4.9.1 Multimedia Keyboard with USB Hub 33
4.9.2 USB Wireless Mouse 33
4.10 USB Data Storage and Memory Cards 33
4.10.1 40, 60 & 80 GB (2.5 & 3.5 inch) USB 2.0 Hard Drives 33
4.10.2 USB Flash Drives 33
4.10.3 6-in-1 USB 2.0 Memory Card Reader 33
4.10.4 5-in-1 Memory Card Reader 34
5. Conclusion 35
6. Bibliography 36
TheDirectData.com Page 3
1. WHAT IS AN INTERFACE?
An interface is a system consisting of hardware, software, or both that allows two
dissimilar components to interact. Consider, for example, the problem of connecting a
special type of printer system manufactured on the planet Mars with a PC on the Earth.
The manufacturer of the printer has provided complete specifications for the input
signals, but these specifications unfortunately do not correspond to either the RS-232 port
or the Centronics printer port attached to the PC. To interface this Martian printer with
the earthbound PC, you must do two things. First, you must build suitable hardware that
can connect the PC to the printer and generate all the signals required by this printer. The
signals generated by the PC should meet the timing as well as the voltage level (or
current level) requirements of the printer. Second, you must provide suitable software
routines and drivers that will translate user commands such as m_print file_name into
signals that the printer will understand.
1.1 WHAT IS HARDWARE INTERFACING?
Hardware interfacing means the interface between computer and any device or circuits.
For interfacing, we pass the voltages from computer hardware.
There are three ways for doing hardware interfacing.
Printer port ( Parallel port )
Ports back to your PC
From these ports, you can pass the voltages and operate any devices or circuits.
You can make programs for hardware interfacing in C, C++, VB, Qbasic, etc language.
The description of these ports is given below:
2. PRINTER PORT
TheDirectData.com Page 4
A PC printer port is an inexpensive and yet powerful platform for implementing projects
dealing with the control of real world peripherals. The printer port provides eight TTL
outputs, five inputs and four bidirectional leads and it provides a very simple means to
use the PC interrupt structure.
It is commonly used for interfacing and easy to operate and to make programs for it.
Printer Data port Status Control
LPT 1 0X3BC 0X3BD 0X3BE
LPT 2 0X378 0X37A 0X37A
LPT 3 0X278 0X27A 0X27A
Machines are assigned a base address for LPT1 of either 0x378 or 0x3bc.
To definitively identify the assignments for a particular machine, use the DOS debug
program to display memory location 0040:0008.
-d 0040:0008 L8
0040:0008 78 03 78 02 00 00 00 00
In above example that LPT1 is at 0x378, LPT2 is at 0x278 and LPT3 and LPT4 are not
Thus, for this hypothetical machine:
Printer Data port Status Control
LPT 1 0X378 0X379 0X37A
LPT 2 0X278 0X279 0X27A
LPT 3 NONE --- ---
LPT4 NONE --- ---
An alternate technique is used to run Microsoft Diagnostics (MSD.EXE) and review the
2.1 PIN ASSIGNMENT: -
TheDirectData.com Page 5
8 output pins accessed via the DATA Port
5 input pins (one inverted) accessed via the STATUS Port
4 output pins (three inverted) accessed via the CONTROL Port
The remaining 8 pins are grounded
25-way Female D-Type Connector
PARALLEL PRINTER CONNECTOR DB-25
1 ------------------------------- > STROBE *
2 ------------------------------- > DATA 0
3 ------------------------------- > DATA 1
4 ------------------------------- > DATA 2
5 ------------------------------- > DATA 3
6 ------------------------------- > DATA 4
7 ------------------------------- > DATA 5
8 ------------------------------- > DATA 6
9 ------------------------------- > DATA 7
10< ------------------------------ ACK *
11< ------------------------------ BUSY
12< ------------------------------ PAPER END
13 -------------------------------- SLCT (select)
14 ----------------------------- > AUTOFEED *
15< ------------------------------ ERROR *
16 ------------------------------->INITIALIZE PRINTER *
17 -------------------------------- SLCTIN (select in)
18 thru 25 --------------------- GND
Note!! * Denotes an active low signal.
TheDirectData.com Page 6
There are eight outputs on the Data port and four additional outputs on the low nibble of
the Control port. /Select In, Init, /Auto feed and /Strobe.
With /Select In, the “in” refers to the printer. For normal printer operation, The PC exerts
a logic Zero to indicate to the printer is selected. The function of INIT was to initialize
the printer, AUTO FEED to advance the paper. In normal printing, STROBE is high. The
character to be printed is output on the Data port and STROBE is momentarily brought
2.2 INTRODUCTION TO PARALLEL PORTS
If you have a printer connected to your computer, there is a good chance that it uses the
parallel. While USB is becoming increasingly popular, the parallel port is still a
commonly used to interface for printers.
Parallel ports can be used to connect a host of popular computer peripherals:
External hard drives
Iomega Zip removable drives
Tape backup drives
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. 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
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,
TheDirectData.com Page 7
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 Mode).
The aim was to design new drivers and devices, which were compatible with each other
and 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 it is 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 on some 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 accept any 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 hardware check 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.
2.3 HARDWARE PROPERTIES
Below is a table of the "Pin Outs" of the D-Type 25 Pin connector and the Centronics 34
Pin connector. The D-Type 25 pin connector is the most common connector found on the
Parallel Port of the computer, while the Centronics Connector is commonly found on
TheDirectData.com Page 8
printers. The IEEE 1284 standard however specifies 3 different connectors for use with
the Parallel Port. The first one, 1284 Type A is the D-Type 25 connector found on the
back of most computers. The 2nd is the 1284 Type B which is the 36 pin Centronics
Connector found on most printers.
IEEE 1284 Type C however, is a 36 conductor connector like the Centronics, but smaller.
This connector is claimed to have a better clip latch, better electrical properties and is
easier to assemble. It also contains two more pins for signals which can be used to see
whether the other device connected, has power. 1284 Type C connectors are
recommended for new designs, so we can look forward on seeing these new connectors
in the near future.
Pin No (D- Pin No Direction Hardware
SPP Signal Register
Type 25) (Centronics) In/out Inverted
1 1 nStrobe In/Out Control Yes
2 2 Data 0 Out Data
3 3 Data 1 Out Data
4 4 Data 2 Out Data
5 5 Data 3 Out Data
6 6 Data 4 Out Data
7 7 Data 5 Out Data
8 8 Data 6 Out Data
9 9 Data 7 Out Data
10 10 nAck In Status
TheDirectData.com Page 9
11 11 Busy In Status Yes
12 12 In Status
13 13 Select In Status
14 14 In/Out Control Yes
15 32 In Status
16 31 nInitialize In/Out Control
17 36 Printer / In/Out Control Yes
18 - 25 19-30 Ground Gnd
Table 1. Pin Assignments of the D-Type 25 pin Parallel Port Connector.
The above table uses "n" in front of the signal name to denote that the signal is active
low. If the printer has occurred an error then this line is low. This line normally is high,
should the printer be functioning correctly. The "Hardware Inverted" means the signal is
inverted by the Parallel card's hardware. Such an example is the Busy line. If +5v (Logic
1) was applied to this pin and the status register read, it would return back a 0 in Bit 7 of
the Status Register.
The output of the Parallel Port is normally TTL logic levels. The voltage levels are the
easy part. The current you can sink and source varies from port to port. Most Parallel
Ports implemented in ASIC, can sink and source around 12mA. However these are just
some of the figures taken from Data sheets, Sink/Source 6mA, Source 12mA/Sink 20mA,
Sink 16mA/Source 4mA, and Sink/Source 12mA. As you can see they vary quite a bit.
The best bet is to use a buffer, so the least current is drawn from the Parallel Port.
Centronics is an early standard for transferring data from a host to the printer. The
majority of printers use this handshake. This handshake is normally implemented using a
Standard Parallel Port under software control.
TheDirectData.com Page 10
2.5 PORT ADDRESSES
The Parallel Port has three commonly used base addresses. These are listed in table 2,
below. The 3BCh base address was originally introduced used for Parallel Ports on early
Video Cards. This address then disappeared for a while, when Parallel Ports were later
removed from Video Cards. They have now reappeared as an option for Parallel Ports
integrated onto motherboards, upon which their configuration can be changed using
LPT1 is normally assigned base address 378h, while LPT2 is assigned 278h. However
this may not always be the case as explained later. 378h & 278h have always been
commonly used for Parallel Ports. The lower case h denotes that it is in hexadecimal.
These addresses may change from machine to machine.
3BCh - 3BFh Used for Parallel Ports which were incorporated
on to Video Cards - Doesn't support ECP
378h - 37Fh Usual Address For LPT 1
278h - 27Fh Usual Address For LPT 2
Table 2 Port Addresses
When the computer is first turned on, BIOS (Basic Input/Output System) will determine
the number of ports you have and assign device labels LPT1, LPT2 & LPT3 to them.
BIOS first looks at address 3BCh. If a Parallel Port is found here, it is assigned as LPT1,
and then it searches at location 378h. If a Parallel card is found there, it is assigned the
next free device label. This would be LPT1 if a card wasn't found at 3BCh or LPT2 if a
card was found at 3BCh. The last port of call is 278h and follows the same procedure
than the other two ports. Therefore it is possible to have a LPT2 which is at 378h and not
at the expected address 278h.
What can make this even confusing is that some manufacturers of Parallel Port Cards
have jumpers, which allow you to set your Port to LPT1, LPT2 and LPT3. Now what
address is LPT1? - On the majority of cards LPT1 is 378h, and LPT2, 278h, but some
will use 3BCh as LPT1, 378h as LPT1 and 278h as LPT2. Life wasn't meant to be easy.
The assigned devices LPT1, LPT2 & LPT3 should not be a worry to people wishing to
interface devices to their PC's. Most of the time the base address is used to interface the
port rather than LPT1 etc. However should you want to find the address of LPT1 or any
of the Line Printer Devices, you can use a lookup table provided by BIOS. When BIOS
assigns addresses to your printer devices, it stores the address at specific locations in
memory, so we can find them.
TheDirectData.com Page 11
Start Address Function
0000:0408 LPT1's Base Address
0000:040A LPT2's Base Address
0000:040C LPT3's Base Address
0000:040E LPT4's Base Address (Note 1)
Table 3 - LPT Addresses in the BIOS Data Area
Note 1: Address 0000:040E in the BIOS Data Area may be used as the Extended Bios
Data Area in PS/2 and newer Bioses.
The above table, table 3, shows the address at which we can find the Printer Port's
addresses in the BIOS Data Area. Each address will take up 2 bytes.
The following sample program in C shows how you can read these locations to obtain the
addresses of your printer ports.
2.6 PROGRAM TO OBTAIN ADDRESSES OF PRINTER PORTS
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
ptraddr=(unsigned int far *)0x00000408;
for (a = 0; a < 3; a++)
address = *ptraddr;
if (address == 0)
printf ("No port found for LPT%d \n", a+1);
printf("Address assigned to LPT%d is %Xh\n", a+1,address);
TheDirectData.com Page 12
2.7 PARALLEL PORT PROGRAMMING CONSIDERATIONS
The printer adapter responds to five I/O instructions: two outputs and three inputs. The
output instructions transfer data into two latches whose outputs are presented on the pins
of a 25-pin D-type female connector.
Two of the three input instructions allow the processor to read back the contents of the
two latches. The third allows the processor to read the real time status of a group of pins
on the connector.
A description of each instruction follows
Output to address 278/378/3BC Hex
Bit 7 6 5 4 3 2 1 0
Pin 9 8 7 6 5 4 3 2
The instruction captures data from the data bus and is present on the respective pins.
These pins are each capable of sourcing 2.6 mA and sinking 24 mA. It is essential that
the external device not try to pull these lines to ground.
2.8 SOFTWARE REGISTERS-STANDARD PARALLEL PORT (SPP)
Offset Name Read/Write Bit No. Properties
Base + 0 Data Port Write (Note- Bit 7 Data 7
Bit 6 Data 6
Bit 5 Data 5
Bit 4 Data 4
Bit 3 Data 3
Bit 2 Data 2
Bit 1 Data 1
Bit 0 Data 0
Table 4 Data Port
Note 1: If the Port is Bi-Directional then Read and Write Operations can be performed on
the Data Register.
The base address, usually called the Data Port or Data Register is simply used for
outputting data on the Parallel Port's data lines (Pins 2-9). This register is normally a
TheDirectData.com Page 13
write only port. If you read from the port, you should get the last byte sent. However if
your port is bi-directional, you can receive data on this address.
Offset Name Read/Write Bit No. Properties
Base + 1 Status Port Read Only Bit 7 Busy
Bit 6 Ack
Bit 5 Paper Out
Bit 4 Select In
Bit 3 Error
Bit 2 IRQ (Not)
Bit 1 Reserved
Bit 0 Reserved
Table 5 Status Port
The Status Port (base address + 1) is a read only port. Any data written to this port will be
ignored. The Status Port is made up of 5 input lines (Pins 10,11,12,13 & 15), an IRQ
status register and two reserved bits. Please note that Bit 7 (Busy) is an active low input.
E.g. if bit 7 happens to show logic 0, this means that there is +5v at pin 11. Likewise with
Bit 2. (nIRQ) If this bit shows a '1' then an interrupt has not occurred.
Offset Name Read/Write Bit No. Properties
Base + 2 Control Read/Write Bit 7 Unused
Bit 6 Unused
Bit 5 Enable Bi-Directional Port
Bit 4 Enable IRQ Via Ack Line
Bit 3 Select Printer
Bit 2 Initialize Printer (Reset)
Bit 1 Auto Linefeed
Bit 0 Strobe
Table 6 Control Port
TheDirectData.com Page 14
The Control Port (base address + 2) was intended as a write only port. When a printer is
attached to the Parallel Port, four "controls" are used. These are Strobe, Auto Linefeed,
Initialize and Select Printer, all of which are inverted except Initialize.
2.9 PARALLEL PORT MODES IN BIOS
Today, most Parallel Ports are multimode ports. They are normally software configurable
to one of many modes from BIOS. The typical modes are,
Printer Mode (Sometimes called Default or Normal Modes)
Standard & Bi-directional (SPP) Mode
EPP1.7 and SPP Mode
EPP1.9 and SPP Mode
ECP and EPP1.7 Mode
ECP and EPP1.9 Mode
Printer Mode is the most basic mode. It is a Standard Parallel Port in forward mode only.
It has no bi-directional feature, thus Bit 5 of the Control Port will not respond. Standard
& Bi-directional (SPP) Mode is the bi-directional mode. Using this mode, bit 5 of the
Control Port will reverse the direction of the port, so you can read back a value on the
EPP1.7 and SPP Mode is a combination of EPP 1.7 (Enhanced Parallel Port) and SPP
Modes. In this mode of operation you will have access to the SPP registers (Data, Status
and Control) and access to the EPP Registers. In this mode you should be able to reverse
the direction of the port using bit 5 of the control register. EPP 1.7 is the earlier version of
EPP. This version, version 1.7, may not have the time-out bit.
EPP1.9 and SPP Mode is just like the previous mode, only it uses EPP Version 1.9 this
time. As in the other mode, you will have access to the SPP registers, including Bit 5 of
the control port. However this differs from EPP1.7 and SPP Mode as you should have
access to the EPP Timeout bit.
ECP Mode will give you an Extended Capabilities Port. The mode of this port can then
be set using the ESP’s Extended Control Register (ECR). However in this mode from
BIOS the EPP Mode (100) will not be available.
ECP and EPP1.7 Mode and ECP and EPP1.9 Mode will give you an Extended
Capabilities Port, just like the previous mode. However the EPP Mode in the ESP’s ECR
will now be available. Should you be in ECP and EPP1.7 Mode you will get an EPP1.7
Port, or if you are in ECP and EPP1.9 Mode, an EPP1.9 Port will be at your disposal.
The above modes are configurable via BIOS. You can reconfigure them by using your
own software, but this is not recommended. These software registers, typically found at
TheDirectData.com Page 15
0x2FA, 0x3F0, 0x3F1 etc are only intended to be accessed by BIOS. There is no set
standard for these configuration registers, thus if you were to use these registers, your
software would not be very portable. With today's multitasking operating systems, it’s
also not a good idea to change them when it suits you.
A better option is to select ECP and EPP1.7 Mode or ECP and EPP1.9 Mode from BIOS
and then use the ESP’s Extended Control Register to select your Parallel Port's Mode.
The EPP1.7 mode had a few problems in regards to the Data and Address Strobes being
asserted to start a cycle regardless of the wait state, thus this mode if not typically used
now. Best set your Parallel Port to ECP and EPP1.9 Mode.
2.10 HOW TO USE PARALLEL PORT OUTPUT CAPABILITIES
PC parallel port can be very useful I/O channel for connecting your own circuits to PC.
The port is very easy to use when you first understand some basic tricks. This document
tries to show those tricks in easy to understand way.
2.10.1 How to calculate your own values to send to program
You have to think the value you give to the program as a binary number. Every bit of the
binary number control one output bit. The following table describes the relation of the
bits, parallel port output pins and the value of those bits.
Pin 2 3 4 5 6 7 8 9
Bit D0 D1 D2 D3 D4 D5 D6 D7
Value 1 2 4 8 16 32 64 128
For example if you want to set pins 2 and 3 to logic 1 (led on) then you have to output
value 1+2=3. If you want to set on pins 3, 5 and 6 then you need to output value
2+8+16=26. In this way you can calculate the value for any bit combination you want to
Output pins Data type Code
Pin 2 Data 0 0x01
Pin 3 Data 1 0x02
Pin 4 Data 2 0x04
Pin 5 Data 3 0x08
Pin 6 Data 4 0x10
Pin 7 Data 5 0x20
Pin 8 Data 6 0x40
Pin 9 Data 7 0x80
TheDirectData.com Page 16
2.11 CONTROLLING SOME REAL LIFE ELECTRONICS
2.11.1 Circuit to operate DC devices
Parallel port b or
data pi 2N2222A
9v, 12v, 15v
The circuit can be also used for controlling other small loads like powerful LEDS, lamps
and small DC motors. Keep in mind that those devices you plan to control directly from
the transistor must take less than 100 mA current.
2.11.2 Circuit to operate AC devices
IN4007 BC547A +
Parallel port or
data pi 6v
Structure of Relay
TheDirectData.com Page 17
The circuit can handle relays which take currents up to 100 mA. The transistor does the
switching of current and the diode prevents spikes from the relay coil form damaging
your computer (if you leave the diode out, then the transistor and your computer can be
damaged). Since coils (solenoids and relay coils) have a large amount of inductance,
when they are released (when the current is cut off) they generate a very large voltage
2.12 PC TO PC FILE TRANSFER
To provide a facility for file transfer between two PCs connected via their parallel printer
Although the IBM-PC parallel printer port is intended for output only, there are enough
input lines available for 4-bit I/O, with handshaking, so data bytes can be transferred half
at a time. (Most new PCs have a bi-directional parallel printer port, but this is not a
This should be implemented as a "master-slave" system with everything being controlled
by the local "master" PC. The remote "slave" PC just sits there and does what it is told.
Previous solutions have run under MS-DOS. I think it's about time I had a comprehensive
MS-Windows version, probably with a minimal MS-DOS slave-only version as well for
instances where one of the PCs to be connected is unable to run MS-Windows.
A simple command set must be provided, including
* Change current directory (local & remote)
* Get directory listing (local & remote)
* Fetch remote file
* Send local file
Care would need to be taken that existing files are not overwritten unintentionally and
that there is enough disk space available for a requested transfer.
Possible enhancements include:
TheDirectData.com Page 18
* Additional file and directory handling (creation/deletion etc).
* Multiple fetch/send with wildcard expansion
* Data compression
* Data integrity check
With the information provided it is possible to design and build a cable to connect two
IBM-PC-compatible computers via their parallel printer ports and to write software to
enable exchange of data between them.
3. SERIAL PORT
TheDirectData.com Page 19
Considered to be one of the most basic external connections to a computer, the serial port
has been an integral part of most computers for more than 20 years. Although many of
the newer systems have done away with the serial port completely in favor of USB
connections, most modems still use the serial port, as do some printers, PDAs and digital
cameras. Few computers have more than two serial ports.
Two serial ports on the back of a PC
The Serial Port is harder to interface than the Parallel Port. In most cases, any device you
connect to the serial port will need the serial transmission converted back to parallel so
that it can be used. This can be done using a UART. On the software side of things, there
are many more registers that you have to attend to than on a Standard Parallel Port. (SPP)
What are the advantages of using serial data transfer rather than parallel?
1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -
25 volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1'
as 5v. Therefore the serial port can have a maximum swing of 50V compared to the
parallel port, which has a maximum swing of 5 Volts. Therefore cable loss is not going to
be as much of a problem for serial cables as they are for parallel.
2. You don't need as many wires as parallel transmission. If your device needs to be
mounted a far distance away from the computer then 3 core cable (Null Modem
Configuration) is going to be a lot cheaper that running 19 or 25 core cable. However you
must take into account the cost of the interfacing at each end.
3. Infra Red devices have proven quite popular recently. You may have seen many
electronic diaries and palmtop computers which have infra red capabilities build in.
However could you imagine transmitting 8 bits of data at the one time across the room
and being able to (from the devices point of view) decipher which bits are which?
Therefore serial transmission is used where one bit is sent at a time. IrDA-1 (The first
infra red specifications) was capable of 115.2k baud and was interfaced into a UART.
The pulse length however was cut down to 3/16th of a RS232 bit length to conserve
power considering these devices are mainly used on diaries, laptops and palmtops.
4. Microcontroller's have also proven to be quite popular recently. Many of these have in
built SCI (Serial Communications Interfaces) which can be used to talk to the outside
world. Serial Communication reduces the pin count of these MPU's. Only two pins are
commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least 8
pins if you use an 8 bit Parallel method (You may also require a Strobe).
TheDirectData.com Page 20
3.1 THE SERIAL CONNECTION: -
The external connector for a serial port can be either 9 pins or 25 pins. Originally,
the primary use of a serial port was to connect a modem to your computer. The
pin assignments reflect that. Let's take a closer look at what happens at each pin
when a modem is connected.
Close-up of 9-pin and 25-pin serial connectors
3.1.1 RS-232 SERIAL (COM) PC PORT CONNECTOR DB-9
1. Carrier Detect - Determines if the modem is connected to a working phone line.
2. Receive Data - Computer receives information sent from the modem.
3. Transmit Data - Computer sends information to the modem.
4. Data Terminal Ready - Computer tells the modem that it is ready to talk.
5. Signal Ground - Pin is grounded.
6. Data Set Ready - Modem tells the computer that it is ready to talk.
7. Request To Send - Computer asks the modem if it can send information.
8. Clear To Send - Modem tells the computer that it can send information.
9. Ring Indicator - Once a call has been placed, computer acknowledges signal
(sent from modem) that a ring is detected.
Transmitted and receive data are referenced from the data device and not the modem.
3.1.2 RS-232 SERIAL (COM) PC PORT CONNECTOR DB-25
TheDirectData.com Page 21
1. Not Used
2. Transmit Data - Computer sends information to the modem.
3. Receive Data - Computer receives information sent from the modem.
4. Request To Send - Computer asks the modem if it can send information.
5. Clear To Send - Modem tells the computer that it can send information.
6. Data Set Ready - Modem tells the computer that it is ready to talk.
7. Signal Ground - Pin is grounded.
8. Received Line Signal Detector - Determines if the modem is connected to a
working phone line.
9. Not Used: Transmit Current Loop Return (+)
10. Not Used
11. Not Used: Transmit Current Loop Data (-)
12. Not Used
13. Not Used
14. Not Used
15. Not Used
16. Not Used
17. Not Used
18. Not Used: Receive Current Loop Data (+)
19. Not Used
20. Data Terminal Ready - Computer tells the modem that it is ready to talk.
21. Not Used
22. Ring Indicator - Once a call has been placed, computer acknowledges signal
(sent from modem) that a ring is detected.
23. Not Used
24. Not Used
25. Not Used: Receive Current Loop Return (-)
NOTE!! Current loop technology was supported in the PC and XT interfaces.
Current loop was discontinued when the AT interface was introduced.
Transmitted and receive data are referenced from the data device and not the
3.1.3 D TYPE 9 PIN TO 9 PIN SERIAL CABLE
3.1.4 D TYPE 25 PIN TO 9 PIN SERIAL CABLE
TheDirectData.com Page 22
3.1.5 D TYPE 9 PIN AND D TYPE 25 PIN CONNECTORS
D-Type-25 Pin D-Type-9 Pin
Abbreviation Full Name
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
Pin 20 Pin 4 DTR
Pin 22 Pin 9 RI Ring Indicator
3.2 PIN FUNCTIONS
TheDirectData.com Page 23
Abbreviation Full Name Function
TD Serial Data Output (TXD)
RD Serial Data Input (RXD)
Clear to Send This line indicates that the Modem is ready to
Data Carrier When the modem detects a "Carrier" from the
DCD Detect modem at the other end of the phone line, this
Line becomes active.
Data Set This tells the UART that the modem is ready to
DSR Ready establish a link.
This is the opposite to DSR. This tells the Modem
that the UART is ready to link.
Request To This line informs the Modem that the UART is
RTS Send ready to exchange data.
Ring Indicator Goes active when modem detects a ringing signal
from the PSTN.
3.3 PORT ADDRESSES & IRQ'S
Name Address IRQ
COM 1 3F8 4
COM 2 2F8 3
COM 3 3E8 4
COM 4 2E8 3
3.4 COM PORT ADDRESSES IN THE BIOS DATA AREA
Start Address Function
0000:0400 COM1's Base Address
0000:0402 COM2's Base Address
0000:0404 COM3's Base Address
0000:0406 COM4's Base Address
TheDirectData.com Page 24
4. USB PORT
4.1 WHAT IS USB?
A universal serial bus port, introduced around 1997, is the gateway to your computer. It's
used to connect all kinds of external devices, such as external hard drives, printers, mice,
scanners and more. There are normally two half-inch long USB ports on the back of
computers built since 1998. Sometimes there are USB ports built into a hatch on the front
of a computer. If you use a USB hub, (example: 4 port hub), you can connect as many as
127 devices to a USB port. It can transfer data to a speed of 12 megabits per second, but
those 127 devices have to share that speed. Since USB-compliant devices can draw
power from a USB port only a few power drawing devices can connect at the same time
without the computer system complaining.
In 2003, USB 2.0 connectors were introduced on computers. These transfer data at 480
Mbps. Older USB devices work with USB 2.0 ports, but at 12 Mbps. USB 2.0 devices
also work with older USB ports, again at the lower speed. USB 2.0 is useful for adding
external hard drives like Maxtor drive.
Anyone who has been around computers for more than two or three years know
the problem that the Universal Serial Bus is trying to solve -- in the past,
connecting devices to computers has been a real headache!
Printers connected to parallel printer ports, and most computers only came with
one. Things like Zip drives, which need a high-speed connection into the computer,
would use the parallel port as well, often with limited success and not much speed.
Modems used the serial port, but so did some printers and a variety of odd things
like Palm Pilots and digital cameras. Most computers have at most two serial ports,
and they are very slow in most cases.
Devices that needed faster connections came with their own cards, which had to fit
in a card slot inside the computer's case. Unfortunately, the number of card slots is
limited and you needed a Ph.D. to install the software for some of the cards.
The goal of USB is to end all of these headaches. The Universal Serial Bus gives you a
single, standardized, easy-to-use way to connect up to 127 devices to a computer.
Just about every peripheral made now comes in a USB version. A sample list of USB
devices that you can buy today includes:
TheDirectData.com Page 25
Scientific data acquisition devices
Storage devices such as Zip drives
The pin out description and the close-up shot of USB port on CPU Cabinet is given
below. Notice the USB logo at top of it.
USB Socket as seen on Computer Cabinet
Pin out Description on Motherboard
1 VCC +5voltage (max. 500mAmp)
2 D- Data - (Input to computer)
3 D+ Data + (Output from computer)
4 GND Ground for voltage
The port on motherboard gives the 5volt Output (500mAmp) to power the low voltage
peripherals which can be used with computer without extra power supply like USB
modems or Floppy Drives. For my Sony vaio laptop, I have an external Floppy Drive
and CDROM drive which work only on USB ports and not the extra voltage power.
Connecting a USB device to a computer is simple -- you find the USB connector on the
back of your machine and plug the USB connector into it.
TheDirectData.com Page 26
The rectangular socket is a typical USB socket on the back of a PC.
A typical USB connector, called an "A" connection
If it is a new device, the operating system auto-detects it and asks for the driver disk. If
the device has already been installed, the computer activates it and starts talking to it.
USB devices can be connected and disconnected at any time.
TheDirectData.com Page 27
Many USB devices come with their own built-in cable, and the cable has an "A"
connection on it. If not, then the device has a socket on it that accepts a USB "B"
A typical "B" connection
The USB standard uses "A" and "B" connectors to avoid confusion:
"A" connectors head "upstream" toward the computer.
"B" connectors head "downstream" and connect to individual devices.
By using different connectors on the upstream and downstream end, it is
impossible to ever get confused -- if you connect any USB cable's "B" connector
into a device, you know that it will work. Similarly, you can plug any "A" connector
into any "A" socket and know that it will work.
4.2 RUNNING OUT OF PORTS
Most computers that you buy today come with one or two USB sockets. With so many
USB devices on the market today, you easily run out of sockets very quickly. For
example, on the computer that I am typing on right now, I have a USB printer, a USB
scanner, a USB Web cam and a USB network connection. My computer has only one
USB connector on it, so the obvious question is, "How do you hook up all the devices?"
The easy solution to the problem is to buy an inexpensive USB hub. The USB standard
supports up to 127 devices and USB hubs are a part of the standard.
TheDirectData.com Page 28
A typical USB four-port hub accepts 4 "A" connections.
TheDirectData.com Page 29
A hub typically has four new ports, but may have many more. You plug the hub into your
computer, and then plug your devices (or other hubs) into the hub. By chaining hubs
together, you can build up dozens of available USB ports on a single computer.
Hubs can be powered or empowered. As you will see on the next page, the USB
standard allows for devices to draw their power from their USB connection. Obviously, a
high-power device like a printer or scanner will have its own power supply, but low-
power devices like mice and digital cameras get their power from the bus in order to
simplify them. The power (up to 500 milliamps at 5 volts) comes from the computer. If
you have lots of self-powered devices (like printers and scanners), then your hub does not
need to be powered -- none of the devices connecting to the hub needs additional power,
so the computer can handle it. If you have lots of empowered devices like mice and
cameras, you probably need a powered hub. The hub has its own transformer and it
supplies power to the bus so that the devices do not overload the computer's supply.
4.3 HOW USB PORTS WORK
The Universal Serial Bus has the following features:
The computer acts as the host.
Up to 127 devices can connect to the host, either directly or by way of USB hubs.
Individual USB cables can run as long as 5 meters; with hubs, devices can be up to
30 meters (six cables' worth) away from the host.
With USB 2, the bus has a maximum data rate of 480 megabits per second.
A USB cable has two wires for power (+5 volts and ground) and a twisted pair of
wires to carry the data.
On the power wires, the computer can supply up to 500 milliamps of power at 5
Low-power devices (such as mice) can draw their power directly from the bus.
High-power devices (such as printers) have their own power supplies and draw minimal
power from the bus. Hubs can have their own power supplies to provide power to
devices connected to the hub.
USB devices are hot-swappable, meaning you can plug them into the bus and
unplug them any time.
Many USB devices can be put to sleep by the host computer when the computer
enters a power-saving mode.
TheDirectData.com Page 30
The devices connected to a USB port rely on the USB cable to carry power and data.
Inside a USB cable: There are two wires for power -- +5 volts (red)
and ground (brown) -- and a twisted pair (yellow and blue) of wires
to carry the data. The cable is also shielded.
When the host powers up, it queries all of the devices connected to the bus and assigns
each one an address. This process is called enumeration -- devices are also enumerated
when they connect to the bus. The host also finds out from each device what type of data
transfer it wishes to perform:
Interrupt - A device like a mouse or a keyboard, which will be sending very little
data, would choose the interrupt mode.
Bulk - A device like a printer, which receives data in one big packet, uses the
bulk transfer mode. A block of data is sent to the printer (in 64-byte chunks) and
verified to make sure it is correct.
Isochronous - A streaming device (such as speakers) uses the isochronous mode.
Data streams between the device and the host in real-time, and there is no error
The host can also send commands or query parameters with control packets.
You can link one USB product to another in an ongoing chain. You don’t even need to shut down and restart
your PC to attach or remove a peripheral. Just plug it in! The PC automatically detects the peripheral and
starts up the installation software.
4.4 USB 2.0
The standard for USB version 2.0 was released in April 2000 and serves as an
upgrade for USB 1.1.
USB 2.0 (High-speed USB) provides additional bandwidth for multimedia and storage
applications and has a data transmission speed 40 times faster than USB 1.1. To allow a
smooth transition for both consumers and manufacturers, USB 2.0 has full forward and
backward compatibility with original USB devices and works with cables and connectors
made for original USB, too.
TheDirectData.com Page 31
Supporting three speed modes (1.5, 12 and 480 megabits per second), USB 2.0 supports
low-bandwidth devices such as keyboards and mice, as well as high-bandwidth ones like
high-resolution Web cams, scanners, printers and high-capacity storage systems. The
deployment of USB 2.0 has allowed PC industry leaders to forge ahead with the
development of next-generation PC peripherals to complement existing high-performance
PCs. The transmission speed of USB 2.0 also facilitates the development of next-
generation PCs and applications. In addition to improving functionality and encouraging
innovation, USB 2.0 increases the productivity of user applications and allows the user to
run multiple PC applications at once or several high-performance peripherals
4.5 USB CONVERTER
There are too many converters available to operate different devices as below:
4.5.1 USB to Serial Converter
The Model UC-232A enables the addition of Com
[Serial] Ports to Windows® and Macintosh® PCs
having USB capability. Use with newer PCs or
Laptops that do not have serial ports.
4.5.2 USB to Parallel Converter
The Model BF-1284 converter enables Parallel IEEE
1284 Devices to be connected to computers featuring
the Universal Serial Bus. Available with 25-pin or
4.5.3 USB to PS/2 and ADB converter
The MT-606 Series Converters enable existing
PC/AT, PS/2 and Macintosh ADB keyboards, pointing
devices, and barcode scanners to be used on computers
with Universal Serial Bus.
TheDirectData.com Page 32
4.5.4 USB 2.0 to IDE/ATAPI Converter
The Model UDA200 Converter can be used with
Hard Drives and CDROMs for portable storage. For
4.5.5 USB to SCSI-2 Converter
The Model BF-660 Converter works with SCSI
Hard Drives and CDROMS. Works with both
Windows® and Macintosh® PCs.
4.5.6 USB to IRDA Converter
The Model BF-120 Converter enables IRDA wireless
data communications through your PCs USB port. The
unit meets all of the requirements of IRDA 1.1.
4.5.7 USB to Game port Converter
The Model RM-203 Converter enables the use of older
analog joysticks and game controllers on newer
computers that only have USB.
4.6 CONNECT 4 SERIAL DEVICES TO YOUR COMPUTER
The Key span USB 4-Port Serial Adapter allows 4 serial devices to be connected
to a single USB port. It provides a simple way to add serial ports to a PC without
the hassle of installing a serial card, turning off the PC, or configuring IRQs.
TheDirectData.com Page 33
Plugs into a USB port on a PC or Macintosh
Provides four RS-232 male DB9 ports for direct connection to serial devices
Supports data rates up to 230 Kbps per port
Draws its power from the USB connection -- a power adapter is not required
Five year warranty
4.7 USB CABLES DATA AND EXTENSION
4.7.1 USB Link Cable
The Model BF-100C Direct-Link cable is the fast
solution to peer-to-peer file transfer between two
Windows or Apple computers via their USB Ports. All
software and drivers are included with the cable.
4.7.2 USB 2.0 Link Cable
The Model BF-7311 Multi-Link cable is the fast
solution to peer-to-peer file transfer between two
Windows computers. Operating at USB 2.0 speeds gives
40 times faster transfer times than USB 1.1 cables. All
software and drivers are included with the cable.
4.7.3 USB Extension Cable
The Model BF-200C Extension Cable is an active
device that can extend the cable length of any USB
device, without signal loss. Works with both Windows®
and Macintosh® PCs.
TheDirectData.com Page 34
4.7.4 USB 2.0 Extension Cable
The Model BF-3000 Extension Cable is an active device
that can extend the cable length of any USB device,
without signal loss. Works with both Windows® and
4.7.5 USB Network Cable
The Model ULK-003 USB-Linq/NET Cable provides an
easy way of connecting a PC or Laptop to an existing
network. The connection is made through a USB
connection to a computer already on the network.
4.8 USB HUBS
4.8.1 USB 2.0 Ultra Slim 4-Port Hub
Model UH-254. Great for notebooks! Has a super
compact design that can be stored in an unused
PCMCIA slot. The connecting cable tucks away in
its own compartment.
4.8.2 USB 2.0 4-Port Hub
Model UH-204. This USB 2.0 hub features independent
over current protection and LED indicators for each port.
Can be operated in bus-powered or self-powered mode.
Power supply included. Backward compatible with USB
4.8.3 USB 2-Port Compact Hub
Model UH-102 is a compact 2-port USB hub designed for
use with notebook or desktop computers. It is compatible
with both Windows and Macintosh computers.
TheDirectData.com Page 35
4.9 USB COMPUTER PERIPHERALS
4.9.1 Multimedia Keyboard with USB Hub
The Model USBK01 Keyboard can be
used to add two additional USB ports.
4.9.2 USB Wireless Mouse
The Model UMRF01 Wireless Mouse can be used
to add RF wireless mouse to computer running
4.10 USB Data Storage and Memory Cards
4.10.1 40, 60 & 80 GB (2.5 & 3.5 inch) USB 2.0 Hard Drives
The HDUSB Series are 40, 60 & 80GB USB 2.0 hard
drives built around Maxtor 7200RPM drives. They are
compatible with Windows 98SE, ME, XP and 2000.
Turn any IDE Hard Drive into a portable, high speed,
storage device. Power Supply and cable included.
4.10.2 USB Flash Drives
The BF-2300 Series USB Flash Drives are available in
32MB, 64MB, 128MB and 256MB sizes.
4.10.3 6-in-1 USB 2.0 Memory Card Reader
The FRA3-00 Series Memory Card Reader/Writers are
capable of handling Compact Flash, Micro drive, Smart
Media, Multimedia, Memory Stick and Secure Digital
Memory Cards. The unit has a USB 2.0 high speed interface.
This pocket-sized unit has a fold-away USB cable.
TheDirectData.com Page 36
4.10.4 5-in-1 Memory Card Reader
The FPT-DXX-US Series Memory Card
Reader/Writers are capable of handling Compact
Flash, Micro drive, Smart Media, Multimedia and
Secure Digital Memory Cards. The unit also has
16MB or 32MB of built-in Flash Memory. This
pocket-sized unit has a fold-away USB cable.
TheDirectData.com Page 37
Hardware interfacing is very useful to operate various devices which are related to
computer or not. There are three ways to operate different devices.
1. Printer Port
2. Serial Port
3. USB Port
Printer port is commonly used to interface devices like printer, scanner, CD burner etc. It
is also used to operate any AC or DC external devices, to operate different circuits
interface between two PCs.
Serial port is also used to interface devices like mouse, keyboard, etc. It is also used to
operate circuits and interface between two PCs.
USB port is most preferable today. It is very useful to operate devices which are operated
by printer & serial port and also operate those devices which are not operated by them
with more speed then printer & serial port. It is also used to interface between two PCs.
TheDirectData.com Page 38
TheDirectData.com Page 39