“The recommended standard RS-485, as an electrical specification for multi-point, differential data transmission, has now become one of the most widely used standard communication interfaces in the industry. This kind of communication interface allows multi-point, two-way communication on a simple pair of twisted-pair wires. Its noise suppression capability, data transmission rate, cable length and reliability are unmatched by other standards. Because of this, RS-485 is used as a data transmission link in many different fields.
Author: Xu Jihong
The recommended standard RS-485, as an electrical specification for multi-point, differential data transmission, has now become one of the most widely used standard communication interfaces in the industry. This kind of communication interface allows multi-point, two-way communication on a simple pair of twisted-pair wires. Its noise suppression capability, data transmission rate, cable length and reliability are unmatched by other standards. Because of this, RS-485 is used as a data transmission link in many different fields. For example, automotive electronics, telecommunications equipment, local area networks, cellular base stations, industrial controls, instrumentation and so on. Another reason why this standard is widely accepted is its versatility. The RS-485 standard only stipulates the electrical characteristics of the interface, and does not involve connectors, cables or protocols. On this basis, users can establish their own high-level communication protocols. Although the RS-485 standard has been widely accepted, some specific problems in its practical application have not been deeply and extensively understood, and there are even various misunderstandings that affect the performance of the entire system. Based on the review of the RS-485 standard, this article focuses on several issues that are often overlooked in practical applications.
RS-485 standard review
The RS-485 standard was originally formulated and published by the Electronic Industries Association (EIA) in 1983, and later revised by the TIA-Communication Industry Association and named TIA/EIA-485-A, but engineers still call it RS-485 habitually. RS-485 was developed from RS-422, which was proposed to make up for the shortcomings of RS-232. In order to improve the shortcomings of RS-232 communication distance and low rate, RS-422 defines a balanced communication interface, which increases the transmission rate to 10Mbps and the transmission distance to 4000 feet (when the rate is lower than 100kbps), and allows one Connect up to 10 receivers on the balanced line. RS-422 is a one-way, balanced transmission specification for single-machine transmission and multi-machine reception. In order to expand the scope of application, it has subsequently added multipoint and two-way communication capabilities, which allows multiple transmitters to be connected to the same bus. At the same time, the drive capability and conflict protection features of the transmitter were increased, and the common mode range of the bus was expanded. This is the later EIA RS-485 standard.
RS-485 is an electrical interface specification. It only specifies the electrical characteristics of the balanced driver and receiver, but does not specify connectors, transmission cables, and communication protocols. The RS-485 standard defines a multi-point, two-way (half-duplex) communication link based on a single pair of balanced lines, which is extremely economical, and has quite high noise suppression, transmission rate, transmission distance, and wide common mode range. Communication platform. The main features of the RS-485 interface are as follows:
Balance great losses;
Driver output voltage (with load): ≥｜1.5V｜;
Receiver input threshold: ±200mV;
-7V to +12V bus common mode range;
Maximum input current: 1.0mA/-0.8mA (12Vin/-7Vin);
Maximum bus load: 32 unit loads (UL);
Maximum transmission rate: 10Mbps;
Maximum cable length: 4000 feet.
RS-485 supports half-duplex or full-duplex mode. The network topology generally adopts a terminal-matched bus structure, and does not support ring or star networks. It is best to use a bus to connect each node in series, and the length of the lead wire from the bus to each node should be as short as possible, so that the reflected signal in the lead wire has the lowest impact on the bus signal. Figure 1 shows some common wrong connection methods (a, c, e) and correct connection methods (b, d, f) in practical applications. Although the three types of inappropriate network connections a, c, e can still work normally in some cases (short distance, low speed), as the communication distance increases or the communication speed increases, the adverse effects will become more and more Serious, the main reason is that the signal is superimposed with the original signal after being reflected at the end of each branch, which causes the signal quality to decrease. In addition, attention should be paid to the continuity of the characteristic impedance of the bus. Signal reflections will also occur at the point where the impedance is discontinuous. For example, when different sections of the bus use different cables, there are too many transceivers installed close to each other on a certain section of the bus, or there are too long branch lines leading out of the bus, there will be impedance discontinuities. In short, a single, continuous signal channel should be provided as a bus.
The standards regarding the number of transceivers allowed to be connected on the bus do not make provisions, but the maximum bus load is specified as 32 unit loads (UL). The maximum input current per unit load is 1.0mA/-0.8mA, which is equivalent to about 12kΩ. In order to expand the number of bus nodes, device manufacturers increase the input resistance of the transceiver. For example, if the input resistance of MAX487 and MAX1487 is increased to more than 48kΩ (1/4UL), the number of nodes can be increased to 128. MAX1483 with 96kΩ input resistance allows up to 256 nodes.
Whether to perform terminal matching on the RS-485 bus depends on the data transmission rate, cable length and signal conversion rate. UART samples data at the midpoint of each data bit. As long as the reflected signal attenuates sufficiently low at the beginning of sampling, the matching can be ignored. There is an empirical criterion that can be used to determine what data rate and cable length need to be matched: when the signal conversion time (rise or fall time) exceeds the time required for one-way transmission of the electrical signal along the bus by more than 3 times It is not necessary to add a match at the time. For example, the RS-485 interface MAX483 output signal with limited slope characteristics has a minimum rise or fall time of 250ns, and the signal transmission rate on a typical twisted pair is about 0.2m/ns (24AWG PVC cable), so as long as the data rate is within 250kbps , The cable length does not exceed 16 meters, when using MAX483 as the RS-485 interface, it is not necessary to add terminal matching.
When considering terminal matching, there are multiple matching schemes to choose from. The simplest is to connect a resistance equal to the characteristic impedance of the cable at each end of the bus (Figure 2a). The characteristic impedance of most twisted pairs is approximately 100Ω to 120Ω. This kind of matching method is simple and effective, but it has a shortcoming. The matching resistor consumes a lot of power, which is not suitable for systems with stricter power consumption restrictions. Another power-saving matching method is RC matching (Figure 2b). Using a capacitor C to block the DC component can save most of the power. However, the value of the capacitor C is a difficult point, and a compromise must be made between power consumption and matching quality. In addition to the above two, there is a matching scheme using diodes (Figure 2c). Although this kind of scheme has not realized the real “matching”, it uses the clamping effect of the diode to rapidly weaken the reflected signal, and achieve the purpose of improving the signal quality. The energy saving effect is remarkable.
Each transceiver on the RS-485 bus is connected to the bus through a lead-out line. When the lead-out line is too long, the signal quality on the bus will also be affected due to the reflection of the signal in the lead-out line. Like the previous discussion, the allowable lead-out length of the system is also related to the signal conversion time and data rate. The following empirical formula can be used to estimate the maximum length of the lead wire:
Lmax=(tRISE×0.2m/ns)/10 Take MAX483 as an example, corresponding to 250ns rise/fall time, the maximum lead wire length allowed by the bus is about 5 meters. It can be seen from the above analysis that slowing down the slope of the front and rear edges of the signal is beneficial to reduce the requirements for bus matching and lead-out length, and improve the signal quality. At the same time, it also reduces the high-frequency components in the signal and reduces electromagnetic radiation. Therefore, some The device manufacturer adds a slew rate limiting circuit to the RS-485 interface device to slow down the signal front and rear edges, but this approach also limits the data transmission rate. From this point of view, when choosing an interface device, it is not that the higher the rate, the better, and the device with the lowest rate should be selected according to the system requirements.
The RS-485 standard stipulates that the receiver threshold is ±200mV. This provision can provide relatively high noise suppression capabilities, but it also brings a problem: when the bus voltage is in the middle of ±200mV, the receiver output state is uncertain. Since the UART triggers a receiving action with a leading “0”, the indeterminate state of the receiver may cause the UART to receive some data by mistake and cause the system to malfunction. When the bus is idle, open or short-circuited, it is possible that the voltage difference between the two wires is less than 200mV, and certain measures must be taken to prevent the receiver from being in an unstable state. The traditional method is to bias the bus. When the bus is idle or open, use the bias resistor to bias the bus in a certain state (differential voltage ≥ 200mV). However, this method still cannot solve the problem when the bus is short-circuited. For this reason, some device manufacturers have moved the receiving threshold to -200mV/-50mV, which cleverly solved this problem. For example, Maxim’s RS-485 interface for the MAX3080 series not only eliminates the need for external bias resistors, but also solves the failure protection problem in the case of a bus short circuit.
Ground wire and ground
The grounding of electronic systems is a very critical and often overlooked issue. Improper grounding treatment often results in instability of stable operation and even endangers the safety of the system. The same is true for RS-485 networks. Without a reasonable grounding system, the reliability of the system may be greatly compromised, especially when the working environment is relatively harsh, the grounding requirements are more stringent. There is little information about the grounding problem of RS-485 network, and there are also many misunderstandings among designers, resulting in lower communication reliability and higher interface damage rate. A typical misconception is that the RS-485 communication link does not require a signal ground, but simply connects the “A” and “B” ends of each interface with a pair of twisted pairs. This processing method can also work in some cases, but it lays hidden dangers to the system, mainly in the following two aspects:
Figure 3: Common mode interference caused by ground potential difference
Common mode interference problem. Indeed, the RS-485 interface uses differential transmission of signals, and does not need to detect the signal relative to a certain reference point. The system only needs to detect the potential difference between the two wires. But it should be noted that the transceiver can only work normally when the common-mode voltage does not exceed a certain range (-7V to +12V). When the common-mode voltage exceeds this range, it will affect the reliability of communication until the interface is damaged. As shown in Figure 3, when the transmitter A sends data to the receiver B, the output common mode voltage of the transmitter A is VOS. Since the two systems have their own independent grounding systems, there is a ground potential difference VGPD. Then, the common mode voltage at the input of the receiver will reach VCM=VOS+VGPD. The RS-485 standard stipulates that VOS≤3V, but VGPD may have a large amplitude (ten volts or even tens of volts), and may be accompanied by strong interference signals, causing the receiver common mode input VCM to exceed the normal range, and the signal line Interference current is generated on the interface, which affects normal communication in the slightest, and damages the interface in severe cases.
Electromagnetic radiation (EMI) issues. The common mode part of the driver output signal needs a return path. If there is no return path (signal ground) with low resistance, it will return to the source in the form of radiation, and the entire bus will radiate electromagnetic waves outward like a huge antenna.
Therefore, despite the differential transmission, a low-impedance signal ground is still essential for RS-485 networks. As shown in Figure 4a, a low-impedance signal ground connects the working grounds of the two interfaces, so that the common-mode interference voltage VGPD is short-circuited. This signal ground can be an extra pair of wires (unshielded twisted pair) or the shielding layer of a shielded twisted pair. It is worth noting that this approach is only effective for high-impedance common-mode interference. Due to the large internal resistance of the interference source, a large ground loop current will not be formed after short-circuiting, and it will not have a great impact on communication. When the internal resistance of the common mode interference source is low, a larger loop current will be formed on the ground wire, which will affect the normal communication. The author believes that the following three measures can be taken:
Figure 4: Ground wire and grounding scheme
If the internal resistance of the interference source is not very small, you can consider adding a current-limiting resistor on the grounding wire to limit the interference current. The increase of grounding resistance may increase the common mode voltage, but as long as it is controlled within an appropriate range, it will not affect normal communication (Figure 4b);
Floating technology is used to isolate the ground loop. When the internal resistance of common mode interference is very small, the above method is no longer effective. At this time, you can consider floating the node that introduces interference (such as field instruments in a harsh working environment) (that is, the circuit ground of the system is isolated from the chassis or earth). ), so that the ground loop is cut off, and a large loop current will not be formed (Figure 4c);
Use isolated interface. In some cases, for safety or other considerations, the circuit ground must be connected to the chassis or the ground and cannot be suspended. In this case, an isolation interface can be used to isolate the ground loop, but there should still be a ground wire to connect the common terminal of the isolation side. Connect to the working ground of other interfaces (Figure 4d).
The aforementioned grounding measures only have a protective effect on low-frequency common-mode interference, and cannot do anything about high-frequency transient interference. Because of the lead inductance, the ground wire is actually equivalent to an open circuit for high-frequency transient interference. Such transient interference may have a voltage of hundreds or thousands of volts, but the duration is very short. In the process of switching high-power inductive loads (motors, transformers, relays, etc.), lightning, etc., high-amplitude transient interference will occur. If not properly protected, the interface will be damaged. For this kind of transient interference, isolation or bypass can be used to protect it.
Figure 5a shows the isolation protection scheme. This solution actually transfers the transient high voltage to the electrical isolation layer in the isolation interface. Due to the high insulation resistance of the isolation layer, damaging surge currents will not be generated and play a role in protecting the interface. Usually high-frequency transformers, optocouplers and other components are used to achieve electrical isolation of the interface. The existing device manufacturers integrate all these components into a single IC, which is very easy to use. For example, Maxim’s MAX1480/MAX1490, the isolation voltage can reach 2500V. The advantage of this scheme is that it can withstand high-voltage, long-lasting transient interference, and it is relatively easy to implement. The disadvantage is that the cost is relatively high. Figure 5b shows the bypass protection scheme. This solution uses transient suppression components (such as TVS, MOV, gas discharge tube, etc.) to bypass hazardous transient energy to the ground. The advantage is that the cost is lower, but the disadvantage is that the protection capability is limited, and it can only protect the energy within a certain amount of energy. Transient interference cannot last for a long time, and it needs a good channel to connect to the earth, which is difficult to realize. In practical applications, the two can be combined and used flexibly (Figure 5c). The isolation interface isolates large-scale transient interference, and the bypass element protects the isolation interface from being broken down by excessively high transient voltage.
The RS-485 standard defines an extremely robust and reliable communication link with high noise suppression, wide common mode range, long transmission distance, and collision protection. However, a truly reliable RS-485 network also depends on reasonable applications. . Reasonable network layout, signal channel continuity, comprehensive protection measures, etc., should have an overall plan at the beginning of the design.
The Links: CLAA170EA07QL 6RI75G-160