Share this

Design of an RS-485 repeater with adaptive baud rate

2026-04-06 08:24:29 · · #1
Introduction RS-485 transceivers employ balanced transmission and differential reception, thus possessing the ability to suppress common-mode interference. Furthermore, the receiver's high sensitivity, capable of detecting voltages as low as 200 mV, allows for signal recovery even at distances exceeding one kilometer. Using an RS-485 bus, a single twisted-pair cable can enable multi-station networking, forming a distributed system. The equipment is simple, inexpensive, and capable of long-distance communication, leading to its widespread application. Due to level loss on the twisted-pair cable, the maximum transmission distance of the RS-485 standard is 1200 m; therefore, repeaters must be used for longer distance applications. The number of network nodes depends on the driving capability of the selected chip and the input impedance of the receiver. The RS-485 standard specifies a maximum bus load of 32 units; if the bus load exceeds 32 units, a repeater must be used. 1. RS-485 Repeater Principle RS-485 is a half-duplex system, transmitting differential signals bidirectionally over two wires. It has multi-point, bidirectional communication capabilities, allowing multiple transmitters and receivers to connect to the same bus. The direction of signal transmission on the transmission line is variable. Therefore, identifying and controlling the signal transmission direction on the transmission line is crucial for designing an RS-485 repeater. The RS-485 standard specifies that data signals use differential transmission mode, also known as "balanced transmission." It uses a pair of twisted pairs, defining one wire as A and the other as B, as shown in Figure 1. Typically, the positive voltage level between A and B of the RS-485 transmitter is +2 to +6 V, representing one logic state; the negative voltage level is -6 to -2 V, representing another logic state. RS-485 transmitters generally have an "enable" control signal used to control the disconnection and connection of the transmitter to the transmission line. When the "enable" terminal is low, the transmitter output is in a high-impedance state, called the "third state." It is a third state, distinct from logic "1" and "0". For RS-485 receivers, corresponding specifications are also made for the transmitter; the transmitting and receiving ends are connected via a balanced twisted-pair cable, with AA and BB connected accordingly. When there is a voltage level greater than +200 mV between A and B at the receiving end, the output is a positive logic level; when it is less than ~200 mV, the output is a negative logic level. On the receiver's balanced line, the voltage level range is typically 200 mV to 6 V, as shown in Figure 2. RS-485 receivers also define logic 1 (positive logic level) as B>A, and logic 0 (negative logic level) as A>B, with the voltage difference between A and B not less than 200 mV. In RS-485 receivers, there is generally an "enable" control signal used to control the disconnection and connection of the receiver to the transmission line. When the "enable" terminal is high, the receiver is disconnected from the transmission line, and the receiver output is high; when the "enable" terminal is low, the receiver output level is consistent with the logic level of the bus signal. The schematic diagram of the RS-485 repeater is shown in Figure 3. During normal operation, there are three main states: idle state, data is transmitted from the bus on the side of RS-485 transceiver U1 to the bus on the side of RS-485 transceiver U2 (referred to as "data right transmission state"), and data is transmitted from the bus on the side of RS-485 transceiver U2 to the bus on the side of RS-485 transceiver U1 (referred to as "data left transmission state"). (1) Idle state When the repeater is powered on and running or there is no data transmission on the bus, the repeater works in the idle state. RS-485 transceivers U1 and U2 are both in the data receiving state, and the EN1 and EN2 pins of U1 and U2 are both at low level. (2) Data right transmission state When the RS-485 transceiver U1 detects that there is data being transmitted to the right on the differential signal connected to its A and B pins, it receives the data bit by bit in RS-232 mode through the RO pin of RS-485 transceiver U1 and transmits it through the bus. The DI pin of RS-485 transceiver U2 outputs data bit by bit in RS-232 mode. The transmission sequence is to first transmit a low-level start bit, then transmit 8 data bits, and finally transmit a high-level end bit, which constitutes a data frame. During this period, the EN2 pin of U2 should be high. After that, U2 will continue to output a high level until the next data frame arrives. The EN2 pin of U2 should also be low and in the receiving state. (3) Data left transmission state The process of data left transmission state is the same as that of data right transmission state, except that the EN2 pin of U2 should be high during the time period of a data frame. When there is a large amount of interference on the bus, bus collision may also occur, and data right transmission state and data left transmission state will occur at the same time. At this time, the signals on the bus are invalid, but the bus collision (both sides of the bus are active at the same time) does not need to be handled and resolved by the repeater, but is handled and prevented by the communication protocol. It is required that after the bus collision (or interference) ends, the direction controller of RS-485 repeater can always automatically resume normal operation. 2. Several Types of RS-485 Repeaters Existing RS-485 repeaters typically employ three methods: ① Using a combination of RC charge/discharge delay and RS flip-flops to control the data transmission and reception direction of the RS-485 chip; ② Using a microcontroller's timer to control the RS-485 interface's transmission and reception direction; ③ Using a microcontroller's serial port to monitor data on the bus, and opening the data transmission channel only when data is sent to the terminal under this repeater by looking up a table. The first method has the disadvantage of using resistors and capacitors to form a delay circuit. Due to the inherent errors of the resistors or capacitors, errors caused by the aging of electronic components after a period of operation, and temperature changes, the accuracy of the delay will be affected. Furthermore, this type of repeater requires the communication time interval between two bytes to be greater than the communication time of one byte of data to ensure no data loss, thus reducing the communication rate. The second and third methods have the disadvantage of using microcontroller interrupts to detect the start bit of the data frame. The interrupt response of a microcontroller requires a certain amount of time. The time width of one data bit on the RS-485 bus should be greater than the interrupt response time of the microcontroller before the terminal processor can detect the start bit of each data frame. Therefore, the communication rate of these two methods is also limited. In particular, in the third method, the microcontroller needs to listen to the communication content on the bus and perform corresponding table lookups to determine whether the bus after this repeater is connected to the bus before it. The disadvantage of this method is that it requires processing the communication content of the bus, which not only reduces the real-time performance of the communication but also increases the complexity of the system communication protocol and reduces the reliability of RS-485 bus communication. 3. Adaptive Baud Rate RS-485 Repeater In industrial field applications, the communication speed of the RS-485 bus is generally 2400~115200 bps. Previously designed RS-485 repeaters controlled the transmit and receive status of RS-485 transceivers in units of one data frame time width. Different baud rates result in different control widths for the RS-485 transceiver's transmit and receive states, leading to varying RS-485 bus communication speeds. Therefore, it's necessary to adjust the control width of the RS-485 transceiver's transmit and receive states to adapt to the communication speed of the applied RS-485 bus. The design concept of a baud rate adaptive RS-485 repeater is to control the RS-485 transceiver's transmit and receive states in units of one data bit time width. If the control width of the RS-485 transceiver's transmit and receive states adapts to one data bit time width at any baud rate, then the RS-485 repeater can adapt to any RS-485 bus communication speed. Therefore, a baud rate adaptive RS-485 repeater is designed, as shown in Figure 4. U3 and U4 are relative delay monostable trigger circuits composed of CA555 chips, controlling the left and right data transmission states of the RS-485 repeater, respectively. The relative delay monostable trigger circuit is based on a standard monostable trigger circuit composed of CA555 chips with the addition of diodes D1 and D2. When the CA555 input pin TRIG is low, the CA555 internal circuit and diodes D1 and D2 discharge the RC delay circuit, resulting in a high-level output at Q. When the CA555 input pin TRIG goes high, the CA555 internal circuit and diodes D1 and D2 begin charging the RC delay circuit, delaying for a period of time (related to R×C), before the output at Q goes low. The input and output signal timing is shown in Figure 5. In Figure 5, TRIG is the CA555 input signal; Q is the CA555 output signal; Tw is the time width of a single or consecutive low-level data bit; Trc is the delay time width determined by R11×C1 (or R12×C2) in the monostable trigger circuit composed of U3 and U4. It is advisable to choose a data bit time width smaller than the highest baud rate of the RS-485 bus (e.g., 115200 bps). In this design, the control time width of the RS-485 transceiver's transmit/receive state is always greater than the low-level data transmission width Trc on the bus, and Trc will not exceed the time width of a single data bit at any baud rate. Therefore, the baud rate adaptive RS-485 repeater designed in this paper is suitable for any communication speed of the RS-485 bus in industrial applications. Since the baud rate adaptive RS-485 repeater uses a single data bit time width as a unit, the output enable of the RS-485 transceiver is only turned on and outputs a low level when transmitting low-level data bits. When transmitting high-level data bits, the output enable of the RS-485 transceiver is turned off, and the output of the RS-485 transceiver is in a high-impedance state. Therefore, a bias circuit consisting of pull-up resistors, pull-down resistors, and matching resistors needs to be added to the output of each RS-485 transceiver. When the output is in a high-impedance state, a differential signal representing a high level is formed across the matching resistor and output. To improve the reliability of the baud rate adaptive RS-485 repeater, the output of U3 can be connected to the low-level active reset terminal R of U4 via an inverter; the output of U4 can also be connected to the low-level active reset terminal R of U3 via an inverter. This eliminates the possibility of simultaneous data transmission in opposite directions when data is transmitted from one side of the RS-485 repeater to the other. However, bus collisions may occur when there is significant interference on the bus, resulting in simultaneous right-hand and left-hand data transmission. Due to the imperfect symmetry of the actual circuit, the baud rate adaptive RS-485 repeater can only transmit data in one direction, and after the bus collision (or interference) ends, the repeater is in an idle state, meaning both transceivers at both ends of the repeater are in receiving mode. 4. Conclusion This paper proposes a relative delay monostable trigger circuit composed of CA555 and applies it to the design of an RS-485 bus repeater. This design allows the data transmission status of the RS-485 transceiver to be controlled solely by one or more consecutive low-level bits of the data received by the RS-485 repeater, independent of the data bit duration and thus independent of the baud rate of the bus transmission. Therefore, the RS-485 bus repeater designed in this paper can adaptively transmit data at any baud rate. Practical application has proven that this baud rate adaptive RS-485 repeater is reliable.
Read next

CATDOLL 136CM Ya (TPE Body with Hard Silicone Head)

Height: 136cm Weight: 23.3kg Shoulder Width: 31cm Bust/Waist/Hip: 60/54/68cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22
CATDOLL 128CM Chu

CATDOLL 128CM Chu

Articles
2026-02-22
CATDOLL 108CM Bebe

CATDOLL 108CM Bebe

Articles
2026-02-22