Anda di halaman 1dari 40

1

Serial Communication
EIA RS232, RS422 and RS485
Recommended Standard 232
The purpose of this course note is to attempt to describe the main elements in Serial
Communication. This application note attempts to cover enough technical details of
RS232, RS422 and RS485.

EI A - Electroonic Industries Association

Must be a Sender and Receiver

A protocol is a set of rules which governs the transfer of data
between computers. Protocols allow communication between
computers and networks.

Handshaking is used to establish which protocols to use.
Handshaking controls the flow of data between computers

Protocols will determine the speed of transmission, error checking
method, size of bytes, and whether synchronous or asynchronous

Examples of protocols are: RS-232, TCP/IP, ....

Characteristics of Communication
Systems
5 Basic Components
Every communication system has 5 basic requirements
Data Source (where the data originates)
Transmitter (device used to transmit data)
Transmission Medium (cables or non cable)
Receiver (device used to receive data)
Destination (where the data will be placed)
5 Basic Components
- simplex: One direction only
Transmission Direction
Half Duplex Transmission
half duplex: Both
directions but
only one
direction at a
time
Full Duplex Transmission
full duplex:
send and
receive both
directions at
once


RS232
Analog ADC Line coding
Digital
transmission
Sampling
Quantization
Coding
RZ,
NRZ,
AMI
ASK,
FSK,
PSK
Block diagram for digital transmission system
Before any digital signal can be transmitted (via
transmission medium or wireless) it must
undergo line coding. What is line coding??
PCM
9
We are
here..
Line Coding
Pulse-code modulation (PCM) is a digital representation of an analog signal where the magnitude
of the signal is sampled regularly at uniform intervals, then quantized to a series of symbols in a
numeric (usually binary) code.
Analog Data, Digital Signals
PCM Procedures
30 August 2013
10
Pulse-amplitude modulation, acronym PAM, is a form of signal modulation where the message
information is encoded in the amplitude of a series of signal pulses.
Sampled signal (discrete
signal): discrete time,
continuous values.
Quantized signal: continuous
time, discrete values
Digital signal (sampled,
quantized): discrete time,
discrete values.
Quantization is the procedure of constraining something from a relatively large or continuous
set of values (such as the real numbers) to a relatively small discrete set (such as the integers).
Mch ly mu v gi
- ly mu, cng tc c ng li trong mt khong thi gian t np n gi
tr V
in
. Khi cng tc c nh ra, gi tr in th c gi nguyn.
- Thi gian cng tc ng li (t) c xc nh nh sau (trong khong thi gian ny, t
c th np n 99% gi tr V
in
)
nh l ly mu (tiu chun Nyquist)
Tt c thng tin ca tn hiu gc c th c phc hi nu n c ly mu vi tn s
(f
s
) ln gp t nht 2 ln tn s cao nht (f
h
) trong tn hiu gc.
Thi gian ly mu:
information
PCM
Line
coder
channel
Reasons for line
coding:
1. Synchronization
2. Error detection
3. Error correction
The purpose of a line code is to
match the output signal
to the channel for baseband
transmission.
drawbacks are that it is not self-clocking
(Receiver Setting the clock matching the senders )
Line Coding
Unipolar encoding (NRZ)
RZ encoding
Digital Data Analog Signals
Encoding is by modulation of a continuous
sinusoidal carrier signal. This involves
alteration of some characteristics of the
carrier signal - amplitude, frequency, or phase.
Various encoding techniques, ASK, FSK, PSK,...
ASK
Data Multiplexing
A multiplexer is a device which shares a communication link between
a number of devices (users).
Rather than provide a separate circuit for each device, the
multiplexer combines each low speed circuit onto a single high speed
link. The cost of the single high speed link is less than the required
number of low speed links.
It does this by time or frequency division.
Time Division Multiplexing
In time division, the communications link is subdivided in terms of time.
Each sub-circuit is given the channel for a limited amount of time, before it
is switched over to the next user, and so on
In the picture bellow it can be seen that each sub-channel occupies the
entire bandwidth of the channel, but only for a portion of the time
Frequency Division Multiplexing
In frequency division multiplexing, each sub-channel is
separated by frequency (each sub-channel is allocated part
of the bandwidth of the main channel)
The speed or bandwidth of the main link is the sum of the
individual sub-channel speeds or bandwidth.
Modems
Modems are devices which allow digital data signals to be
transmitted across an analogue link.
Modem stands for modulator/demodulator. A modem
changes the digital signal to an analogue frequency, and
sends this tone across the analogue link. At the other end,
another modem receives the signal and converts it back to
digital.
DTE - Data Terminal Equipment
DCE Data Communications Equipment.
Signal element versus data element
Pulse Rate versus Bit Rate
Pulse rate number of pulses per second
Bit rate number of bits per second
If pulse defines only one bit, Pulse rate and Bit rate are the same.
If pulse defines more than one bit, Bit rate is greater than Pulse rate .
Bit Rate = Pulse Rate x log
2
L
L is the number of data levels of the signal.

