+ All Categories
Home > Documents > RS232 485 Fundamental

RS232 485 Fundamental

Date post: 11-Jul-2016
Category:
Upload: sanket-karnik
View: 225 times
Download: 7 times
Share this document with a friend
Description:
Fundamentals of RS232 and RS485 communication and their comparison.
47
Serial Serial Communications Communications
Transcript
Page 1: RS232 485 Fundamental

Serial Serial CommunicationsCommunications

Page 2: RS232 485 Fundamental

What is Serial?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.

Page 3: RS232 485 Fundamental

StandardsStandards RS-232, RS-422, and RS-485 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.

Page 4: RS232 485 Fundamental

What is RS-232What 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 computer’s 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

Page 5: RS232 485 Fundamental

What is RS-232What 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.

Page 6: RS232 485 Fundamental

What is RS-232What 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.

Page 7: RS232 485 Fundamental

RS-232-C InterfaceRS-232-C InterfaceEIA 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

DTE

DCE

DTE

DCE

Telephone Network

RS-232-C RS-232-C

Page 8: RS232 485 Fundamental
Page 9: RS232 485 Fundamental

RS-232 SignalsRS-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 (full-duplex) communications.

RS-232 can also carry additional signals used for flow control (RTS, CTS) and modem control (DCD, DTR, DSR, RI).

Page 10: RS232 485 Fundamental
Page 11: RS232 485 Fundamental

Scope of the standaradScope 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.

Page 12: RS232 485 Fundamental

Voltage LevelsVoltage 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

Page 13: RS232 485 Fundamental

