Sie sind auf Seite 1von 47

Serial

Communications

What is Serial?

The serial port sends and receives bytes of


information one bit at a time.

This is slower than parallel communication, which


allows the transmission of an entire byte at once;
however, it is simpler and can be used over longer
distances.

For example, the IEEE 488 specifications for


parallel communication state that the cabling
between equipment can be no more than 20
meters total, with no more than 2 meters between
any two devices;

serial can extend as much as 1200 meters.

Standards
RS-232, RS-422, and RS-485

The terms RS-232, RS-422, and RS-485 all refer to


physical standards for serial communication
developed by the Electronic Industries Association
(EIA).

The standards specify the electrical interface


between equipment.

Any device that conforms to one of the standards


above should be able to communicate with any
other device conforming to the same standard.

What is RS-232

RS-232 is a popular communications interface for connecting


modems and data acquisition devices (i.e. GPS receivers,
electronic balances, data loggers, ...) to computers.

RS-232 can be plugged straight into the computers serial port


(know as COM or Comm port).

Single Ended meaning the signals are referenced to ground


and therefore limited in cable length

Approx. 50 maximum cable length

Many A.V., lighting and other devices implement RS-232

What is RS-232

In telecommunications, RS-232 is a standard for


serial communication transmission of data.

It formally defines the signals connecting between a DTE (


data terminal equipment) such as a computer terminal, and a DCE (
data circuit-terminating equipment , originally defined as data
communication equipment), such as a modem.

The RS-232 standard is commonly used in computer serial ports.

The standard defines the electrical characteristics and timing of


signals, the meaning of signals, and the physical size and pinout of
connectors.

The current version of the standard is TIA-232-F Interface Between


Data Terminal Equipment and Data Circuit-Terminating Equipment
Employing Serial Binary Data Interchange, issued in 1997.

What is RS-232

An RS-232 serial port was once a standard feature of a


personal computer, used for connections to modems, printers, mice,
data storage, uninterruptible power supplies , and other peripheral
devices.

However, RS-232 is hampered by low transmission speed, large


voltage swing, and large standard connectors.

In modern personal computers, USB has displaced RS-232 from


most of its peripheral interface roles.

Many computers do not come equipped with RS-232 ports and


must use either an external USB-to-RS-232 converter or an internal
expansion card with one or more serial ports to connect to RS-232
peripherals.

Nevertheless, RS-232 devices are still used, especially in industrial


machines, networking equipment and scientific instruments.

RS-232-C Interface
EIA

in cooperation with Bell Systems,


independent modem and computer
manufacturers
Standard for interface between Data
Terminal Equipment (DTE) and Data
Communication Equipment (DCE)
employing serial bit interchange
Telephone
Network
DTE

DTE
DCE
RS-232-C

DCE
RS-232-C

RS-232 Signals

Architecturally RS-232 is a
bi-directional point to point
link.
(serial port - PC side)

Two independent channels are


established for two-way (fullduplex) communications.

RS-232 can also carry


additional signals used for flow
control (RTS, CTS) and modem
control (DCD, DTR, DSR, RI).

Scope of the standarad

The Electronic Industries Association (EIA) standard RS-232-C


[1] as of 1969 defines:

Electrical signal characteristics such as voltage levels,


signaling rate, timing and slew-rate of signals, voltage
withstand level, short-circuit behavior, and maximum load
capacitance.

Interface mechanical characteristics, pluggable connectors and


pin identification.

Functions of each circuit in the interface connector.

Standard subsets of interface circuits for selected telecom


applications.

Voltage Levels

The RS-232 standard defines the voltage levels that correspond to


logical one and logical zero levels for the data transmission and the
control signal lines.

Valid signals are either in the range of +3 to +15 volts or the range 3
to 15 volts with respect to the "Common Ground" (GND) pin;
consequently, the range between 3 to +3 volts is not a valid RS-232
level.

For data transmission lines (TxD, RxD and their secondary channel
equivalents) logic one is defined as a negative voltage, the signal
condition is called "mark". Logic zero is positive and the signal
condition is termed "space".