Parity
The parity bit included at the end of the character to check for any error during
transmission
Even Parity : Total no. of bits including parity bit is Even
Odd Parity : Total no. of bits including parity is Odd
Only data bits and parity bit are considered for finding parity bit value.
Example for Even parity : 0101 0101 0, total 4 ones
Example for Odd parity : 0101 0101 1, total 5 ones
Even Parity
Graham Betts
Any transmission May be:
Analog or Digital
Serial or Parallel
Communication Concepts
-Each bit has its own piece of wire along which it travels
- Often used to send data to a printer

Parallel Transmission
All bits are sent simultaneously




R
e
c
e
i
v
e
r

r
e
c
e
i
v
e
d



S
e
n
d
e
r

t
r
a
n
s
m
i
t
t
e
d

1
0
0
1
1
0
0
1

Sender transmitted
Data is transmitted, on a single channel, one bit at a
time one after another


Receiver received
Serial Transmission
1 0 1 0 0 1 1 0
Serial Transmission
Shift Register
Serial Transmission
0 1 0 1
0 0 0
1 1 1
Start bit
Stop bit
Asynchronous Communication
Synchronous Communication
1
0
1
0 0 0
1 1
Clock
Data
Serial Communication
Name Sync
/Async
Type
Duplex
Max
devices
Max
speed
(Kbps)
Max
distance
(feet)
Pin
count
(not including ground)
RS-232 async peer full 2 115.2 30 2 (or 4 with HW handshake)
RS-422 async multi-drop half 10 10000 4,000 1 (unidirectional only,
additional pins for each
bidirectional comm.)
RS-485 async multi-point half 32 10000 4,000 2
I
2
C sync multi-
master
half
Limitation based
on bus
capacitance and
bit rate
3400 <10 2
SPI sync multi-
master
full
Limitation based
on bus
capacitance and
bit rate
>1000 <10 3+1(Additional pins needed
for every slave if slave count is
more than one)
Microwire sync master/slav
e
full
Limitation based
on bus
capacitance and
bit rate
>625 <10 3+1(Additional pins needed
for every slave if slave count is
more than one)
1-Wire async master/slav
e
half
Limitation based
on bus
capacitance and
bit rate
16 1,000 1
Serial Vs Parallel Communication System Comparison
Data Transfer Speed
Complexity and Cost of Serial and Parallel Interface


Data Transfer Quality & Crosstalk Noise Interference

High Frequency Performance


Flexibility to Upgrade the Data Communication
Software/Hardware
What is the latest Trend? Serial or Parallel
How to Choose the Best Data Transfer Interface from Serial
or Parallel?




Creating a parallel port relatively simple, requiring only a latch to copy data onto a data bus. In contrast, most serial communication must first be converted
back into parallel form by a universal asynchronous receiver/transmitter (UART) before they may be directly connected to a data bus. But in terms of
transmission channel costs such as data bus cable length, data bus buffers, interface connectors, area occupied on printed ci rcuit board (PCB), the parallel data
communication is somewhat costlier.
Crosstalk creates interference between the parallel lines, and the effect worsens with the length of the communication link.
Parallel buses are hard to run at high frequencies :
1. It is hard to route many signals across a board without introducing timing variation (clock skew) between
them the more variation the lower maximum frequency is.
2. Many wires switching simultaneously produce lots of EMI and interfere with each other. More EMI
(ElectroMagnetic Interference) leads to less maximum frequency.
Speed of the parallel data transfer is extremely high compared to serial data transfer.
Parallel data transfer mechanism more rely on hardware
resources and hence difficult and costlier.
Parallel- short distance. Serial longer distance.
Parallel- Low speed/frequency data transfer. Serial High speed/frequency data transfer.
Data Transmission Signals
RS232 Standard
Interface between Data Terminal Equipment (DTE) and Data
Communication Equipment (DCE) employing serial binary data
interchanges.
Logic 0 : +3V to 15 VDC
Logic 1 : -3V to -15 VDC
Maximum Distance : 15m or 50ft


Limitations of RS232 Standards
Large-amplitude, bipolar voltage swings complicate power
supply and driver design
Non-differential signaling limits noise immunity
Cable length typically limited to 15m, more with low-
capacitance cables.
Slower than modern serial interfaces, such as USB
No standard way to connect more than two devices on one
bus
RS422 Standards
The RS-422 standard defines a balanced (or differential) data communications
interface using two separate wires for each signal.
Due to the high noise immunity of the RS-422 standard, high data speeds and long
distances can be achieved.
The RS-422 specification allows reliable serial data communications for:
Distances of up to 1200 meters
Data rates of up to 10 Mbps
0 to +5V nominal signal swing
RS-422 uses two separate twisted pairs and can be half or full duplex.
RS485 Standards
RS-485 interface has tri-state capability, so it can be used in multi-drop
systems.
RS-485 can be half or full duplex and has a 2- or 4-wire version.
The 2-wire version uses a single twisted pair; the 4-wire version uses two
twisted pairs.
Each Slave device has a unique address and will only respond to requests
from the Master.
The Slave never initiates communication.


RS-485 can have multiple Commanding Devices and multiple
Listening Devices. RS-422 can have only one Commander and
multiple Listeners.

Anda mungkin juga menyukai