Skip to content

RS-485 Protocol

Published On:
Oct 19, 2015
Last Updated:
Oct 10, 2024

Recommended Standard 485 (RS-485) is a differential, multi-drop, half-duplex, two-wire communication protocol. It was formally specified in 1983 by the Electronics Industries Association (EIA).

A typical RS-485 network setup, using a standard RS-485 to UART transceiver at each node (in this case it is the TI SN65HVD72). Image from http://www.ti.com/.

It is a very common protocol used in industry for between-room control system to sensor communication.

PropertyValue
NameRS-485
Drive ModeDifferential
Multi-dropYes
DuplexityHalf-duplex
Max. Data Rate10Mbps
Max. Bus Length1.22km (@ 100kbps)

It is not commonly used for intra-board communication (i.e. between two devices on the same PCB) because in these scenarios there is normally no need for the noise immunity and transmission distances RS-485 provides, and communication protocols such as UART, SPI and I2C are more prevalent.

A common and cheap way to implement RS-485 are to use half-duplex transceivers. Examples are the SP485 (cheap), or the SP4082 (slightly more expensive, but with slew-rate limiting and ESD protection).

Some of the receivers have slew-rate limiting to reduce emissions, at the cost of having a lower maximum data rate (typically around 250kbps). Some also have built-in human body ESD protection (15kV), so you don’t have to add external TVS diodes (which normally validates the increase in price you pay for the chips with this feature).

Standards

The TIA/EIA 485 standard governs the RS-485 protocol specifications.

The RS-485 standard only defines the electrical specifications of the interface, and does not specify the type of connector to be used, the cable, the pinout, or the messaging protocol/data structure.

Thus, the RS-485 can be incorporated into higher-level standards which specify things such as the messaging protocol, and use RS-485 to define the physical layer.

Transmission Distances

Because RS-485 is a differential communication protocol, it can achieve far greater communication distances than say, UART, I2C or SPI.

A distance of 1.22km (4000 feet) is achievable at a data rate of 100kbps.

Baud Rate

RS-485 transceivers usually top out at about 50-100Mbps.

Node Count

Higher baud rate transceiver ICs usually support a lower number of total nodes on the RS-485 bus.

RS-485 introduces the term unit load. A unit load is a specified load impedance on the RS-485 bus. Transceivers are rated by the equivalent unit loads of impedance they introduce when connected to the bus.

Unit LoadNo. of NodesMin. Receiver Input Impedance
13212kΩ12k\Omega
12\frac{1}{2}6424kΩ24k\Omega
14\frac{1}{4}12848kΩ48k\Omega
18\frac{1}{8}25696kΩ96k\Omega

Termination Resistors

The TIA/EIA 485 standard does not specifically state what the characteristic impedance of the twisted-pair cable should be, nor the value of the termination resistors. However, it does provide recommendations, and states that the twisted-pair cable should have a characteristic impedance of 120Ω120\Omega whenever possible.

This implies that 120Ω120\Omega termination resistors should be used with this twisted-pair cable. Termination resistors of 120R connected between the two differential lines work well at reducing reflections along long cables.

Receiver Hysteresis

Receiver hysteresis is normally around 80mV.

Standard Pinout

There is somewhat of a standard pinout for RS-485 transceivers in 8-pin component packages. This is a placeholder for the reference: tbl-rs-485-transceiver-pinout lists this pinout.

Pin NumberPin NamePin Description
1R, ROReceiver data output.
2nRE, RE*Active-low receiver out enable.
3DEActive-high RS-485 line driver enable. When high, the IC will be driving the RS-485 A and B wires, when low the A and B pins are put into high-impedance and the IC acts as a RS-485 receiver.
4D, DIDriver data input. If the driver outputs are enabled (DE high), then a low on DI drives A low and B high, while a high on DI drives A high and B low.
5GNDGround.
6ARS-485 differential line A.
7BRS-485 differential line B.
8VCCV_{CC}Supply voltage.
Pinout for an typical 8-pin RS-485 transceiver component.

8-pin packages that RS-485 transceivers come include DIP-8, SOIC-8, TSSOP-8 and MSOP-8. Example transceivers that follow this “standard” include the Texas Instruments DS485, Linear Technology LTC1480.

Higher-Level Protocols

Do you need a higher-level communication protocol that works over a UART connection? See the SerialFiller library on GitHub (written in C++). SerialFiller uses a publish/subscribe mechanism and works well on point-to-point serial connections such as UART.

PROFIBUS can use RS-485 as it’s physical layer.

Differential Voltage Specs

The RS-485 specification states that the transmitter must produce a differential voltage of at least ±1.5V when loaded, and the receiver must receive a differential voltage of at least ±200mV.

The waveform in This is a placeholder for the reference: fig-typical-rs-485-a-b-waveforms-during-communication shows the voltage on the A and B nets of a RS-485 bus when operating normally at 115200 baud.