Control signals have the opposite polarity: the asserted or active state
is positive voltage and the deasserted or inactive state is negative
voltage. Examples of control lines include request to send (RTS), clear
to send (CTS), data terminal ready (DTR), and data set ready (DSR

RS-232 logic and voltage levels


Data circuits

Control circuits

Voltage

0 (space)

Asserted

+3 to +15 V

1 (mark)

Deasserted

15 to 3 V

The standard specifies a maximum open-circuit voltage of 25 volts:


signal

levels of 5 V, 10 V, 12 V, and 15 V are all commonly seen


depending on the voltages available to the line driver circuit.
Some RS-232 driver chips have inbuilt circuitry to produce the
required voltages from a 3 or 5 volt supply.

RS-232 drivers and receivers must be able to withstand indefinite


short circuit to ground or to any voltage level up to 25 volts.

The

slew rate, or how fast the signal changes between levels, is also
controlled.

RS-232 Line Driver

Unbalanced Line Drivers

Each signal appears on the interface connector as a voltage with


reference to a signal ground.

The idle state (MARK) has the signal level negative with
respect to common whereas the active state (SPACE) has the
signal level positive respest to the same reference.

Handshaking

Handshaking is the process of ensuring that data not be


transmitted when the receiver is not ready and to ensure error
free transmission.

Handshaking can be either hardware or software

Handshaking may not be required if the amount of data is


small.

RS-232 Speed

How fast can RS-232 be?

The maximum speed, according to the standard, is 20kbit/s.


However, modern equipment can operate much faster than this. (i.e.
Lynx can reach 115200 baud.)

The length of the cable also plays a part in


maximum speed.
The longer the cable and the slower the speed at which you can obtain
accurate results.
A large wire capacitance and inductance limits the maximum length of
the cable and/or the maximum speed; Moreover higher is the
capacitance of the cable higer is the interference between two adjacent
signal wire.
50 feet (15m) @ max baudrate is commonly quoted as the maximum
distance.
It is not specified in EIA standard but its recommended respect these
values.

RS-232 sw settings

One byte of async data has:

Start Bit = 1 (always)

Stop bits = 1 (or 2)

Data Bits = 8 (or 7)

Parity = NONE (or EVEN or ODD)

+ 25

- 25

RS-232 Signals

Common 25 pin D-shell connector pinout used for


asynchronous data communications.

Pin
1
2
3
4
5
6
7
8
20
22

Signal
PGND Protective Ground
TXD Transmit Data
RXD Receive Data
RTS Ready To Send
CTS Clear To Send
DSR Data Set Ready
SG Signal Ground
CD Carrier Detect
DTR Data Terminal Ready
RI Ring Indicator

(serial port - PC side)

Limitations of RS 232 standard

The large voltage swings and requirement for positive and


negative supplies increases power consumption of the
interface and complicates power supply design.

The voltage swing requirement also limits the upper speed of


a compatible interface.

Single-ended signaling referred to a common signal ground


limits the noise immunity and transmission distance.

The handshaking and control lines of the interface are intended


for the setup and takedown of a dial-up communication circuit;
in particular, the use of handshake lines for flow control is not
reliably implemented in many devices.

The 25-way connector recommended in the standard is large


compared to current practice.

Because both ends of the RS-232 circuit depend on the ground pin
being zero volts, problems will occur when connecting machinery
and computers where the voltage between the ground pin on one
end, and the ground pin on the other is not zero. This may also
cause a hazardous ground loop.

Use of a common ground limits RS-232 to applications with


relatively short cables.

If the two devices are far enough apart or on separate power


systems, the local ground connections at either end of the cable
will have differing voltages; this difference will reduce the noise
margin of the signals.

Balanced, differential, serial connections such as USB, RS-422 and


RS-485 can tolerate larger ground voltage differences because of
the differential signaling.

Differential Data Transmission

When communicating at high data rates, or over long distances


in real world environments, single-ended methods are often
inadequate.

Differential data transmission (balanced differential signal)


offers superior performance in most applications.

Differential signals can help nullify the effects of ground shifts


and induced noise signals that can appear as common mode
voltages on a network.

RS422 (differential) was designed for greater distances and


higher Baud rates than RS232.

In its simplest form, a pair of converters from RS232 to RS422


(and back again) can be used to form an "RS232 extension
cord."

Differential Data Transmission

Data rates of up to 100K bits / second and distances up to


4000 Ft. can be accommodated with RS422.

RS422 is also specified for multi-drop applications where only


one driver is connected to, and transmits on, a "bus" of up to
10 receivers

While a multi-drop "type" application has many desirable


advantages, RS422 devices cannot be used to construct a truly
multi-point network.

A true multi-point network consists of multiple drivers and


receivers connected on a single bus, where any node can
transmit or receive data.

Differential Signaling

Differential signaling is a method for electrically transmitting


information using two complementary signals.

The technique sends the same electrical signal as a differential


pair of signals, each in its own conductor.

The pair of conductors can be wires (typically twisted


together) or traces on a circuit board.

The receiving circuit responds to the electrical difference


between the two signals, rather than the difference between a
single wire and ground.

The opposite technique is called single-ended signaling.

Differential pairs are usually found on printed circuit boards, in


twisted-pair and ribbon cables, and in connectors

Serial Networking

Slight tweaks on RS232: RS422 and RS485.

RS422 is a faster version of RS232: individual signal wires are


replaced by twisted pairs, which can be driven faster (10Mb/s,
up to 40 ft).

RS485 is a multi-drop version of RS422: in half duplex mode,


many nodes can send and receive on the same twisted pair (10
Mb/s). RS485 is a true network and a good choice for
networks of simple devices.

RS-422 and RS-485

These are less often used

Most often found in instrumentation systems in


industrial environments

Double Ended signal electronics means much


greater distances

Up to 5000 cable length

Cresnet is RS-485

RS-422, also known as TIA/EIA-422, is a technical standard


originated by the Electronic Industries Alliance that specifies
electrical characteristics of a digital signaling circuit.

Differential signaling can transmit data at rates as high as 10


Mbit/s, or may be sent on cables as long as 1500 meters.

Some systems directly interconnect using RS-422 signals, or


RS-422 converters may be used to extend the range of RS-232
connections.

The standard only defines signal levels; other properties of a


serial interface, such as electrical connectors and pin wiring,
are set by other standards.

RS 422
Standard

TIA/EIA-422

Physical Media

Twisted Pair

Network Topology

Point-to-point, Multi-dropped

Maximum Devices

10 (1 driver & 10 receivers)

Maximum Distance

1500 metres (4,900 ft)

Mode of Operation

Differential

Maximum Binary Rate

100 kbit/s 10 Mbit/s

Voltage Levels

6V to +6V (maximum differential


Voltage)

Mark (1)

Negative Voltages

Space (0)

Positive voltages

Available Signals

Tx+, Tx-, Rx+, Rx- (Full Duplex

SPECIFICATIONS

RS232

RS423

SINGLE
-ENDED

SINGLE
-ENDED

1 DRIVER

1 DRIVER

1 DRIVER

32 DRIVER

1 RECVR
50 FT.

10 RECVR
4000 FT.

10 RECVR
4000 FT.

32 RECVR
4000 FT.

Maximum Data Rate (40ft. - 4000ft. for RS422/RS485)

20kb/s

100kb/s

10Mb/s100Kb/s

10Mb/s100Kb/s

Maximum Driver Output Voltage

+/-25V

+/-6V

-0.25V to
+6V

-7V to
+12V

+/-5V to +/15V

+/-3.6V

+/-2.0V

+/-1.5V

+/-25V

+/-6V

+/-6V

+/-6V

3k to 7k

>=450

100

54

Power On

N/A

N/A

N/A

+/-100uA

Power Off

+/-6mA @ +/2v

+/-100uA

+/-100uA

+/-100uA

Slew Rate (Max.)

30V/uS

Adjustable

N/A

N/A

Receiver Input Voltage Range

+/-15V

+/-12V

-10V to
+10V

-7V to
+12V

Mode of Operation
Total Number of Drivers and Receivers on One Line (One
driver active at a time for RS485 networks)
Maximum Cable Length

Driver Output Signal Level


Loaded
(Loaded Min.)
Driver Output Signal Level
Unloaded
(Unloaded Max)
Driver Load Impedance (Ohms)
Max. Driver Current in
High Z State
Max. Driver Current in
High Z State

Receiver Input Sensitivity


Receiver Input Resistance (Ohms), (1 Standard Load for
RS485)

+/-3V
3k to 7k

RS422

RS485

DIFFERENTI DIFFERENTI
AL
AL

+/-200mV +/-200mV +/-200mV


4k min.

4k min.

>=12k

Quasi" multi-drop networks (4-wire) are often constructed


using RS422 devices.

These networks are often used in a half-duplex mode, where a


single master in a system sends a command to one of several
"slave" devices on a network.

Typically one device (node) is addressed by the host computer


and a response is received from that device

RS485 meets the requirements for a truly multi-point


communications network, and the standard specifies up to 32
drivers and 32 receivers on a single (2-wire) bus

With the introduction of "automatic" repeaters and highimpedance drivers / receivers this "limitation" can be extended
to hundreds (or even thousands) of nodes on a network.

RS485 extends the common mode range for both drivers and
receivers in the "tri-state" mode and with power off. Also,
RS485 drivers are able to withstand "data collisions" (bus
contention) problems and bus fault conditions.

RS-422 technical standards specify the electrical


characteristics of the balanced voltage digital interface circuit. [

RS-422 provides for data transmission, using balanced, or


differential, signaling, with unidirectional/non-reversible,
terminated or non-terminated transmission lines, point to
point, or multi-drop. In contrast to EIA-485 (which is multipoint instead of multi-drop), RS-422/V.11 does not allow
multiple drivers but only multiple receivers.

Revision B, published in May 1994 was reaffirmed by the


Telecommunications Industry Association in 2005.

What is RS-485

What is RS-485?
RS-485 is a EIA standard interface which is very common in the
data acquisition world

RS-485 provides balanced transmission line which also can be


shared in Multidrop mode.

It allows high data rates communications over long distances in


real world environments.

How fast can RS-485 be?

RS-485 was designed for greater distance and higher baudrates


than RS-232.

According to the standard, 100kbit/s is the maximum speed and


distance up to 4000 feet (1200 meters) can be achieved.

To solve the "data collision" problem often present in multidrop networks hardware units (converters, repeaters, microprocessor controls) can be constructed to remain in a receive
mode until they are ready to transmit data.

Single master systems offer a straight forward and simple


means of avoiding "data collisions" in a typical 2-wire, halfduplex, multi-drop system.

The master initiates a communications request to a "slave


node" by addressing that unit. The hardware detects the startbit of the transmission and automatically enables RS485
transmitter. Once a character is sent the hardware reverts
back into a receive mode in about 1-2 microseconds

SPECIFICATIONS

RS232

RS423

RS422

RS485

Mode of Operation

SINGLE
-ENDED

SINGLE
-ENDED

DIFFERENTIAL

DIFFERENTIAL

Total Number of Drivers and


Receivers on One Line (One
driver active at a time for
RS485 networks)

1 DRIVER
1 RECVR

1 DRIVER
10 RECVR

1 DRIVER
10 RECVR

32 DRIVER
32 RECVR

Maximum Cable Length

50 FT.

4000 FT.

4000 FT.

4000 FT.

Maximum Data Rate (40ft. 4000ft. for RS422/RS485)

20kb/s

100kb/s

10Mb/s-100Kb/s

10Mb/s-100Kb/s

Maximum Driver Output Voltage

+/-25V

+/-6V

-0.25V to +6V

-7V to +12V

+/-5V to +/-15V

+/-3.6V

+/-2.0V

+/-1.5V

+/-25V

+/-6V

+/-6V

+/-6V

3k to 7k

>=450

100

54

Max. Driver
Current in High Power On
Z State

N/A

N/A

N/A

+/-100uA

Max. Driver
Current in High Power Off
Z State

+/-6mA @ +/2v

+/-100uA

+/-100uA

+/-100uA

Slew Rate (Max.)

30V/uS

Adjustable

N/A

N/A

Receiver Input Voltage Range

+/-15V

+/-12V

-10V to +10V

-7V to +12V

Receiver Input Sensitivity

+/-3V

+/-200mV

+/-200mV

+/-200mV

3k to 7k

4k min.

4k min.

>=12k Popular
Products:

Driver Output
Signal Level
(Loaded Min.)

Loaded

Driver Output
Signal Level
(Unloaded
Max)

Unloaded

Driver Load Impedance (Ohms)

Receiver Input Resistance


(Ohms), (1 Standard Load for
RS485)

RS-485 Line Driver

Balanced Line Drivers


Voltage produced by the driver appears across a pair of signal
wires that transmit only one signal. Both wires are driven opposite.

RS-485 driver has always the Enable direction control signal.

Differential system provides noise immunity, because much of the


common mode signal can be rejected by the receiver. So ground
shifts and induced noise signals can be nullified.

RS-485 Network

RS-485 provides Half-Duplex, Multidrop communications over a


single twisted pair cable.

The standard specifies


up to 32 drivers and
32 receivers can share
a multidrop network
Terminator resistors
avoid reflected signal

SLAVE-1

MASTER

SLAVE-2

SLAVE-3

RS-485 Half-duplex

Datalogic uses Half-Duplex configurations for Data Collecting


and Master/Slave layouts.

Usually we talk about Multidrop


network (i.e. MX4000,DPS9000)

RTX485+
RTX485TX
ENABLE
RX

485GND

TX
ENABLE

TX
ENABLE

Slave 2

RX

TX
ENABLE
RX

Master

Slave 1

RX

Slave N

RS-485 Full-duplex

Potentially RS-485 interface can also use 4-wires to comunicate in


multidrop mode but...

TX485+
TX
ENABLE
RX

TX485RX485+

TX
ENABLE
RX

RX485485GND
Other device
Scanner

RS-232 vs RS-485

The architectural difference between RS-232 and RS-485 is


that 232 is a bi-directional point to point link, whereas 485 is
a single channel bus.

Electrically, each 232 signal uses a single wire with symmetric


voltages about a common ground wire. 485 uses two wires to
carry the single signal differentially.

The big difference to the software is that only one device on a


485 bus can transmit at a time, whilst there is not similar
limitation on RS232 because is a peer-to-peer link .

RS-232 vs RS-485
RS-232

RS-485

Mode of Operation

Total Number of Drivers


1 DRIVER
32 DRIVER
and Receivers on One Line 1 RECEIVER
32 RECEIVER
Maximum Cable Length
50 FEET
4000 FEET
Maximum Data Rate @Max length
20kb/s 100kb/s
Driver Output Signal Level
(Loaded Min.)
Loaded +/-5V to +/-15V
+/-1.5V
Driver Output Signal Level
(Unloaded Max)
Unloaded
+/-25V +/-6V
Driver Load Impedance
3k to 7k
54

SINGLE-ENDED DIFFERENTIAL

Max. Driver Current in


High Z State
Power On

Max. Driver Current in


High Z State
Power Off
Slew Rate (Max.)
30V/S N/A
Receiver Input Voltage Range
Receiver Input Sensitivity
+/-3V
Receiver Input Resistance
3k to

N/A

N/A

+/-6mA @ +/-2v
+/-15V -7V to +12V
+/-200mV
7k
12k

+/-100uA

Data Format and Protocols

Information content passing through peer-to-peer connection


is packed in a very simple structure:

<Header-string> <Code identifier ><INFO-FIELD><Terminatorstring>

<Header-string> and <Terminator-string> are both configurable


via software (device configuration parameters)

Most common generic Handshake are available/selectable with


RS232 interface:

Hardware (RTS-CTS)

Software XON/XOFF

Das könnte Ihnen auch gefallen