CAN vs RS-485: why CAN interface is gaining popularity

Industrial Automation Experts
7 min readJan 27, 2021

--

Both RS-485 and CAN interfaces have been around since the mid-1980s. For a long time, each of them was developing on its own without affecting each other. But as time passed, the situation changed. But why? The history of CAN interface application and its operation principle will help us to understand.

A brief overview of the history of the development of the CAN interface

After the physical layer standards RS‑423, RS‑422 and RS‑232, the emergence of the RS‑485 interface was a new evolutionary stage. RS‑485 communication systems began to support multipoint connection of up to 32 transceivers, and with repeaters, up to 256 transceivers. Serial interfaces have found their application in computing and industrial automation.

Around the same time, the CAN interface emerged, which was first developed as an automotive communication platform. It was proposed by Robert Bosch, the owner of Robert Bosch GmbH, to reduce car manufacturing costs. The CAN bus became an alternative to traditional thick multi-core automotive cables and simplified their routing thanks to the use of multi-node buses.

In 1986, the BMW‑850 with the CAN interface was introduced, eliminating a total of 2 km of different wires! Also, the number of connectors was significantly reduced. It is estimated that this reduced the weight of the car by 50 kg.

Gradually, the RS-485, initially intended for the industrial market, began to find use in the car manufacturing industry, and CAN, on the contrary, started to gain popularity in the industrial sector.

How CAN and RS‑485 work

To compare the advantages of CAN over RS‑485, let us look at the similarities and differences between the two standards ISO 11898–2–2016 and ANSI TIA/EIA‑485‑A. Both standards define the levels of transceivers. Below are the diagrams for the transmission side.

Both protocols have a differential output signal.

The RS‑485 output is a differential signal where one signal is inverted or is a mirror image of the other. Output A is a non-inverting line and Output B is an inverting line. Differential voltage range +1.5… +5 V is equal to logical 1, and the range –1.5… –5 V is equal to logical 0. A signal with a level in the range –1.5… +1.5 V is considered undefined. It is important to note that when RS‑485 is not in use, its output is in a high impedance state.

The CAN bus has a slightly different differential output. There are two outputs — CAN_High and CAN_Low, which are an inversion of each other and represent inverted logic. In the dominant state, CANH-CANL is defined as 0, if the differential voltage across them is +1.5 … +3 V. In the recessive state, the signal is defined as logic 1, if the differential voltage is in the range of –120 … +12 mV or is near zero.

standard determines the presence of an input signal if it is within ±200 mV … 5 V.

As for CAN, the input differential signal +900 mV … +3 V determines the dominant state, and the recessive state is in the range of –120 … +500 mV. When the bus is in standby mode, or when the bus is not loaded and the transceiver is in a recessive state, the voltage on the CANH and CANL lines should be between 2–3 V.

As you can see, both RS‑485 and CAN have a technological margin for voltage recognition levels in case of signal attenuation due to cable quality, its length and external interference.

Both standards have 120-ohm termination resistors at the beginning and end of the line. They are needed to match the impedance of the communication line to avoid signal reflection.

For the CAN bus, the maximum network length is inversely related to the baud rate due to error detection methods. The higher the speed, the shorter the network length should be.

The signal voltage can increase or decrease due to the power supply of the nodes with different power sources and various pickups on the transmission cables. The microcircuits have some resistance to the CMR (Common-Mode Range) voltage range: for RS-485 it is –7… +12 V and for CAN –2… +7 V. In new-generation transceivers, this range has been expanded to ±25 V.

In addition to the capacity to operate at a higher voltage, the microcircuits are protected against overvoltage spikes, electromagnetic interference and short circuit.

CAN bus data format

In a multi-node RS-485 system, there may be cases where several messages are sent simultaneously, leading to collisions and data errors. The CAN bus solves this problem by ranking each message in the arbitration field.

Each controller is assigned a priority in the arbitration field. When several controllers start simultaneously transmitting a CAN frame to the network, each of them compares its own bit with the bit that the competing controller is trying to transmit to the bus. If the bit values are equal, then the controllers transmit the next bit. And this happens until the values of the bits are different. The controller that transmitted a logic zero (higher priority signal) will continue to transmit, while others will interrupt their transmission until the bus is free again. Of course, if the bus is currently busy, the controller will not start transmitting until it is free.

An example of arbitration during identifier transfer.

Data in CAN is transmitted in short message frames of a standard format. There are four types of messages in CAN:

· Data Frame — transmits data.

· Remote Frame — used to request the transmission of a data frame with the same identifier.

· Error Frame — transmitted by a node that detects an error in the network.

· Overload Frame — provides the gap between data or request frames.

Data Frame is the most commonly used message type. It consists of the following main parts:

Data transmission frame format in the CAN protocol explained in detail:

Error handling

The CAN protocol defines five ways to detect network errors:

· Bit monitoring;

· Bit stuffing;

· Frame check;

· ACKnowledgement Check;

· CRC Check.

Bit monitoring — during the transmission of bits to the network, each node compares the value of the transmitted bit with the value of the bit that appears on the bus. If these values do not match, the node generates a Bit Error. Naturally, during the transfer of the arbitration field to the bus, this error checking mechanism is disabled.

Bit stuffing — when a node transmits five bits with the same value sequentially to the bus, it adds the sixth bit with the opposite value. Receiving nodes remove this extra bit. If a node detects more than five consecutive bits with the same value on the bus, it generates a Stuff Error.

Frame Check — some parts of a CAN message have the same meaning in all message types. This means that CAN protocol defines exactly which voltage levels and when they should appear on the bus. If the message format is violated, the nodes generate a Frame Error.

ACKnowledgement Check — each node, having received the correct message on the network, sends a dominant 0 bit to the network. If this does not happen, then the transmitting node registers an Acknowledgment Error.

CRC Check — each CAN message contains a CRC checksum, and each receiving node calculates the CRC value for each message received. If the calculated CRC value of the checksum does not match the CRC value in the message body, the receiving node generates a CRC Error.

Higher-layer protocols and addressing

There is no explicit addressing of messages and nodes in CAN. CAN does not specify that Identification field + RTR should be used as a message or node identifier. Thus, message identifiers and host addresses can be in any field of the message: in the arbitration field, in the data field, or both.

The processing of the arbitration field, the data field, and the allocation of host addresses in the network are handled by the Higher Layer Protocols (HLP). The name reflects the fact that the CAN protocol describes only two lower layers of the OSI network model: physical and data link, and the remaining layers are described by HLP protocols.

There are many higher-layer protocols. The most common ones are:

· DeviceNet

· CANopen

· J1939

· SDS

· CanKingdom

So why is the current trend towards CAN bus?

In point-to-point systems or in ones with a small number of devices, it is often more convenient to use the RS-485 interface due to its simplicity.

However, in multi-node systems with potential collisions, CAN has a distinct advantage, especially when organizing communication in harsh industrial environments, in a wide range of operating temperatures and with a high level of external influences.

With CAN capabilities such as arbitration, error message checking, hard real-time capability and a larger data field, it is easy to understand the superiority of CAN over RS-485 in the industrial automation market.

--

--

Industrial Automation Experts
Industrial Automation Experts

Written by Industrial Automation Experts

Community of Industry 4.0 enthusiasts. Discussion of innovations in the field of industrial automation and digitalization, IIoT (Industrial Internet of Things)

No responses yet