The typical appearance of the voltages on the A (top) and B (bottom) nets of a RS-485 bus under normal operating. This was operating at 115200 baud.

The standard also states that the driver is not allowed to produce a differential voltage of more than ±6V.

Common-Mode Voltage

Most transceivers can withstand a constant single-ended voltage of around ±15V on each of the A and B wires (the allowed transient voltage can be much higher).

Specialised TVS Diodes

Dedicated TVS diode components exist for voltage-spike suppression on RS-485 data lines.

They usually are a bidirectional TVS diode (or diode array) with asymmetric breakdown voltages, that match the maximum voltage specifications of +12V and -7V for RS-485 data lines.

The +12V and -7V limits arise from the section of the RS-485 spec which states that up to a 7V ground difference is allowed between any two devices on a RS-485 bus. This, coupled with the spec that allows a single-ended voltage range of 0-5V to be applied to either of the bus nets, gives a possible voltage range of +12V (7V + 5V) to -7V (-7V + 0V).

One such example is the Semtech SM712 diode array. This is a placeholder for the reference: fig-sm712-tvs-diode-array-designed-for-rs-485-data-lines shows the internal schematic of the component.

The SM712 TVS diode array, a diode array with asymmetric breakdown voltages, specifically designed for protecting RS-485 data lines. Image from http://www.semtech.com/.

Sleep Modes

Some RS-485 transceivers support sleep modes. For example, the National Semiconductor DS36C279 enters a sleep mode when both the driver and receiver are disabled (600ns after both are disabled). In sleep mode, the quiescent current is reduced to 10uA (max.)1.

SAE J1708

SAE J1708 is a communications protocol standard introduced by SAE in 1986. It was intended to be used for serial communications between ECUs on heavy duty vehicles. Today, the CAN Bus protocol is usually used instead of SAE J1708.

The hardware used for SAE J1708 is usually a RS-485 transceiver that is wired for open collector operation. Transmission of bits is done through controlling the driver enable pin of the transceiver (rather than using the data in (DI) pin, which is used during normal RS-485 operation).

A standard RS-485 transceiver with a modified bus connection to provide open collector (wired OR) arbitration for the SAE-J1708 bus. Image adopted from content found at http://www.ti.com/lit/an/snla038b/snla038b.pdf.

The receiver is always enabled (RE* pin connected to ground) so that the bus state can be checked on every attempted write of a bit. The bus state needs to be compared with the intended write bit, if they are different, another node is also writing on the bus and this bus has lost arbitration.

The modification to RS-485 essentially allows you to operate a multi-master (multi-point) configuration.

Fail Safe Biasing

In the standard configuration, the RS-485 bus is in an undefined state when there are no active transmitters2. This can be a problem in certain scenarios.

RS-485 vs CAN Bus

The RS-485 and CAN bus are both protocols that tick many of the same boxes when you are thinking about a multi-drop, differential communications protocol for a application. So which one should you use?

RS-485 does not have built-in arbitration, while CAN does (it’s built into the CAN peripherals that typically reside inside MCUs). Using a CAN bus, you get arbitration and error detection “for free”, in the sense that you don’t have to implement it yourself. With RS-485, you either have to implement a protocol that side-steps arbitration (i.e. designate one device as a master that decides when other nodes can transmit), or implement arbitration yourself in the application layer. This means that you need to keep the RX on while the TX is on, and inside the application check to see if they agree with each other. If not, a collision has occurred and you need to implement logic to handle this.

The error detection built into the CAN bus protocol means that nodes will automatically back off if they sense bus errors, in an attempt to prevent the bus from being “locked up” by a single faulty node. Again, if you want this sort of functionality in RS-485, you are going to have to implement it yourself.

Although both buses don’t specify how the “data” is structured (it’s up to the application layer to define this), CAN does specify the structure of an ID field which is sent at the start of every message. This field is used for arbitration, and most applications also use this field to include the ID of the sender and/or receiver. The CAN bus also puts a limit on the max. number of bytes per message, being 8 for standard messages and 64 for extended messages. RS-485 does not have a max. limit on the number of bytes per message (nor does it have a concept of a message, you could just stream bytes continuously if you want).

Due to the extra complexity of a CAN peripheral, using a CAN bus will typically be most expensive than using a RS-485 bus. This might be a consideration for high-volume, cost-sensitive products.

Footnotes

  1. National Semiconductor (2000, Jul). DS36C279 - Low Power EIA-RS-485 Transceiver with Sleep Mode [datasheet]. Retrieved 2024-10-10, from https://www.farnell.com/datasheets/309392.pdf.

  2. Texas Instruments (2013, Apr). AN-1057: AN-1057 Ten Ways to Bulletproof RS-485 Interfaces. Retrieved 2024-10-10, from https://www.ti.com/lit/an/snla049b/snla049b.pdf.