Design Article

The RS-485 Design Guide

Thomas Kugelstadt, Texas Instruments

4/26/2008 9:34 AM EDT

Ratified in the early 80's as a new balanced transmission standard, RS-485 has emerged as the industry's seemingly eternal interface workhorse. Much literature has been written on the subject since, which can be overwhelming to system engineers who rarely are confronted with interface design.

This article serves as an introductory guide to designers new to RS-485 by discussing the main aspects of the standard. Studying the additional application notes referenced at the end of this article can help a designer to accomplish a robust data transmission design in the shortest time possible.

Standard Purpose
RS-485 only defines the electrical characteristics of drivers and receivers used in balanced multipoint transmission lines. As an electrical-only standard, RS-485 is commonly referenced by higher level standards as their physical layer.

Network Topology
Bus nodes are networked in a daisy-chain, or bus topology (Figure 1). That is, each node connects to the main cable trunk via short stubs. The interface bus is usually designed for half-duplex transmission, meaning that only one signal pair is used, across which the driving and receiving of data must occur at different times.


Figure 1. RS-485 Daisy chain (left), and half-duplex bus structure (right).

This implementation requires the protocol controlled operation of all nodes via direction control signals, such as driver/receiver enabled signals, to ensure that only one driver is active on the bus at any time. Having more than one driver accessing the bus simultaneously leads to bus contention, which must be avoided at all times.

Signal Levels
RS-485 drivers must provide a differential output of a minimum of 1.5V across a 54 load, while RS-485 receivers must detect a differential input with a minimum of 200mV (Figure 2). These two values provide sufficient margin for a reliable data transmission, even under severe signal degradation across the cable and connectors. This robustness is the primary reason why RS-485 is good for long distance networking in noisy environments.


Figure 2. RS-485 specified minimum bus signal levels.

Cable Type
RS-485 Applications benefit from differential signaling over twisted pair cable. This is because noise from external sources couples equally into both signal lines as common-mode noise, which is rejected by the differential receiver input.

Industrial RS-485 cables are of the sheathed, unshielded, twisted pair type (UTP) with a characteristic impedance of 120 and 22 AWG. Figure 3 shows the cross section of a single pair, UTP cable for half-duplex networks.


Figure 3. Example of RS-485 communication cable.

Beyond network cabling, it is mandatory that the printed circuit board layouts and the connector pin assignments of RS-485 equipment keep both signal lines close and equidistant to another to maintain the network's electrical characteristics

Bus Termination and Stub Length
Data transmission lines should always be terminated and stubs should be as short as possible to avoid signal reflections on the line. Proper termination requires matching the terminating resistors, RT, to the characteristic impedance, Z0, of the transmission cable. Because RS-485 recommends cables with Z0 = 120, the cable trunk is commonly terminated with 120 resistors, one at each cable end (Figure 1 right).


Figure 4. RS-485 terminations with common-mode noise filters.

Applications in noisy environments often add common-mode noise filtering by replacing the 120 resistors with two R-C low-pass filters (Figure 4). It is important to match the resistor values (preferably with precision resistors) to ensure equal roll-off frequencies of both filters. Larger resistor tolerances cause the filter corner frequencies to differ and common-mode noise to be converted into differential noise, thus compromising the receiver's noise immunity.

The electrical length of a stub (the distance between a transceiver and cable trunk) should be shorter than 1/10 of the driver's output rise time, and is given through: (1)

where: LBus = maximum length of an unterminated cable (ft) tr = driver (10/90) rise time (ns) v = signal velocity of the cable as factor of c c = speed of light (9.8 x10^8 ft/s or 9.8E8 ft/s)

Table 1 lists the maximum stub lengths of the cable in Figure 4 for various driver rise times.


Table 1: Stub length and unterminated cable length versus rise time.

Failsafe
Failsafe operation is a receiver's ability to assume a determined output state in the absence of an input signal. Three possible causes can lead to the loss of signal (LOS): 1) open-circuit: caused by a wire break, or by disconnecting a transceiver from the bus 2) short-circuit: caused by an insulation fault connecting the wires of a differential pair to another, 3) idle-bus: occurring when none of the bus drivers is active