RS-232 logic and voltage levelsData circuits Control circuits Voltage0 (space) Asserted +3 to +15 V1 (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.

Page 14: RS232 485 Fundamental

RS-232 Line DriverRS-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.

Page 15: RS232 485 Fundamental

HandshakingHandshaking 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.

Page 16: RS232 485 Fundamental

RS-232 SpeedRS-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 inmaximum 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 it’s recommended respect these values.

Page 17: RS232 485 Fundamental

RS-232 sw settingsRS-232 sw settings One byte of async data has:

Start Bit = 1 (always) Data Bits = 8 (or 7)

Stop bits = 1 (or 2) Parity = NONE (or EVEN or ODD)

+ 25

- 25

Page 18: RS232 485 Fundamental

RS-232 SignalsRS-232 Signals Common 25 pin D-shell connector pinout used for

asynchronous data communications.

PinPin SignalSignal1 PGND Protective Ground2 TXD Transmit Data3 RXD Receive Data4 RTS Ready To Send5 CTS Clear To Send6 DSR Data Set Ready7 SG Signal Ground8 CD Carrier Detect20 DTR Data Terminal Ready22 RI Ring Indicator

(serial port - PC side)

Page 19: RS232 485 Fundamental

Limitations of RS 232 standardLimitations 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.

Page 20: RS232 485 Fundamental

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.

Page 21: RS232 485 Fundamental

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."

Page 22: RS232 485 Fundamental

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.

Page 23: RS232 485 Fundamental

Differential SignalingDifferential 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

Page 24: RS232 485 Fundamental
Page 25: RS232 485 Fundamental

Serial NetworkingSerial 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.

Page 26: RS232 485 Fundamental

RS-422 and RS-485RS-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

Page 27: RS232 485 Fundamental

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.

Page 28: RS232 485 Fundamental

RS 422RS 422

Standard TIA/EIA-422Physical Media Twisted PairNetwork Topology Point-to-point, Multi-droppedMaximum Devices 10 (1 driver & 10 receivers)Maximum Distance 1500 metres (4,900 ft)Mode of Operation DifferentialMaximum Binary Rate 100 kbit/s – 10 Mbit/sVoltage Levels −6V to +6V (maximum differential

Voltage)Mark (1) Negative VoltagesSpace (0) Positive voltagesAvailable Signals Tx+, Tx-, Rx+, Rx- (Full Duplex

Page 29: RS232 485 Fundamental
Page 30: RS232 485 Fundamental
Page 31: RS232 485 Fundamental

SPECIFICATIONS RS232 RS423 RS422 RS485

Mode of Operation SINGLE SINGLE DIFFERENTIAL

DIFFERENTIAL-ENDED -ENDED

Total Number of Drivers and Receivers on One Line (One driver active at a time for RS485 networks)

1 DRIVER 1 DRIVER 1 DRIVER 32 DRIVER

1 RECVR 10 RECVR 10 RECVR 32 RECVRMaximum 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

Driver Output Signal Level (Loaded Min.) Loaded +/-5V to +/-15V +/-3.6V +/-2.0V +/-1.5VDriver Output Signal Level (Unloaded Max) Unloaded +/-25V +/-6V +/-6V +/-6V

Driver Load Impedance (Ohms) 3k to 7k >=450 100 54Max. Driver Current in High Z State Power On N/A N/A N/A +/-100uAMax. Driver Current in High Z State 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

Receiver Input Sensitivity +/-3V +/-200mV +/-200mV +/-200mVReceiver Input Resistance (Ohms), (1 Standard Load for RS485) 3k to 7k 4k min. 4k min. >=12k

Page 32: RS232 485 Fundamental

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

Page 33: RS232 485 Fundamental

With the introduction of "automatic" repeaters and high-impedance 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.

Page 34: RS232 485 Fundamental
Page 35: RS232 485 Fundamental

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 multi-point 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.

Page 36: RS232 485 Fundamental

What is RS-485What 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.

Page 37: RS232 485 Fundamental

To solve the "data collision" problem often present in multi-drop networks hardware units (converters, repeaters, micro-processor 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, half-duplex, multi-drop system.

The master initiates a communications request to a "slave node" by addressing that unit. The hardware detects the start-bit 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

Page 38: RS232 485 Fundamental
Page 39: RS232 485 Fundamental
Page 40: RS232 485 Fundamental

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 DRIVER1 RECVR

1 DRIVER10 RECVR

1 DRIVER10 RECVR

32 DRIVER32 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

Driver Output Signal Level (Loaded Min.)

Loaded +/-5V to +/-15V +/-3.6V +/-2.0V +/-1.5V

Driver Output Signal Level (Unloaded Max)

Unloaded +/-25V +/-6V +/-6V +/-6V

Driver Load Impedance (Ohms) 3k to 7k >=450 100 54

Max. Driver Current in High Z State

Power On N/A N/A N/A +/-100uA

Max. Driver Current in High Z State

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

Receiver Input Sensitivity +/-3V +/-200mV +/-200mV +/-200mV

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

3k to 7k 4k min. 4k min. >=12k Popular Products:

Popular Products:

Page 41: RS232 485 Fundamental

RS-485 Line DriverRS-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.

Page 42: RS232 485 Fundamental

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

single twisted pair cable.

MASTER SLAVE-1

SLAVE-2 SLAVE-3

The standard specifies up to 32 drivers and 32 receivers can share a multidrop network

Terminator resistors avoid reflected signal

Page 43: RS232 485 Fundamental

RS-485 Half-duplexRS-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) Slave 1

TX

ENABLE

RX

Slave 2

TX

ENABLE

RX

Slave N

TX

ENABLE

RX

RTX485+RTX485-

485GND

Master

TXENABLE

RX

Page 44: RS232 485 Fundamental

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

multidrop mode but...

Scanner

TX

ENABLE

RX

TX485+TX485-

RX485+

RX485-

485GND

TX

ENABLE

RX

Other device

Page 45: RS232 485 Fundamental

RS-232 vs RS-485RS-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 .

Page 46: RS232 485 Fundamental

RS-232 vs RS-485RS-232 vs RS-485RS-232RS-232 RS-485RS-485

Mode of Operation SINGLE-ENDED DIFFERENTIAL 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 Max. Driver Current in

High Z State Power On N/A N/A Max. Driver Current in

High Z State Power Off +/-6mA @ +/-2v +/-100uA Slew Rate (Max.) 30V/S N/A Receiver Input Voltage Range +/-15V -7V to +12V Receiver Input Sensitivity +/-3V +/-200mV Receiver Input Resistance 3k to 7k 12k

Page 47: RS232 485 Fundamental

Data Format and ProtocolsData Format and Protocols Information content passing through peer-to-peer connection

is packed in a very simple structure: <Header-string> <Code identifier ><INFO-FIELD><Terminator-

string> <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


Recommended