Correct connection mode of RS485 communication

The ideal conductor is twisted pair: it is best to use a pair of twisted pairs for two half-duplex conductors, so that the two conductors are twisted together to offset the interference level added to the two conductors and achieve the effect of anti-interference. In full duplex, one pair is used to receive two lines and the other pair is used to transmit two lines. RS485 has no power transmission requirements, so the requirements for wire diameter are not high.

In practical engineering, outdoor waterproof twisted pair is usually purchased to ensure the protective performance of the line. However, some engineers will use RVV cable, which is also possible, but the anti-interference is poor. In this way, some engineers use RVVP wires (with shielding), which is not good, because the increase of capacitance between wires will affect the transmission quality and reduce the baud rate of transmission.

Baud rate setting has a certain correspondence with cable length (including total branch length). The longer the line, the lower the baud rate should be.

No matter which cable you choose, you should try to use bus architecture, reduce star connections, keep branch lines as short as possible, and try to use daisy chain connection, that is, the bus is connected to the first node and then jumps to the next node.

It's best to remove the branch line of unconnected equipment from the bus, otherwise it is easy to form interference. If the signal received at the last end of the bus is not good, a line resistance of 120 ohm can be added at both ends of the signal line. Do not add intermediate equipment, otherwise it will increase line loss and reduce the number and distance of equipment.

The RS485 chips of different devices are usually different, and different types of chips with different loads are usually invisible to engineers. So that is to say, the maximum number of connected devices of different devices on the bus is uncertain, and the number of connected devices of the same device can be found in the device description requirements.

Extended data:

RS485 is a standard, which defines the electrical characteristics of drivers and receivers in balanced digital multipoint systems, and is defined by telecommunication industry associations and electronic industry alliances. The digital communication network adopting this standard can effectively transmit signals under long-distance conditions and in the environment with large electronic noise. RS-485 makes it possible to configure cheap local networks and multi-branch communication links.

RS485 has two connection modes: two-wire system and four-wire system. Four-wire system can only realize point-to-point communication, and it is rarely used now. Two-wire system is used now. This connection mode is a bus topology, and up to 32 nodes can be connected on the same bus.

In RS485 communication network, master-slave communication mode is generally adopted, that is, a master with multiple slaves. In many cases, when connecting the RS-485 communication link, only one pair of twisted pairs is needed to connect the "A" and "B" terminals of each interface, ignoring the connection of signal ground. This connection method can work normally in many occasions, but it has buried great hidden dangers.

The reason of 1 is * * mode interference: RS-485 interface uses differential mode to transmit signals, and it is not necessary to detect signals relative to a certain reference point. The system only needs to detect the potential difference between two wires, but it is easy to ignore that the transceiver has a certain * * * mode voltage range, and the * * mode voltage range of RS-485 transceiver is -7 to +65438+.

When the * * * mode voltage in the network line exceeds this range, it will affect the stability and reliability of communication and even damage the interface; The second reason is EMI: the * * mode part of the transmitter driver output signal needs a return path. If there is no low-resistance return path (signal ground), it will return to the source in the form of radiation, and the whole bus radiates electromagnetic waves like a huge antenna.

The network topology generally adopts the bus structure of terminal matching. When building a network, we should pay attention to the following points:

(1) Use a twisted-pair cable as the bus, connect all nodes in series, and the length of the outgoing line from the bus to each node should be as short as possible to minimize the influence of the reflected signal in the outgoing line on the bus signal. Some network connections are incorrect.

It may still work normally under the condition of short distance and low speed, but with the extension of communication distance or the improvement of communication speed, its adverse effects will become more and more serious, mainly because the signals reflected at the ends of each branch will be superimposed with the original signals, resulting in the decline of signal quality.

(2) Pay attention to the continuity of bus characteristic impedance, and signal reflection will occur at the point where the impedance is discontinuous. This kind of discontinuity is easy to appear in the following situations: different cables are used in different sections of the bus, or too many transceivers are installed in a certain section of the bus close to each other, and the branch lines drawn from the bus are too long. In short, a single continuous signal channel should be provided as a bus.

(3) Pay attention to the problem of terminal load resistance. In the case of few devices and short distance, the whole network can work well without terminal load resistance, but with the increase of distance, the performance will decline. Theoretically, when sampling at the midpoint of each received data signal, the matching can be ignored as long as the reflected signal is sufficiently attenuated at the beginning of sampling.

However, this is difficult to grasp in practice. An article by MAXIM Company in the United States mentioned an empirical principle, which can be used to judge what kind of data rate and cable length need to be matched: when the signal conversion time (rising or falling time) exceeds more than three times the time required for one-way transmission of electrical signals along the bus, it can not be matched.

References:

Baidu Encyclopedia -RS485 Communication Interface