MIME-Version: 1.0 Content-Location: file:///C:/227254F3/SelectingandUsingRS-232,RS-422,andRS-485SerialDataStandards.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii" Selecting and Using RS-232, RS-422, and RS-485 Serial Data Standards=





HOME

PRODUCTS

SOLUTIONS

DESIGN

APPNOTES<= /span>

SUPPORT

BUY

COMPANY

MEMBERS

 

 <= /o:p>

 

 

 

APP 723: Dec = 29, 2000 

 

 

3D"Download,Download, PDF Format= (270K)

Selecting and U= sing RS-232, RS-422, and RS-485 Serial Data Standards

 

Three common serial data standards: RS-232, RS-422, and RS-485 are described by specification and electrical interface. Cable termination techniques, use of multiple loads, daisy-chaining of RS-232, conversion of RS-232 to RS-485, converting RS-485 to RS-232, and RS-232 port powered RS-485 conversions are described.

 

"The great thing about standards is there are so many= to choose from." This statement was made at a recent conference on fiber optics, and it holds true for electrical-interface standards as well. Serial-data standards tend to evolve separately, within particular industries, thus we have more standards than we should.

Perhap= s the most successful serial-data standard for PC and telecom applications is t= he RS-232. Similarly, the RS-485 and RS-422 are among the most successful standards for industrial applications. These standards are not directly compatible, however for purposes of control and instrumentation it is oft= en necessary to communicate between them. This article offers insight into t= he different standards (electrical physical-layer specifications), how to convert from one standard to another standard, and how to combine differe= nt standards within the same application.

The RS= -232 link was initially intended to support modem and printer applications on = IBM PCs, however it now enables a variety of peripherals to communicate with = PCs. The RS-232 standard was defined as a single-ended standard for increasing serial-communication distances at low baud rates (< 20kbps). Over the years the standard has changed as necessary to accommodate faster drivers like the MAX3225E, which offers 1Mbps data-rate capability. For RS-232 compliance, a transceiver such as the MAX3225E must meet the electrical specifications listed in Table 1. A typical connection (Figure 1) shows t= he use of hardware handshaking to control the flow of data.


Figure 1. Typical RS-232 connection.

A typi= cal RS-232 signal (Figure 2, CH1) swings positive and negative; note the relative location of the 0V trace markers on the left axis. Although the RS-232 da= ta is inverted, an overall translation from TTL/CMOS to RS-232 and back to TTL/CMOS restores the data's original polarity. Typical RS-232 transmissi= ons seldomly exceed 100 feet for two reasons: The difference between transmit= ted levels (±5V) and receive levels (±3V) allows for only 2V of common-mode rejection, and the distributed capacitance of a longer cable = can degrade slew rates by exceeding the maximum specified load (2500pF). Since the RS-232 was designed as a point-to-point rather than multi-drop interf= ace, its drivers are specified for single loads from 3k to 7k. Therefore, a daisy-chain scheme is typically implemented for multi-drop interface applications (Figure 3).


Figure 2. An RS-232 receiver accepts the bipolar input signal (top tra= ce, CH1) and outputs an inverted TTL/CMOS signal (bottom trace, CH2).


Figure 3. Daisy-chaining allows multiple slave transceivers on a single RS-232 line.

Daisy-Chain De= vices
In a daisy-chain configuration, the RS-232 signal enters through one rece= iver and is looped through to a transmitter. This configuration is repeated for subsequent devices along the data transmission line. Cable breaks are a m= ajor problem with this technique. A break between slave 1 and slave 2, prevents all downstream devices from transmitting or receiving data. Other multi-d= rop RS-232 techniques involve pre-buffering or boosting the RS-232 output dri= ve (enabling it to drive multiple 5k inputs in parallel).

To eli= minate the problems associated Daisy-Chain networks Maxim developed the MAX3322E/MAX3323E, which are specifically designed to be configured in multi-drop applications. These unique devices employ a logically switched input resistance of 5k. When a device is not selected, its input resistance remains in a high impedance state allowing communication to proceed with other devices along the shared bus.

Another solution would be to convert the RS-232 RX and TX signals to an RS-422 si= gnal (see Table 2). RS-422 is a differential standard that allows transmission over much greater distances. The higher input resistance of RS-422 inputs, combined with their higher drive capability, allows a connection of up to= 10 nodes (Figure 4). Another advantage of RS-422 is the separate transmit and receive paths, for which no direction control is needed. Any necessary handshaking between devices can be performed with either software (XON/OFF handshaking) or hardware (a separate set of twisted pairs). The MAX3162 provides an economical way to translate between RS-232 and RS-422 signals. For more detail, refer to the section titled "RS-232/RS-485 Protocol Translators".


Figure 4. A typical RS-422 system allows as many as 10 slave transceiv= ers on the differential transmission line.