Because the conditions above can cause conventional receivers to assume random output states when the input signal is zero, modern transceiver designs include biasing circuits for open-circuit, short-circuit, and idle-bus failsafe, that drive the receiver output to a determined state, when the input signal is zero.

While these failsafe transceivers claim to reduce component count, their worst case noise margin of 10mV necessitates the design of external failsafe circuitry

An external failsafe circuit consists of a resistive voltage divider that generates sufficient differential bus voltage, to drive the receiver output into a determined state. To ensure sufficient noise margin, VAB must include the maximum differential noise in addition to the 200 mV receiver input threshold. The values for the failsafe bias resistors, RB, are then calculated for worst case conditions, that is maximum noise at minimum supply:

(2)


with: VAB = 200 mV + VNoise

For a minimum bus voltage of 4.75 V, (5V " 5%), VAB = 0.25 V, and Z0 = 120, RB yields 528. Inserting two 523 resistors in series to RT, (Figure 5, left), establishes a single failsafe circuit at one bus end.


Figure 5. External idle-bus failsafe biasing.

Editor's note
Problems with editing tools caused some equations and other elements to be removed from text, then further problems made it impossible to fix them in timely fashion. It is these problems, not errors in the author's original text, that prompted most of the criticism below. These errors have now been fixed.


Next: Bus Loading




KE6PIJ

4/29/2008 8:37 AM EDT

I lost interest shortly after seeing the speed of light defined as something I can outrun. Your number is closer to the acceleration due to gravity. Later I see a common pull-up method using values that interfere with the termination impedance. After that I didn't even bother going to the second page.
This stuff isn't that hard but presenting errors in such a short article meant to be an intro for those unfamiliar with the subject destroys the credability of the article.
Major newspapers are not the only one's who need to take a second look at the editor's role in publishing.

Sign in to Reply



SilverSpoon

4/29/2008 11:11 AM EDT

I agree- the equations are in error or at the very least, inaccurate. This article needs a thorough tech-edit. After a quick glance I referred this article to a number of my software people, then after reading it, I find myself wishing I had waited. The concept of the article is good and the outline of the article is good, but the details are poor. The most that newbies to 485 will get out of the article as-written is: "you need to terminate" and "watch out for loading" and "watch out for ground loops".

Sign in to Reply



KE6PIJ

6/13/2008 11:57 AM EDT

It appears in your last response that the point of my comment has been understood. It wasn't asking for clarification of the equations or numbers, I already know what it should be. It was about how things like this get published without anybody checking the content for accuracy and completeness. I made no assumptions about where the problems originated, but it sounds like at least a few steps caused the introduction of the problems we noted.

As always, it's all about having a process and following it. If that was done, then the process needs serious review. Regardless of what was intended to be printed, what was printed reflected poorly on all who were involved and creates credibility problems for the magazine and author by the readers who noticed the inconsistencies but were not a part of this thread.

Sign in to Reply



Little Ed

9/30/2008 11:12 AM EDT

While the cable spec shows velocity of light in a non-vacuum at 78% of c the equation for Table 1 assumes c vacuum. Seems it should use the 78% of c value also.

Sign in to Reply



SilverSpoon

7/20/2009 8:40 PM EDT

A I revisited this article after a year, I see that technical editing has fixed the problems in the original published text. My thanks to the editors for taking care of these problems and acknowledging the error.

My kindest regards to the author who quickly acknowledged my issues and obviously notified the publisher to correct the publishing errors.

I will review the article again for possible reference material for my engineers again.
Thank you Big Tom.

Sign in to Reply



SilverSpoon

7/20/2009 8:48 PM EDT

Figure 8 is still incorrect... it is displaying the same graph as Figure 7 instead of what the Figure 8 caption describes. Although this article is a year old, this should still be corrected so the missing information is displayed properly.

Sign in to Reply



djdigital

9/14/2011 10:34 AM EDT

Time we are communicating at the moment on the TI forum regarding failsafe. My question regarding this app note, is I noticed you have here LP filtering in place of the 120ohm termination resistor. In calculating the cutoff frequency is it both 60ohm resistors or just 1? For instance, if I use 120ohm, in the formula (Fc = 1/(2*pi*RC), I get a Fc of appx 6MHz. Does deciding the cutoff frequency impacted by the data rate?

Sign in to Reply



Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)

Feedback Form