RS-422 and RS-485 Application Note B&B Electronics Mfg. Co. Inc. P.O. Box 1040 -- Ottawa, IL 61350 PH (815) 433-5100 -- FAX (815) 434-7094 Internet Addresses: B&B Home Page: http://www.bb-elec.com Customer Service: sales@bb-elec.com Technical Support: support@bb-elec.
Table of Contents CHAPTER 1: OVERVIEW ............................................................................... 1 INTRODUCTION ................................................................................................. 1 DATA TRANSMISSION SIGNALS ......................................................................... 1 Unbalanced Line Drivers............................................................................. 1 Balanced Line Drivers ....................................................
CHAPTER 5: SOFTWARE ........................................................................... 33 INTRODUCTION ............................................................................................... 33 RS-422 SYSTEMS............................................................................................ 33 RS-485 DRIVER CONTROL .............................................................................. 33 RS-485 RECEIVER CONTROL ...............................................................
Chapter 1: Overview Introduction The purpose of this application note is to describe the main elements of an RS-422 and RS-485 system. This application note attempts to cover enough technical details so that the system designer will have considered all the important aspects in his data system design. Since both RS-422 and RS-485 are data transmission systems that use balanced differential signals, it is appropriate to discuss both systems in the same application note.
Figure 1.1 Figure 1.
Balanced Line Receivers A balanced differential line receiver senses the voltage state of the transmission line across two signal input lines, A and B. It will also have a signal ground (C) that is necessary in making the proper interface connection. Figure 1.3 is a schematic symbol for a balanced differential line receiver. Figure 1.3 also shows the voltages that are important to the balanced line receiver.
Figure 1.3 Figure 1.
Figure 1.
EIA Standard RS-485 Data Transmission The RS-485 Standard permits a balanced transmission line to be shared in a party line or multidrop mode. As many as 32 driver/receiver pairs can share a multidrop network. Many characteristics of the drivers and receivers are the same as RS-422. The range of the common mode voltage Vcm that the driver and receiver can tolerate is expanded to +12 to -7 volts.
Figure 1.
Figure 1.
An RS-485 network can also be connected in a four-wire mode as shown in Figure 1.7. Note that four data wires and an additional signal ground wire are used in a “four-wire” connection. In a four-wire network it is necessary that one node be a master node and all others be slaves. The network is connected so that the master node communicates to all slave nodes. All slave nodes communicate only with the master node. This network has some advantages with equipment with mixed protocol communications.
Figure 1.
Send Data Control of an RS-485 Device Many of B&B Electronics’ RS-232 to RS-485 converters and RS-485 serial cards include special circuitry, which is triggered from the data signal to enable the RS-485 driver. Figure 1.9 is a timing diagram of the important signals used to control a converter of this type. It is important to note that the transmit data line is “disabled” at a fixed interval after the last bit, typically one character length.
Figure 1.
Chapter 2: System Configuration Network Topologies Network configuration isn’t defined in the RS-422 or RS-485 specification. In most cases the designer can use a configuration that best fits the physical requirements of the system. Two Wire or Four Wire Systems RS-422 systems require a dedicated pair of wires for each signal, a transmit pair, a receive pair and an additional pair for each handshake/control signal used (if required).
Figure 2.
Figure 2.
Termination Termination is used to match impedance of a node to the impedance of the transmission line being used. When impedance are mismatched, the transmitted signal is not completely absorbed by the load and a portion is reflected back into the transmission line. If the source, transmission line and load impedance are equal these reflections are eliminated. There are disadvantages of termination as well.
designers interested in AC termination are encouraged to read National Semiconductors Application Note 9032 for further information. Figure 2.3 illustrates both parallel and AC termination on an RS-485 two-wire node. In four-wire systems, the termination is placed across the receiver of the node. Figure 2.3 Parallel and AC Termination Biasing an RS-485 Network When an RS-485 network is in an idle state, all nodes are in listen (receive) mode.
Bias Resistor Bias Resistor Figure 2.4 Transceiver with Bias Resistors Example 1. 10 node, RS-485 network with two 120 Ω termination resistors Each RS-485 node has a load impedance of 12KΩ. 10 nodes in parallel give a load of 1200 Ω. Additionally, the two 120 Ω termination resistors result in another 60 Ω load, for a total load of 57 Ω. Clearly the termination resistors are responsible for a majority of the loading.
Example 2. 32 node, RS-485 network without termination Each RS-485 node has a load impedance of 12KΩ. 32 nodes in parallel gives a total load of 375 Ω. In order to maintain at least 200 mV across 375Ω we need a current of 0.53 mA. To generate this current from a 5V supply requires a total resistance of 9375Ω maximum. Since 375 Ω of this total is in the receiver load, our bias resistors must add to 9KΩ or less. Notice that very little bias current is required in systems without termination.
Chapter 3: Selecting RS-422 and RS-485 Cabling Cable selection for RS-422 and RS-485 systems is often neglected. Attention to a few details in the selection process can prevent the costly prospect of re-pulling thousands of feet of cable. Number of Conductors The signal ground conductor is often overlooked when ordering cable. An extra twisted pair must be specified to have enough conductors to run a signal ground.
Figure 3.1 Losses in a transmission line are a combination of AC losses (skin effect), DC conductor loss, leakage, and AC losses in the dielectric. In high quality cable, the conductor losses and the dielectric losses are on the same order of magnitude. Figure 3.2 is included in this application note to point out the significant difference in performance of different cables. This chart shows Attenuation versus Frequency for three different Belden cables.
Figure 3.2 Another approach to choosing transmission line is the “E-GRADE Program,” which has been established by Anixter Bros. Inc. Anixter is a worldwide distributor of wiring system products.
Chapter 4: Transient Protection of RS-422 and RS-485 Systems The first step towards protecting an RS-422 or RS-485 system from transients is understanding the nature of the energy we are guarding against. Transient energy may come from several sources, most typically environmental conditions or induced by switching heavy inductive loads.
1.2/50 uSecond Voltage Wave 1 0.9 0.8 0.7 V(t) / Vp 0.6 0.5 0.4 0.3 0.2 0.1 0 0 20 40 60 80 100 Time, us Figure 4.1 Combination Wave Voltage Waveform 8/20 uSecond Current Wave 1 0.8 V(t)/Vp 0.6 0.4 0.2 0 0 10 20 30 40 50 Time, us Figure 4.
100kHz Ring Wave 1 0.8 0.6 V(t)/Vp 0.4 0.2 0 -0.2 -0.4 -0.6 -0.8 0 5 10 15 Time, us 20 25 30 Figure 4.3 100 kHz Ring Wave Common Mode vs. Differential Mode Identifying the type of surges that may threaten a system is an important part of selecting the appropriate levels and methods of transient protection.
Ground Differences Realizing that transient energy can be high frequency in nature leads to some disturbing observations. At frequencies of this magnitude, it is difficult to make a low impedance electrical connection between two points due to the inductance of the path between them. Whether that path is several feet of cable or thousands of feet of earth between grounding systems, during a transient event there can be hundreds or thousands of volts potential between different “grounds”.
Vcc Device Port Data Lines Ground line Local Chassis Ground Connection Figure 4.5 RS-485 Device with Signal Ground Connected to Chassis Ground Transient protection using Isolation Isolation Theory The most universal approach to protecting against transients is to galvanically isolate the data port from the host device circuitry. This method separates the signal reference from any fixed ground.
Isolation Devices Optical isolation can be implemented in a number of ways. If a conversion from RS-232 to RS-422 or RS-485 is being made, optically isolated converters are available. Optically isolated ISA bus serial cards can replace existing ports in PC systems. For systems with existing RS-422 or RS-485 ports, an optically isolated repeater can be installed. Examples of each of these type devices can be found in the B&B Electronics Data Communications catalog.
Connecting Signal Grounds Since a local ground connection is required at each node implementing shunt type protection, the consequences of connecting remote grounds together must be considered. During transient events a high voltage potential may exist between the remote grounds. Only the impedance in the wire connecting the grounds limits the current that results from this voltage potential.
Device Vcc Isolated Power Shunting Device Port Data Lines Out Ground line Earth Ground Figure 4.7 Isolated node with shunt protection to earth ground Device Shunting Device Vcc Isolated Power Port Data Lines Signal Ground Figure 4.8 Isolated port with ungrounded shunt protection The method shown in Figure 4.7 is recommended, in this case isolation protects the circuit from any voltage drops in the earth ground connection.
Special Consideration for Fault Conditions Data systems that could be exposed to short circuits to power conductors require an extra measure of protection. In these cases its recommended to add a fuse type device in addition to shunting type suppression, as shown in Figure 4.9. When a short circuit occurs, the shunt suppression will begin conducting, but shunting by itself cannot withstand the steady state currents of this type of surge.
Table 4.
Chapter 5: Software Introduction RS-422 and RS-485 are hardware specifications. Software protocol is not discussed in either specification. It is up to the system designer to define a protocol suitable for their system. This chapter we will not attempt to define a protocol standard, but will explain some of the issues that should be considered by the system designer, whether writing or purchasing software.
RS-485 Receiver Control The RS-485 receiver also has an enable signal. Since RS-485 systems using a two wire configuration connect the driver to receiver in a loopback fashion, this feature is often used to disable the receiver during transmission to prevent the echo of local data. Another approach is to leave the RS-485 receiver enabled and monitor the loopback data for errors which would indicate that line contention has occurred.
Multi-Master RS-485 Systems Each node in a multi-master type RS-485 system can initiate its own transmission creating the potential for data collisions. This type system requires the designer to implement a more sophisticated method of error detection, including methods such as line contention detection, acknowledgement of transmissions and a system for resending corrupted data.
Chapter 6: Selecting RS-485 Devices When purchasing devices for an RS-485 system many pitfalls can be avoided by determining the device’s communications characteristics before the system design is complete. Knowing what questions to ask up front can save a lot of troubleshooting in the field. The following device characteristics are all things that should be answered in the system design stage. 1. 2. 3. 4. 5. 6. 7. 8.
Chapter 7: Sources of Further Information EIA Standards and Publications can be purchased from: GLOBAL ENGINEERING DOCUMENTS 7730 Carondelet Avenue -- Clayton, MO 63105 Phone: (800) 854-7179 -- FAX: (314) 726-6418 GLOBAL ENGINEERING DOCUMENTS 15 Inverness Way East -- Englewood, CO 80112 Phone: (800) 854-7179 -- FAX: (303) 397-2740 Global Engineering Documents web site can be found at http://global.ihs.com.
Appendix A: EIA Specification Summary EIA RS-422 Specification Summary Parameter Driver Output Voltage Open Circuit Driver Output Voltage Loaded Driver Output Resistance Driver Output Short-Circuit Current Driver Output Rise Time Driver Common Mode Voltage Receiver Sensitivity Receiver Common-Mode Voltage Range Receiver Input Resistance Differential Receiver Voltage Conditions RT = 100 Ω Min Max 10 -10 Units V V V V Ω mA 2 -2 A to B Per output to common RT = 100 Ω 100 ±150 10 RT = 100 Ω % of Bit W
EIA RS-232 Specification Summary Parameter Driver Output Voltage Open Circuit Driver Output Voltage Loaded Conditions 3 KΩ ≤ RL ≤ 7 KΩ -2V ≤ Vo ≤ 2V Driver Output Resistance, Power Off Driver Output Short-Circuit Current Driver Output Slew Rate Maximum Load Capacitance Receiver Input Resistance Receiver Input Threshold Output = Mark Output = Space 3V ≤ VIN ≤ 25V Min Max 25 5 3000 15 Units V 300 V V Ω 500 mA 30 2500 7000 V/µs pF Ω -3 3 V V EIA RS-423 Specification Summary Parameter Driver O
Appendix B: EIA Standard RS-423 Data Transmission RS-423 (EIA-423) is another standard used in point to point communications. RS-423 data transmission uses an unbalanced line driver that connects to an RS-422 type balanced line receiver as shown in Figure B.1. The RS-423 line driver is unique to this system. It produces voltage similar to RS-232 but has a slew rate control input that is used to limit rise times and cross talk on the data lines.