RS-422= and RS-485 transceivers are often confused with each other; one is assumed to= be a full-duplex version of the other. However the electrical differences in their common-mode ranges and receiver-input resistances suit these standa= rds for different applications. Since the RS-485 meets all of the RS-422 specifications (Table 3), RS-485 drivers can be used in RS-422 applicatio= ns. The opposite, however, is not true. The common-mode output range for RS-4= 85 drivers is -7V to +12V, where as the common-mode range for RS-422 drivers= is only ±3V. The minimum receiver-input resistance is 4k for RS-422 drivers and 12k for RS-485 drivers.

Tab= le 1. RS-232 Summary of Major Electrical Specifications

Parameter

Conditions

Min

Max

Units

Driver Output Voltage Open Circuit

 

 

25

V

Driver Output Voltage Loaded

3k < RL < 7k

±5

±15

V

Driver Output Resistance Power Off

-2V < V < 2V

 

300

 

Slew Rate

 

4

30

V/µS

Maximum Load Capacitance

 

 

2500

pF

Receiver Input Resistance

 

3

7

k

Receiver Input Threshold:

Output =3D Mark (Logic 1)

 

-3

 

V

Output =3D Space (Logic 0)

 

 

3

V


Table 2. RS-422 Summary of Key Specifications

Parameter

Conditions

Min

Max

Units

Driver Output Voltage Open Circuit

 

 

±10

V

Driver Output Voltage Loaded

RL =3D 100

2
-2

 

V

Driver Output Resistance

A to B

 

100

Driver Output Short Circuit Current

Per output to common

 

150

mA

Driver Output Rise Time

RL =3D 100

 

10

% of bit width

Driver Common-Mode Voltage

RL =3D 100

 

±3

V

Receiver Sensitivity

VCM < ±7V

 

±200

mV

Receiver Common-Mode Voltage Range

 

-7

7

V

Receiver Input Resistance

 

4

 

k

Differential Receiver Voltage

Operational

 

±10

V

 

Withstand

 

±12

V


Table 3. RS-485 Summary of Key Specifications

Parameter

Conditions

Min

Max

Units

Driver Output Voltage Open Circuit

 

1.5
-1.5

6
-6

V
V

Driver Output Voltage Loaded

RL =3D 100

1.5
-1.5

5
-5

V
V

Driver Output Short Circuit Current

Per output to common

 

±250

mA

Driver Output Rise Time

RL =3D 54
CL =3D 50pF

 

30

% of bit width

Driver Common-Mode Voltage

RL =3D 54

 

±3

V

Receiver Sensitivity

-7V < VCM < 12V

 

±200

mV

Receiver Common-Mode Voltage Range

 

-7

12

V

Receiver Input Resistance

 

12

 

k


To reduce wiring expense and achieve longer line lengths, RS-485 transcei= vers have become a popular standard for use in point-of-sale, industrial, and telecom applications. Its wider common-mode range also enables longer line lengths and a higher input resistance per node, allowing more nodes to be connected to the bus (Figure 5).


Figure 5. Compared with RS-422, the higher input impedance and wider common-mode range of an RS-485 connection enables longer line lengths.

Differ= ential RS-485 transmissions (Figure 6) produce opposing currents and magnetic fi= elds along each segment (wire) of a twisted-pair cable; thus minimizing the emitted electromagnetic interference (EMI) via cross-canceling of the opposing fields around each wire. For transmissions through a long cable = or at high data rates, the cable appears as a transmission line and should be terminated with the cable's characteristic impedance. This aspect of the RS-485 connection causes confusion. Does the line need to be terminated, = and if so how should it be terminated? If the designer is not the end user, should these questions be left for the installer to figure out? For most RS-485 transceivers, the data sheet indicates a simple choice between no termination, and a simple point-to-point termination when the cable acts = as a transmission line (Figure 7). A termination resistor across the A-B termi= nals is harmless. By default, the transmission line should be terminated at the last transceiver on the line (bus).


Figure 6. The opposite-polarity signals on an RS-485 line minimize EMI= by cross-canceling each other's respective magnetic fields. The GND referenc= es on the above scope photo have been shifted (offset) to clearly show the inverted polarities of the RS-485 output signals.
<= /p>


Figure 7. The choice of termination resistors for a transmission line depends on the application.

Fail-Safe
Deciding whether you need a termination resistor or not is only part of t= he problem in implementing an RS-485 system. Normally, an RS-485 receiver ou= tput is "1" if A > B by +200mV or more, and "0" if B &g= t; A by 200mV or more. In a half-duplex RS-485 network, the master transceiver tri-states the bus after transmitting a message to the slaves. Then, with= no signal driving the bus, the receiver's output state is undefined, for the difference between A and B tends towards 0V. If the receiver output (RO) = is "0", the slaves interpret it as a new start bit and attempts to read the following byte. The result is a framing error, because the stop = bit never occurs. The bus goes unclaimed, and the network stalls. =

