Professional Documents
Culture Documents
Lecture #8: Communication Protocols and Interface
Lecture #8: Communication Protocols and Interface
Communication Protocols
Wired connections
Wireless connections
Radio Frequency (RF)
Infrared (IR)
Data Transmission
Synchronous Asynchronous
When a PC sends data to a printer or other device using a parallel port, it sends 8 bits of data (1 byte) at a
time. These 8 bits are transmitted parallel to each other. The standard parallel port is capable of sending
50 to 100 kilobytes of data per second.
SPP/EPP/ECP
The original specification for parallel ports was unidirectional, meaning that data only traveled in one
direction for each pin. With the introduction of the PS/2 in 1987, IBM offered a new bidirectional
parallel port design. This mode is commonly known as Standard Parallel Port (SPP) and has completely
replaced the original design. Bidirectional communication allows each device to receive data as well as
transmit it. Many devices use the eight pins (2 through 9) originally designated for data. Using the same
Close on the heels of the introduction of EPP, Microsoft and Hewlett Packard jointly announced a
specification called Extended Capabilities Port (ECP) in 1992. While EPP was geared toward other
devices, ECP was designed to provide improved speed and functionality for printers.
In 1994, the IEEE 1284 standard was released. It included the two specifications for parallel port devices,
EPP and ECP. In order for them to work, both the operating system and the device must support the
required specification. This is seldom a problem today since most computers support SPP, ECP and EPP
and will detect which mode needs to be used, depending on the attached device. If you need to manually
select a mode, you can do so through the BIOS (Basic Input/Output System) on most computers.
2. Asynchronous Data Transmission: Data is transmitted on bit at a time using start bits and strop bits to
maintain integrity between words.
Disadvantages:
Lower speeds than parallel transmissions.
Baud Rate: The measure of the number of signal elements transmitted or received per second. Baud rates
and data bit rates (bps-bit per second) are not equal in asynchronous transmission due to the start and stop
bits.
Start Bit: The bit preceding every word that signals the receiver a data word is coming. In some
microcontroller (e.g., HC11) the start bit is logic low (0), while in others the start bit is logic high (1).
Parity Bit: A bit sometimes added to the end of the data word. There are three possible settings for the
parity: none, even, and odd. The setting represents the sum of the 1s transmitted.
Stop Bit: The bit or bits following every word that signals the end of a data word. In some microcontroller
(e.g., HC11) the stop bit is logic high (1), while in others the start bit is logic low (0).
Half Duplex: Two-way serial communication using only one line. With half duplex, the device can not
transmit and received at the same time.
Full Duplex: Two-way serial communication using two lines. With full duplex, data can be
simultaneously transmitted and received.
Applications of SCI
The SCI can be used to transmit/receive data through a modem.
The SCI can be used to transmit/receive data with any device that uses RS-232-C protocol.
RS-232
RS-232C is the oldest and most popular serial communication standard. It is the standard used on PC
COM port hardware. It is designed to connect two systems only and is "single ended", meaning that it
uses one wire for data and one for ground. It is a robust interface with speeds to 115,200 baud and will
withstand a short circuit between any 2 pins. Maximum signal voltages are 15 volts. Cable length
depends on baud rate but is typically 50 feet maximum.
Solution: Since in a synchronous data transmission system, the baud rate is same as bps (bit per second) ,
thus at 9600 bps, each bit takes 1/9600 seconds or about 104 s.
Ex 2: Suppose the number 45 in hex is to be transmitted in an 8-bit asynchronous format with odd
parity. Sketch the output.
Solution: the number 45 in hex is 01000101 in binary. Keep in mind that the data is sent least
significant bit (LSB) first, the result is displayed below. Since there are already three 1s in the data word,
the parity bit would be set to zero to mean the parity odd.
(Usually in the PC environment you will find 7 or 8 bit words, the first is to accommodate all upper and
lower case text characters in ASCII codes (the 127 characters), the latter one is used to exactly correspond
to one byte. By convention, the least significant bit of the word is sent first and the most significant bit is
sent last. When communicating the sender encodes the each word by adding a start bit in front and 1 or 2
stop bits at the end.
Sometimes it will add a parity bit between the last bit of the word and the first stop bit, this used as a data
integrity check. This is often referred to as a data frame. Five different parity bits can be used, the mark
parity bit is always set at a logical 1, the space parity bit is always set at a logical 0, the even parity bit
is set to logical 1 by counting the number of bits in the word and determining if the result is even, in the
odd parity bit, the parity bit is set to logical 1 if the result is odd. The later two methods offer a means of
detecting bit level transmission errors. Note that you don't have to use parity bits, thus eliminating 1 bit in
each frame, this is often referred to as non parity bit frame).
Most equipment using RS-232 serial ports use a DB-25 type connector, while many PCs today use DB-9
connectors since all you need in asynchronous mode is 9 signals, as shown in Figure 2. Normally the
male connector is on the DTE side and the female connector is on the DCE side even if this is not always
the case.
V.24 CIRCUIT
CIRCUIT DB-25 Pin # DB-9 Pin # SIGNAL NAME
#
AA 101 1 - Protective Ground
AB 102 7 5 Signal Ground
BA 103 2 3 Transmitted Data
BB 104 3 2 Received Data
CA 105 4 7 Request to send
CB 106 5 8 Clear to send
CC 107 6 6 Data set ready
CD 108 20 4 Data terminal ready
CE 125 22 9 Ring detector
CF 109 8 1 Carrier detect
CG 110 21 - Signal quality detect
CH / CI 111 / 112 23 - Data signal rate selector
DA 113 24 - Transmitter signal timing (DTE)
DB 114 15 - Transmitter signal timing (DCE)
DD 115 17 - Receiver signal timing
SBA 118 14 - Secondary TX
SBB 119 16 - Secondary RX
SCA 120 19 - Secondary RTS
SCB 121 13 - Secondary CTS
SCF 122 12 - Secondary CD
11 - N/C
18 - N/C
25 - N/C
Timing circuits: In synchronous mode, it is necessary to have some way to exchange clock signals, here
are three timing circuits used in the RS-232 protocol.
NOTE: the following materials between two +++ lines are for reference only, not included in
the exam
++++++++++++++++++++++++++++Start Here +++++++++++++++++++++++++++++++++++
RS-232, RS-423, RS-422 and RS-485 Serial Interface Standard Summary
All four of these standards were written by the EIA (Electronics Industry Association) to allow
peripherals and computers to communicate with each other regardless of manufacturer. There are
identical government (MIL spec) and international (CCITT) standards.
These standards are for asynchronous serial communication. This means that data is transferred one bit at
a time using a start bit, 7 or 8 data bits, stop bit(s) and an optional parity bit. The data is "self clocking" so
that once the sender and receiver agree on the baud rate, the timing of the individual bits is based only on
the start and stop bits.
Alternatives to these standards are synchronous communication and parallel communication.
Synchronous communication requires an additional clock line between the sender and receiver. Parallel
communication requires a clock line, usually some control signals and several data lines. Both parallel
and synchronous communication systems can transfer data faster than asynchronous serial systems but
require more wires in the interconnect cables. PC parallel ports are examples of parallel communication.
IBM's SDLC and HDLC are synchronous serial communication protocols and have been typically used in
mainframe communications.
RS-232, 423, 422 and 485 specify the communication system characteristics of the hardware such as
voltage levels, terminating resistances, cable lengths, etc. The standards say nothing about the software
protocol or how data is framed, addressed, checked for errors or interpreted.
RS-485
RS-485 is an improved RS-422 with the capability to connect up to 16 devices (transceivers) on one serial
bus to form a network. Such a network can have a "daisy chain" topology where each device is connected
to two other devices except for the devices on the ends. Only one device may drive data onto the bus at a
time. The standard does not specify the rules for deciding who transmits and when on such a network.
That's up to the system designer to define.
RS-423
RS-423 is similar to RS-232C except that it allows for higher baud rates and longer cable lengths because
it tolerates ground voltage differences between sender and receiver. The maximum signal voltage levels
are 6 volts. Ground voltage differences can occur in electrically noisy environments where heavy
electrical machinery is operating.
RS-422
RS-422, like RS-232, is used to connect only two systems. It uses differential, or "double ended" data
transmission, which means that data is transmitted simultaneously on two wires between two stations
independent of the ground wire. Each signal requires 2 wires with a ground present in the system. The
advantage of this method over RS-232 is higher speeds and longer cable lengths - 4000 feet at a 100K
baud rate, for example.
Introduction
RS-232 was created for one purpose, to interface between Data Terminal Equipment (DTE) and Data
Communication Equipment (DCE) employing serial binary data interchange. RS-232 was originally
History
RS-232 was originally adopted in 1960 by the Electronic Industries Association (EIA). The standard
evolved over the years and in 1969 the third revision (RS-232C) was to be the standard of choice of PC
makers. In 1987 a fourth revision was adopted (RS-232D also known as EIA-232D). In most part of this
new revision, they added 3 additional test lines. In this lecture note you will see several parts of the
original RS-232C standard and mostly the ones used in the PC world.