
RS-485, like RS-232, is a serial communication standard. The current standard name is TIA485/EIA-485-A, but it is commonly referred to as the RS-485 standard. RS-485 is widely used in industries such as automation, automotive, and building management.
The RS-485 bus overcomes the shortcomings of RS-232’s short communication distance and low speed. The speed of RS-485 can reach up to 10 Mbit/s, with a theoretical communication distance of up to 1200 meters. Unlike RS-232’s single-ended transmission, RS-485 uses differential transmission with a pair of twisted wires, one defined as A and the other as B.
【Physical Layer of RS-485】
The physical layer of RS-485 is responsible for transmitting raw data between devices and the physical transmission medium. It handles the conversion from electrical signals to digital data and defines parameters such as voltage, timing, and data rate.
① Differential Signal
Long-distance wiring can lead to signal attenuation, and the potential for noise and interference increases. This is reflected in the voltage amplitude changes on wires A and B. However, the advantage of using differential lines is that the difference between them can ignore interference and still output a normal signal. The ability of this differential receiver to disregard the same voltage on both signal lines is referred to as common-mode rejection.
The standard specifies that for logic 1: +2V to +6V; for logic 0: -6V to -2V.
RS-485 does not require a specific bus voltage; it only looks at the minimum differential voltage. Over longer cable lengths, the voltage received by the receiver may drop to +/- 200 mV, which is still fully acceptable for RS-485. This is one of the advantages of RS-485.
Many transceivers meet or exceed the TIA/EIA-485A specifications. In practical use, the device’s SPEC parameters take precedence; for example, the minimum negative input threshold of a certain transceiver is -200 mV.
Many RS-485 converters are also compatible with RS-422, hence many converters show signals as T/R+ and T/R-, corresponding to RS-485’s A+ and B-.
For the DB9 female connector, RS-485 has the following wiring definition illustration, with Pin6~Pin9 being N/A (not connected).
RS-485 can be wired in both two-wire and four-wire configurations. The four-wire configuration only allows point-to-point communication and is rarely used. The two-wire wiring method is commonly used, which is a bus topology that can connect up to 32 nodes on the same bus.
RS-485 bus operates in a master-slave mode similar to I2C, supporting point-to-point single slave mode as well as multi-slave mode, but not multi-master mode.

RS-485 uses differential transmission. If a microcontroller controls RS-485 interface devices, a transceiver is required, similar to the CAN bus. Below is a diagram of an MCU controlling an RS-485.
The transceiver consists of a receiver (upper part) and a transmitter (lower part). Here is a brief explanation of the transceiver’s principles to help understand how the MCU communicates with the 485 device.

Internal Structure of RS-485 Transceiver
-
-
-
RE is the receiver enable signal;
-
DE is the transmitter enable signal;
-
D is the transmitter output;
For enable signals, the letter with a bar above indicates low level is effective (as in RE), while those without the bar indicate high level is effective (as in DE).
For the transmitter, the truth table is as follows:
1. When the driver enable pin DE is high, the differential outputs A and B follow the logic state at data input D. A high at D causes A to go high and B to go low. In this case, the differential output voltage defined as VOD=VA-VB is positive. When D is low, the output state reverses, with B going high and A going low, making VOD negative.
2. When DE is low, both outputs become high impedance, and in this state, they are unrelated to the logic state at D.
Transmitter Truth Table
For the receiver, the truth table is as follows:
1. When the receiver enable pin RE is low, the receiver is activated. When the differential input voltage defined as VID=VA–VB is positive and exceeds the positive input threshold VIT+, the receiver output R goes high. When VID is negative and below the negative input threshold VIT-, the receiver output R goes low. If VID is between VIT+ and VIT-, the output is uncertain.
2. When RE is high or floating, the receiver output is high impedance, independent of the magnitude and polarity of VID.
Receiver Truth Table
The working principles of the RS-485 transceiver discussed above will now be briefly described regarding the RS-485 data link.
The host sends to the slave or the slave sends to the host, which will occupy the A and B lines; hence, RS-485 is often used in half-duplex mode.
The host’s GPIO will control the RS-485 transceiver’s DE pin to set the transmission mode, sending a byte of data from the UART TXD line to the RS-485 transceiver’s data (D or DI) line. The transceiver will convert the single-ended UART bit stream to a differential bit stream on the A and B lines. After the data leaves the transceiver, the host immediately switches the transceiver’s mode to receive mode.
Similarly, the slave controls the RS-485 transceiver’s /RE pin to set it to receive mode, receiving the bit stream sent by the host, converting it to a single-ended signal, and receiving it through the slave’s UART RXD line. When the slave is ready to respond, it sends data back to the host in the same manner, while the host switches to receive mode.
【Conversion Between RS-232 and RS-485】
Conversion between RS-232 and RS-485 can be done in several ways, one method being to convert RS-232 to TTL, and then from TTL to RS-485. There are also chips that support direct conversion from RS-232 to RS-485, and many modules are available online.
【Differences Between RS-485 and CAN】
Although RS-485 does not have a standard data protocol format, it shares similarities with the CAN bus in many respects, such as A&B and CANH&CANL both being differential signals, both requiring transceivers, and both needing 120-ohm matching resistors, etc.

Here is a common RS-485 circuit found online, with two points to note:
1. The enable signals RE and DE can be controlled by a single GPIO to save resources. When GPIO25 outputs high, RE=DE=0V, entering receive mode; when GPIO25 outputs low, RE=DE=3.3V, entering send mode.
2. Some circuits may add pull-up on A and pull-down on B. The main reason is that the RS-485 bus has an undefined level in idle state, fluctuating between -200mV and +200mV. The transceiver may output high or low. If the transceiver outputs a low level when the UART is idle, it will be interpreted as a start bit, causing communication errors. The values of Ru and Rd will not be elaborated here; I will write a detailed article about them later.
Regarding the second point, please note:
① Adding a pull-up on A and a pull-down on B may lead to communication errors if connected incorrectly.
② Some transceivers have integrated pull-up and pull-down resistors, eliminating the need for external additions.
This concludes today’s article. I hope it is helpful to you. See you next time!
Author:Remember Cheng, Source: Remember Cheng
Disclaimer: This article is reprinted with permission from “Remember Cheng” public account. The reprint is for learning reference only and does not represent this account’s endorsement of its views. This account does not bear any infringement liability for its content, text, or images.