This design guide discusses how to design RS-485 interface circuits. It covers the necessity of balanced transmission line standards and provides an example of process control design. The article also discusses line loading, signal attenuation, failure protection, and current isolation under different headings.
1. Why Balanced Transmission Line Standards Are Needed
The focus of this article is on the most widely used balanced transmission line standard in industry: ANSI/TIA/EIA-485-A (hereinafter referred to as 485). After reviewing some key aspects of the 485 standard, it introduces how to implement a differential transmission structure in practical projects through a factory automation example.
Data transmission between computer components and peripherals over long distances and in high-noise environments is often challenging. If possible, single-ended drivers and receivers should be avoided. For systems requiring long-distance communication, a balanced digital voltage interface is recommended.
485 is a balanced (differential) digital transmission line interface developed to improve the limitations of TIA/EIA-232 (hereinafter referred to as 232). The 485 standard has the following characteristics:
-
High communication rate – up to 50M bits/s
-
Long communication distance – up to 1200 meters (Note: under 100Kbps)
-
Differential transmission – lower noise radiation
-
Multiple drivers and receivers
In practical applications, if reliable and cost-effective data communication is needed between two or more computers, 485 drivers, receivers, or transceivers can be used. A typical example is the transmission of information between a sales terminal and a central computer using 485. Using twisted pair cables to transmit balanced signals has lower noise coupling, and since 485 has a wide common-mode voltage range, it allows communication rates of up to 50M bits/s, or several kilometers at lower speeds.
Due to the wide application of 485, more and more standard committees are adopting the 485 standard as the physical layer specification for their communication standards, including ANSI’s SCSI (Small Computer System Interface), Profibus standards, DIN measurement bus, and China’s multifunctional electric meter communication protocol standard DL/T645.
The balanced transmission line standard 485 was developed in 1983 for data transmission interfaces between hosts and peripherals. The standard only specifies the electrical layer; other aspects such as protocols, timing, serial or parallel data, and linkers are defined by the designer or higher-layer protocols.
Initially, the 485 standard was defined as an upgrade in flexibility over the TIA/EIA-422 standard (hereinafter referred to as 422). Since 422 only supports half-duplex communication (Note: 422 uses two pairs of differential communication lines, one pair for sending and one pair for receiving, so data is transmitted unidirectionally on one line), 485 allows multiple drivers and receivers on one pair of signal lines, facilitating half-duplex communication (see Figure 1). Like 422, 485 does not specify a maximum cable length, but under 24-AWG cables and at 100kbps, it can transmit 1.2km; 485 also does not limit the maximum signal rate, which is instead limited by the rise time and bit time ratio, similar to 232. In most cases, due to transmission line effects and external noise, cable length is a more significant limitation on signal rate than the driver.
2. System Design Considerations
2.1 Line Load
In the 485 standard, line loads must consider line termination and loads on the transmission line. Whether to match the termination of the transmission line depends on system design and is also influenced by transmission line length and signal rate (generally, low-speed short distances can be left without termination matching).
2.1.1 Transmission Line Termination Matching
Transmission lines can be divided into two models: distributed parameter model [1] and lumped parameter model [2]. Testing which model the transmission line belongs to depends on the signal transition (rise/fall) time tt and the propagation time from the driver output to the cable end tpd.
If 2tpd≥tt/5, the transmission line must be treated as a distributed parameter model, and proper termination matching must be handled; otherwise, the transmission line can be considered a lumped parameter model, where termination matching is not mandatory.
Note 1: Distributed parameter model – the voltage and current in the circuit are functions of time and depend on the geometric size and spatial position of the device.
Note 2: Lumped parameter model – the voltage between any two endpoints in the circuit and the current flowing into any device endpoint are fully determined, independent of the geometric size and spatial position of the device.
2.1.2 Unit Load Concept
The maximum number of drivers and receivers connected to the same 485 communication bus depends on their load characteristics. The load of drivers and receivers is measured relative to a unit load. The 485 standard specifies that a maximum of 32 unit loads can be connected to one transmission bus.
Unit load is defined as: under a 12V common-mode voltage environment, allowing a steady-state load current of 1mA, or under a -7V common-mode voltage environment, allowing a steady-state load current of 0.8mA. A unit load may consist of drivers, receivers, and failure protection resistors, but does not include AC termination matching resistors.
Figure 2 provides an example of unit load calculation for the SN75LBC176A transceiver. Since this device integrates both drivers and receivers to form a transceiver (i.e., the driver output and receiver input are connected to the same bus), it is difficult to separately obtain the driver leakage current and receiver input current. For ease of calculation, the receiver input impedance is considered to be 12 kΩ, and the transceiver is given a current of 1mA. This can represent one unit load, allowing 32 such loads on one transmission bus.
As long as the input impedance of the receiver is greater than 12kΩ, more than 32 such transceivers can be used on one transmission bus.
2.2 Signal Attenuation and Distortion
A useful rule of thumb is that under maximum signal rate (in Hz) communication conditions, signal attenuation of -6dB is permitted. Generally, cable suppliers provide signal attenuation charts. The curve shown in Figure 3 illustrates the relationship between 24-AWG cable attenuation and frequency.
The simplest way to determine the extent of the impact of random noise, jitter, distortion, etc., on the signal is to use an eye diagram. Figure 4 shows the distortion of the signal at the receiving end under different signal rates at a distance of 500 meters using 20AWG twisted pair cable. As the signal rate increases further, the effects of jitter become more pronounced. At 1Mbit/s, the jitter is about 5%, while at 3.5Mbit/s, the signal begins to be completely drowned out, and transmission quality degrades severely. In practical systems, the maximum allowable jitter is generally less than 5%.
2.3 Fault Protection and Failure Protection
2.3.1 Fault Protection
Like any other system design, it is essential to habitually consider fault response measures, whether these faults are naturally occurring or induced by the environment. For factory control systems, protection against extreme noise voltages is typically required. The differential transmission mechanism provided by 485, especially the wide common-mode voltage range, gives 485 a certain immunity to noise. However, in the face of complex and harsh environments, this immunity may be insufficient. Several methods can provide protection, with the most effective being current isolation, which will be discussed later. Current isolation can provide better system-level protection, but it is also more expensive. A more popular and cost-effective solution is to use diode protection. Replacing current isolation with diode methods is a compromise that provides protection at a lower level. Examples of external diodes and internally integrated transient protection diodes are shown in the following figures:
Figure 5 shows the use of external diodes on the 485 transceiver SN75LBC176 to prevent transient spikes.
RT is typically the termination resistor, equal to the cable characteristic impedance R0.
Figure 6 shows the internally integrated transient suppression diodes of the 485 transceiver SN75LBC184, used in situations where full 485 functionality is desired but PCB space is limited. The SN75LBC184 integrates protection diodes internally, specifically for high-energy electrical noise environments and can directly replace the SN75LBC176.
2.3.2 Failure Protection
Many 485 applications also require failure protection, which is very useful for the application layer and needs to be carefully considered and fully understood.
In any interface system where multiple drivers/receivers share the same bus, the drivers are mostly inactive, a state known as the bus idle state. When the driver is in an idle state, the driver output is in a high-impedance state. When the bus is idle, the line voltage is in a floating state (meaning it is uncertain whether it is high or low). This can cause the receiver to be erroneously triggered to a high or low state (depending on environmental noise and the last level polarity before the line floated). Clearly, this situation is undesirable. There must be related circuits in front of the receiver to convert this uncertain state into a known, pre-agreed level, which is referred to as failure protection. Additionally, failure protection must be able to prevent data errors caused by short circuits.
There are many methods to achieve failure protection, including adding hardware circuits and using software protocols. Although software protocols are more complex to implement, they are the preferred method. However, because most system designers and hardware designers prefer to use hardware to implement failure protection, adding hardware circuits for failure protection is more commonly used.
Whether in the case of a short circuit or an open circuit, the failure protection circuit must provide a clear input voltage for the receiver. If the communication line is in a very harsh environment, line termination matching is also a must.
Currently, many manufacturers are beginning to integrate some failure protection circuits (such as open-circuit failure protection) into the chip. Typically, these additional circuits only add a high-value pull-up resistor at the non-inverting input of the receiver and a high-value pull-down resistor at the inverting terminal of the receiver. These two resistors are usually around 100KΩ, and these resistors and the termination matching resistors form a potential driver that can only provide a few mV of differential voltage. Therefore, this voltage (receiver critical voltage) is not sufficient to switch the receiver state. Using such internal pull-up and pull-down resistors allows the bus to operate without termination matching but significantly reduces the maximum signal rate and reliability.
Figure 7 provides some general external failure protection circuits for the 485 interface, each circuit strives to maintain the receiver input voltage above the minimum critical value and maintain a known logic state under one or more fault conditions (open circuit, idle, short circuit). In these circuits, R2 represents the transmission line impedance matching resistor and becomes part of the voltage driver: generating a steady-state bias voltage. Here it is assumed that each receiver represents one unit load.
The table on the right side of Figure 7 lists some typical resistor and capacitor values, the types of failure protection provided, the number of unit loads used, and signal distortion. In the next section, the resistance values in the short-circuit failure circuit will be calculated to illustrate how to modify these resistance values to suit specific designs.
To achieve short-circuit protection, more resistors are needed. When the cable is shorted, the transmission line impedance becomes zero, and the termination matching resistor is also shorted. Adding extra resistors in series at the receiver input can implement short-circuit failure protection.
Figure 8 shows that the additional resistor R3 can only be used in cases where the driver and receiver are separated. Most 485 drivers and receivers are now integrated into one chip (called a transceiver) and are internally connected to the same bus, making this transceiver unsuitable for short-circuit failure protection. If short-circuit protection is needed, one can opt for transceivers with internal short-circuit protection or use separate driver and receiver devices, such as SN75ALS180. If short-circuit failure protection circuits are used in transceivers, resistor R3 will cause additional distortion in the output signal. The separate driver and receiver device SN75ALS180 will not have this issue because the driver is directly connected to the bus, bypassing R3.
Next, we will calculate the resistance values. If the transmission line is shorted, R2 is removed from the circuit, and the receiver input voltage is:
VID= VCC * 2R3 / (2R1 + 2R3)
For 485 applications, the standard specifies that receivers can recognize input signals as low as 200mV. Therefore, when VID> VIT or VID > 200mV, a known state can be determined. This is the first design constraint:
VCC* 2R3 / (2R1 + 2R3) > 200mV
When the transmission line is in a high-impedance state, the receiver is influenced by R1, R2, and R3, and its input voltage is:
VID= VCC* (R2 + 2R3) / (2R1 + R2 + 2R3)
The second design constraint is obtained:
VCC * (R2 + 2R3) / (2R1 + R2 + 2R3) > 200mV
The transmission line will be influenced by the termination matching resistor R2 and the parallel combination of (R1 + R3) multiplied by two. The characteristic impedance Zo of the transmission line should match this, leading to the third design constraint:
Zo= 2R2 * (R1 + R3) / (2R1 + R2 +2R3)
Other design constraints include additional line loads provided by failure protection circuits, signal distortion caused by R3 and R1, and receiver input resistance.
Note: 3.3V 485 transceivers such as SN75HVD10 and newer products have integrated short-circuit/open-circuit failure protection circuits.
2.4 Current Isolation
Computers and industrial serial interfaces often operate in noisy environments, which can affect the integrity of data transmission. For any interface circuit, a tested method to improve noise performance is current isolation.
In data communication systems, isolation refers to the absence of direct current flow between multiple drivers and receivers. Isolation transformers provide power to the system, while opto-isolators or digital isolation devices provide data isolation. Current isolation can eliminate ground loops and suppress noise voltages. Therefore, using this technique can suppress common-mode noise and reduce other radiated noise.
For example, Figure 9 shows a node in a process control system connected to a data logger and main computer via a 485 link.
When a nearby motor starts, the ground potential of the data logger and computer can momentarily differ, which often causes a large current. If data communication does not adopt an isolation scheme, data may be lost, and in worse cases, the computer may be damaged.
2.4.1 Circuit Description
The schematic shown in Figure 9 is a node in a distributed monitoring, control, and management system, a scheme commonly used in process control. Data is transmitted over a pair of twisted wires, and the ground wire uses a shielding layer. Such applications often require low power consumption, as many remote sub-stations use batteries or require backup batteries (the device must be able to operate on backup batteries for a certain period after power failure). Additionally, using low-power counting allows for the use of small isolation transformers. As shown in Figure 9, the transceiver uses SN65HVD10; of course, any TI 3.3V or 5V RS485 transceiver, 3.3-V TIA/EIA-644 LVDS, or 3.3-V TIA/EIA-899 M-LVDS transceiver can use this circuit.
2.4.2 Operating Principle
The example shown in Figure 9 can be used for 3.3V or 5V, with the power supply isolated by a transformer, and the data signal isolated by digital isolators. Since the 485 transceiver requires an isolated power supply, an adjustable LDO voltage regulator must be isolated. This function can be achieved by driving the isolation transformer with a NAND gate oscillator circuit. The output voltage of the transformer is adjusted and filtered for use by a low-dropout linear regulator. In high EMI environments, this method is often used to prevent noise coupling from other long-distance power electronic systems into the main power supply. TPS7101 is used to power other electronic components, providing up to 500mA of current. By adjusting the bias resistor R7, TPS7101 can output 3.3V or 5V, with specific resistance values listed in the BOM.
The data signal isolation is completed by the three-channel digital isolator ISO7231M. This device can provide 2.5KV (rms) voltage isolation and 50KV/us instantaneous discharge protection at a signal rate of 150Mbps.
3. Example of Process Control Design
To gain more knowledge about 485 system design, a good approach is to look at specific examples. Consider a system with a master controller and several sub-stations in a factory automation system, each sub-station capable of sending and receiving data.
The system characteristics are as follows, with general specifications shown in Figure 10.
-
Farthest sub-station from the master controller is 500 meters
-
31 sub-stations (32 devices in total including the master)
-
Signal transmission rate of 500 kbit/s
-
Half-duplex communication
Devices following the 485 standard transmit data at 500 kbit/s, requiring the driver output transition (rise/fall) time tt not to exceed 0.3 unit interval (UI), thus:
tt≤ 0.3 * UI
tt≤ 0.3 * (1 /(500 * 103) ) = 600ns
If the cable transmission signal speed equals the speed of light in a vacuum, the signal transmission delay tpd is 3.33ns/m, multiplied by the transmission line length of 500 meters, yielding 1667ns.
According to Section 2.1, it can be determined whether the transmission line is a distributed parameter model or a lumped parameter model: if 2tpd ≥ tt/5, the transmission line is considered a distributed parameter model. Clearly, 3334 > 120, so the transmission line model in this example is a distributed parameter model. In industrial environments, this transmission line must be terminated.
Regarding attenuation, although the fundamental frequency of a signal rate of 500 kbit/s is 250 kHz, we still calculate attenuation at 500 kHz because the signal actually contains higher frequency components. According to the empirical rule that maximum attenuation should not exceed -6dB, the maximum attenuation at the end of the 500-meter cable should be less than -6dB, i.e., 0.36dB/30 meters. We check the chart shown in Figure 3, which is provided by the cable manufacturer, showing the relationship between attenuation and frequency, and the attenuation at 500 kHz corresponds to more than 0.5dB/30 meters, exceeding the design constraint by 0.14dB/30 meters. In this example, this is acceptable because slightly reducing the noise margin provided by conservative rules is permissible.