Home >Product dynamics>Product dynamics
Why does RS485 need to add a pull-down resistor

The 485 bus is a commonly used differential signal transmission method. It has the advantages of strong anti-interference ability, long transmission distance, and large number of nodes. It is widely used in communication, industrial automation and other fields. However, in practical applications, we may encounter a problem, that is, whether the 485 bus needs to add pull-down resistors on the A and B lines, and how much resistance is appropriate. This article will analyze and explain this problem.

1. How does the 485 bus work?

RS485-1.png

First of all, we need to understand the working principle and signal characteristics of the 485 bus. According to the RS-485 standard, the 485 bus transmits differential signals through two lines (A and B), and the current data bit is judged to be 0 or 1 according to the voltage difference between the two lines.

There are three states of data during 485 transmission:
1. When the voltage difference between A and B is greater than +200mV, the logic of the 485 transceiver output is 1;
2. When the voltage difference between A and B is less than -200mV, the 485 transceiver output logic is 0;
3. When the voltage difference between A and B is between -200mV+200mV, the 485 transceiver may output high level or low level, which is an uncertain state.


2. How to avoid an uncertain state


Under normal circumstances, we hope that the data received by the receiver can only be 0 or 1, and the uncertain state cannot appear on the 485 bus. So, under what circumstances will there be an uncertain state?
There are mainly two situations:
1. When the 485 bus is in the idle state, that is to say, all the 485 transceivers are in the receiving state, and no one transceiver is driving the bus. At this time, since no signal source generates a differential voltage on the bus, the voltages on the two lines A and B are basically equal, that is, the differential voltage is basically 0.
2. When the 485 bus is in an open state, that is, when a 485 transceiver is disconnected from the bus. At this point, since the disconnected transceiver no longer has an impact on the bus, the differential voltage between the remaining transceivers is basically zero.
3. When the output of the 485 driver is insufficient to make the absolute value of A and B greater than 200mV, that is to say, the signal state of the 485 bus can no longer reflect the state of the driver, and the receiver cannot recognize the correct signal.

When the 485 bus is in an uncertain state, it will cause communication errors or failures. For example, if a 485 transceiver thinks that it has received a data 0 signal in an uncertain state and outputs a low level to the serial port, then for UART communication, this is equivalent to a start bit (Start Bit), which will cause errors. Judgment or bit error; if a 485 transceiver outputs high and low levels alternately in an uncertain state, then for UART communication, it will interfere with normal data, causing the UART receiver to receive abnormal data.

In order to prevent the 485 bus from being in an uncertain state, we analyzed these two abnormalities. The reason for these two abnormalities is that when the transceiver is in the receiving state, the normal voltage difference on the AB line cannot be maintained. In order to maintain the correct voltage difference in the state of idle or disconnection, we need to add pull-down resistors on the A and B lines (usually A is connected to the pull-up resistor, and B is connected to the pull-down resistor) to ensure that the bus is idle. Or there is a fixed differential voltage in the open circuit state.

As shown below:

RS485-2.png

So, what factors do we need to consider when choosing the size of the pull-down resistor? There are mainly the following aspects:
1. The pull-up and pull-down resistors should be small enough to ensure that the differential voltage in the idle or open state is greater than +200mV or less than -200mV (as the case may be) to avoid indeterminate states.
2. The pull-up and pull-down resistors should be large enough to reduce power dissipation and heat without affecting the drive capability and output voltage of the 485 transceiver.
3. The pull-up and pull-down resistors should match the input impedance, terminal resistance, bus length, number of nodes and other factors of the 485 transceiver to ensure the impedance matching and signal integrity of the bus.
First of all, when the transceiver is disconnected, the voltage of transceiver A and B is jointly determined by , , and , that is:


Usually we will use the same value as and, then the formula can be simplified as:

At this time, we set the internal differential input resistance of the chip, and it can be calculated that at this time, of course, as long as the disconnection can be satisfied, the A and B lines are in the data 1 state.
For the idle state, it is considered that most node devices will add and resistors on the A and B lines, and will add resistors to the terminals. As shown below:

RS485-3.png

We know from the previous derivation process that the only difference is the increased input resistance and pull-up and pull-down resistance due to the addition of nodes, so we can derive the following formula based on the above circuit:

In this formula, m is the number of nodes with pull-up and pull-down resistors, and n is the number of nodes. The difference between terminal A and terminal B of the bus is defined as a minimum of 200mA, so that we can simplify this formula to:

With this formula, the value of the pull-up and pull-down resistors can be determined according to the actual number of nodes.

However, the result calculated according to this formula is only an ideal value. In actual use, the pull-up and pull-down resistors are generally determined inside the node. Different node devices may have different internal pull-up and pull-down resistors. We need to consider the number of nodes to consider the value of this resistor. To determine the value of the pull-up and pull-down resistors, it is also necessary to consider the load capacity of the driver chip. The pull-up and pull-down resistors cannot be set very small.

In short, the 485 bus needs to add a pull-down resistor on the AB line, mainly to ensure that the bus has a fixed differential voltage in the idle or open state, so as to avoid communication errors or failures caused by uncertain states. When selecting the size of the pull-down resistor, factors such as power consumption, driving capability, and impedance matching need to be considered comprehensively to ensure the stability and reliability of communication.