This design guide discusses how to design RS-485 interface circuits. The necessity of balanced transmission line standards is discussed, along with an example of process control design. The article also discusses line load, signal attenuation, fault protection, and current isolation under various headings.
1. Why Balanced Transmission Line Standards Are Necessary
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, we present an example of factory automation to illustrate how to implement differential transmission structures in practical projects.
Data transmission between computer components and peripherals in long-distance, high-noise environments is often challenging, and 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 overcome 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: at 100Kbps)
· Differential transmission – lower noise radiation
· Multiple drivers and receivers
In practical applications, if reliable and cost-effective data communication is required between two or more computers, 485 drivers, receivers, or transceivers can be used. A typical example is the use of 485 to transmit information between sales terminals and a central computer. Using twisted pair cables to transmit balanced signals results in lower noise coupling, combined with the wide common mode voltage range of 485, allowing for communication at rates of up to 50M bits/s or several kilometers at lower speeds.
Due to the widespread use 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 energy meter communication protocol standard DL/T645.
The balanced transmission line standard 485 was developed in 1983 for data transmission interfaces between hosts and peripherals, specifying only the electrical layer; other aspects such as protocols, timing, serial or parallel data, and linkers are defined by the designer or higher-level protocols.
Initially, the 485 standard was defined as an upgrade in flexibility over the TIA/EIA-422 standard (hereinafter referred to as 422). Given that 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 a single pair of signal lines, facilitating half-duplex communication (see Figure 1). Like 422, the 485 standard does not specify a maximum cable length, but under 100kbps conditions using 24-AWG cable, a transmission distance of 1.2km is achievable; 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, the cable length restricts the signal rate more than the driver does due to transmission line effects and external noise influence.
2. System Design Considerations
2.1 Line Load
In the 485 standard, line load must consider the line termination and the load on the transmission line. Whether to match the termination of the transmission line depends on the system design and is influenced by the transmission line length and signal rate (generally, low-speed short distances may not require termination matching).
2.1.1 Transmission Line Termination Matching
Transmission lines can be classified into two models: distributed parameter model [1] and lumped parameter model [2]. Testing which model a transmission line belongs to depends on the signal transition (rise/fall) time tt and the propagation time from the driver output to the end of the cable tpd.
If 2tpd ≥ tt/5, the transmission line must be treated according to the distributed parameter model, and 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 dimensions and spatial positions of the devices.
Note 2: Lumped parameter model – the voltage between any two endpoints in the circuit and the current flowing into any device endpoint is completely determined and does not depend on the geometric dimensions and spatial positions of the devices.
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.
A unit load is defined as: in a 12V common mode voltage environment, allowing a steady load current of 1mA, or in a -7V common mode voltage environment, allowing a steady 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 gives an example of unit load calculation for the SN75LBC176A transceiver. Since this device integrates the driver and receiver into a transceiver (i.e., the driver output and receiver input are connected to the same bus), it is challenging to separately obtain the driver leakage current and receiver input current. For calculation convenience, the receiver input impedance is considered as 12 kΩ, and the transceiver is given a 1mA current. This can represent one unit load, allowing up to 32 such loads on a transmission bus.
As long as the receiver’s input impedance is greater than 12kΩ, more than 32 such transceivers can be used on a 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 permissible. Generally, cable suppliers provide signal attenuation charts. The curve shown in Figure 3 illustrates the relationship between the attenuation of 24-AWG cable and frequency.
The simplest way to determine the extent of the effects of random noise, jitter, distortion, etc., on the signal is to use an eye diagram. Figure 4 shows the signal distortion at the receiver end under different signal rates using 20AWG twisted pair cable at 500 meters. As the signal rate increases further, the impact of jitter becomes more pronounced. At 1Mbit/s, the jitter is approximately 5%, while at 3.5Mbit/s, the signal begins to be completely submerged, and transmission quality is severely degraded. 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 routinely consider fault mitigation 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, particularly its wide common mode voltage range, gives 485 a certain immunity to noise. However, in 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 comes at a higher cost. A more popular and cheaper solution is to use diode protection. Using diodes instead of current isolation is a compromise method that provides protection at a lower level. Examples of external diodes and internally integrated transient protection diodes are shown in the figures below:
Figure 5 shows the 485 transceiver SN75LBC176 with external diodes to prevent transient spikes.
RT is usually the termination resistor, equal to the cable characteristic impedance R0.
Figure 6 shows the internally integrated transient suppression diode of the 485 transceiver SN75LBC184, used in cases where full 485 functionality is desired but PCB space is limited. The SN75LBC184 integrates protection diodes internally, designed 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 useful at the application layer and needs careful consideration and thorough understanding.
In any interface system where multiple drivers/receivers share the same bus, drivers are mostly inactive, a state referred to as bus idle. When drivers are idle, their outputs are in a high-impedance state. When the bus is idle, the voltage along the line is in a floating state (that is, it is uncertain whether it is high or low). This can cause the receiver to be incorrectly triggered as high or low (depending on the environmental noise and the last level polarity before the line floated). Clearly, this situation is undesirable. There needs to be relevant circuitry in front of the receiver to turn this uncertain state into a known, predetermined level, referred to as failure protection. Additionally, failure protection must also prevent data errors caused by short circuits.
There are many methods to achieve failure protection, including adding hardware circuits and using software protocols. Although implementing software protocols is more complex, it is the preferred method. However, most system designers and hardware designers prefer to implement failure protection using hardware, and adding hardware circuits for failure protection is more commonly used.
Whether in the case of short circuits or open circuits, the failure protection circuit must provide clear input voltage to the receiver. If the communication line is in a very harsh environment, termination matching is also necessary.
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 on the receiver’s non-inverting input and a high-value pull-down resistor on the inverting input of the receiver. These two resistors are usually around 100KΩ, and these resistors and the termination matching resistor form a potential driver that can only provide a few mV of differential voltage. Thus, this voltage (the receiver’s critical voltage) is not enough to switch the receiver state. Using such internal pull-up and pull-down resistors allows the bus to operate without termination matching, but it significantly reduces the maximum signal rate and reliability.
Figure 7 presents some common external failure protection circuits for the 485 interface, each striving to maintain the receiver input voltage above the minimum critical value and maintain a known logical 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 half of Figure 7 lists some typical resistance and capacitance values, the types of failure protection provided, the number of unit loads used, and the signal distortion. In the next section, we will illustrate how to modify these resistance values to suit specific designs through calculations on the resistance values in short circuit failure circuits.
To achieve short circuit protection, additional resistors are needed. When the cable is short-circuited, the transmission line impedance becomes zero, and the termination matching resistor is also short-circuited. Adding extra resistors in series at the receiver input can achieve short circuit failure protection.
Figure 8 shows that the additional resistor R3 can only be used in cases where the drivers and receivers are separated. Currently, the vast majority of 485 drivers and receivers are integrated into a single chip (referred to as transceivers) and are internally connected to the same bus, making it impossible to use short circuit failure protection in these transceivers. If short circuit protection is needed, one can choose transceivers with integrated short circuit protection or use devices that separate drivers and receivers, such as the SN75ALS180. If a short circuit failure protection circuit is used in a transceiver, resistor R3 will cause additional distortion in the output signal. Devices like the SN75ALS180 that separate drivers and receivers do not have this problem because the driver is directly connected to the bus, bypassing R3.
Next, we will calculate the resistance values. If the transmission line is short-circuited, R2 is removed from the circuit, and the voltage at the receiver input 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 affected by R1, R2, and R3, and its input voltage is:
VID= VCC* (R2 + 2R3) / (2R1 + R2 + 2R3)
This leads to the second design constraint:
VCC * (R2 + 2R3) / (2R1 + R2 + 2R3) > 200mV
The transmission line will be influenced by the termination matching resistor R2 and twice the parallel combination of (R1+R3). The characteristic impedance Zo of the transmission line must match this, leading to the third design constraint:
Zo= 2R2 * (R1 + R3) / (2R1 + R2 +2R3)
Other design constraints include additional line loads provided by the failure protection circuit, signal distortion caused by R3 and R1, and the 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 optocouplers or digital isolator devices provide data isolation. Current isolation can eliminate ground loops and suppress noise voltage. Therefore, using this technology can suppress common mode noise and reduce other radiation noise.
For example, Figure 9 shows a node of a process control system, connecting a data logger and a main computer via a 485 link.
When a nearby motor starts, the ground potential of the data logger and computer may experience a momentary difference, typically causing 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 of a distributed monitoring, control, and management system, commonly used in process control. Data is transmitted via a pair of twisted pairs, with the ground line shielded. Such applications often require low power consumption, as many remote sub-stations use batteries or require backup batteries (the device needs to work with a backup battery for a certain time after power failure). Additionally, using low-power counting allows for the use of small isolation transformers. As shown in Figure 9, the transceiver uses the SN65HVD10, but 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 be used in this circuit.
2.4.2 Operating Principle
The example shown in Figure 9 can be used with either 3.3V or 5V; the power supply uses transformer isolation, and the data signals are isolated using digital isolators. Since the 485 transceiver requires an isolated power supply, an adjustable LDO voltage regulator must be isolated. This functionality can be implemented by driving the isolation transformer with a non-gate oscillator circuit. The output voltage from the transformer is adjusted and filtered for use by the low-dropout linear regulator. In high EMI environments, this method is commonly used to prevent noise coupling from other long-distance powered electronic systems into the main power supply. The TPS7101 is used to power other electronic components, providing a maximum current of 500mA. By adjusting the bias resistor R7, the 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 transient 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 capacity of one master controller and several sub-stations in a factory automation system, where each sub-station can send and receive data.
The system characteristics are as follows, with general specifications shown in Figure 10.
· The farthest sub-station is 500 meters from the master controller
· 31 sub-stations (32 devices in total including the master)
· Signal transmission rate is 500 kbit/s
· Half-duplex communication
Devices that follow the 485 standard transmit data at 500 kbit/s, requiring the driver output transition (rise/fall) time tt to not exceed 0.3 unit interval times (UI), hence:
tt ≤ 0.3 * UI
tt ≤ 0.3 * (1 /(500 * 103)) = 600ns
If the signal propagation speed in the cable equals the speed of light in a vacuum, then the signal transmission delay tpd is 3.33ns/m, multiplied by the transmission line length of 500 meters, results in 1667ns.
Using the formula from section 2.1, we can determine 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 type of transmission line must be terminated.
Regarding attenuation, even though the basic frequency 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 maximum attenuation rule of not exceeding -6dB, the maximum attenuation at the end of a 500-meter cable should be less than -6dB, which translates to 0.36dB/30 meters. We refer to the graph in Figure 3, which is provided by the cable manufacturer, showing the relationship between attenuation and frequency. The attenuation corresponding to a frequency of 500 kHz is more than 0.5dB/30 meters, exceeding the design constraint of 0.14dB/30 meters. In this case, this is permissible, as slightly reducing the noise tolerance provided by conservative rules is acceptable.