Unfort= unately, different runs of chips can produce different output signals on RO for a = 0V differential input. The prototype can work perfectly, however certain nod= es will fail in a later production run. To solve this problem, bias the bus = as shown in Figure 7 (Multi-Drop/Fail-Safe Termination). Biasing the bus ens= ures that the receiver output remains "1" when the bus is tri-stated. Or, you can use "True Fail-Safe" receivers like those of the MAX3080 (5V) and MAX3070 (3V) families. These devices ensure an RO output= of "1" in response to a 0V differential input by changing the receiver's threshold to -50mV.

RS-232/RS-485 Protocol Translators
The MAX3162 is a very unique device for it contains both RS-232 and RS-485 receivers and transmitters. This wide range of communication devices contained within a single device enables an individual to convert bi-directionally between RS-232 and RS-485 signals. The circuit in Figure= 8 illustrates the MAX3162 configured to bi-directionally convert RS-232 and RS-485 signals in a point-to-point application.


Figure 8. The above figure utilizes the MAX3162 to convert bi-directionally between RS-232 and RS-485 signals in a point-to-point application.

Figure= 9 shows the MAX3162 configured as an RS-232/RS-485 multi-point protocol translator. The direction of translation is controlled through the RTS si= gnal R1IN. The single-ended RS-232 receiver input signal is translated to a differential RS-485 transmitter output. Similarly, a differential RS-485 receiver input signal is translated to a single-ended RS-232 transmitter = output. RS-232 data received on R2IN is transmitted as an RS-485 signal on Z and = Y. RS-485 signals received on A and B are transmitted as an RS-232 signal on T1OUT.

The RT= S line offers a common means for controlling bus direction in circuits that conv= ert from RS-232 to RS-485. This line on the RS-232 port controls whether the RS-485 transceiver acts as a transmitter or a receiver (Figure 9). Note t= hat the system cannot be sure that a byte of data in the UART's transmit buff= er has been transmitted unless the system monitors the RS-485 driver input (= DI). That is, the system must either allow for a fixed time delay or actively monitor the DI input before using the DE input to change the bus directio= n.

Other direction-control techniques include using a microcontroller and driving = the DE input with data while pulling the A-B lines apart (connecting a pull-up resistor from A to 5V and connecting a pull-down resistor from B to groun= d). The value of these resistors varies with cable capacitance, but is typica= lly 1k.


Figure 9. The above figure utilizes the MAX3162 to convert bi-directionally between RS-232 and RS-485 signals in a multi-point application.

Port-Powered D= evices
Many converters from RS-232 to RS-485 are "port-powered converters", in which the RS-485 power is derived from the RS-232 RTS line (or sometimes a combination of the RTS and CTS (DTR) lines). Since t= he power available from an RS-232 port is limited, the RS-485 launch voltages are not achieved when using a port-powered converter with for example 100 RS-485 terminations. However, the low receiver threshold (200mV) allows f= or a fair margin for error. This technique is acceptable in systems with short line lengths and without termination resistors across the A-B terminals. =

Hot-Swap
When circuit boards are inserted into a hot or powered backplane, differential disturbances to the data bus can lead to data errors. Upon initial circuit board insertion, the data communication processor undergo= es its own power-up sequence. During this period, the processor's logic-outp= ut drivers are high impedance and are unable to drive the DE and /RE\ inputs= of the MAX3060E/MAX3080E to a defined logic level. Leakage currents up to ±10mA from the high-impedance state of the processor's logic drive= rs could cause standard CMOS enable inputs of a transceiver to drift to an incorrect logic level. Additionally, parasitic circuit board capacitance could cause coupling of VCC or GND to the enable inputs. Witho= ut the hot-swap capability, these factors could improperly enable a transceiver's driver or receiver.

References

1.       RS-422 and RS-485 Application Note, B&B Electronics (T= his is a great source of information on RS-232, RS-485 and RS-422 standards a= nd their practical realizations. http://www.bb-elec.com) <= /p>

2.       Serial Port Complete, Jan Axelson (This definitive referen= ce for serial ports includes lots of useful source code written in Visual Ba= sic. http://www.lvr.com)

More Information

APP 723: Dec = 29, 2000 

MAX232:

QuickView=

-- Full (PD= F) Data Sheet (648k)

-- Free Samples

MAX3162:

QuickView=

-- Full (= PDF) Data Sheet (368k)

-- Free Samples

MAX3232:

QuickView=

-- Full (= PDF) Data Sheet (400k)

-- Free Samples

MAX485:

QuickView=

-- Full (P= DF) Data Sheet (448k)

-- Free Samples

 =

 

3D"Download,Download, PDF Format= (270K)

 <= /o:p>

<= !-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -->



    

    



    

3D"LinkLINK TO US



   Home=    Products    Solutions    Design    AppNotes    Support    Buy    Company    Members   

Copyright © 2= 005 by Maxim Integrated Products  •  Legal= Notices  •  <= span style=3D'color:#6060A0'>PRIVACY POLICY