RS-485 and CAN both happen to be serial communication protocols; they allow multi-drop device arrangement in a single system, considerably cut down cable lengths, are designed to be used in electrically noisy environments, both are terminated using 120 ohms resistance and are equipped with internal over voltage circuit for fault protection. Both RS-485 and CAN have too much in common but undoubtedly are not the same.
As RS-485 was introduced for industrial machinery, CAN was extensively designed to be used in the automotive industry. But now, not only does the automotive industry extensively puts CAN to use, but other industries like aerospace, machinery etc., have started switching to CAN.
There is much to discuss and know about what difference makes CAN so superior in terms of communication that it is preferred over RS-485, which shall be discussed in this article?
But to understand the difference that makes these protocols stand apart, we must know what exactly these are. Though we have already covered CAN in our various articles, we will still discuss it to better understand it compared to RS-485. Also, all the links for other explanatory articles will be shared at the end. And for RS-485, let's begin to understand it better.
RS-485: A Serial Communication Protocol that has been around since the mid-1980s was initially defined for application in the industrial market, or still better to say, it was developed for industrial applications. RS-485 was jointly published by Telecommunication Industry Association and Electronic Industries Alliance, for so it is also known as TIA/EIA-485. But the more industry acceptable name is RS-485, and it finds application in:
Motion control equipment.
Interface for rotary encoders.
Computer automation systems (keyboards, mice, printers etc.).
Industrial control systems.
Theatre applications.
Programmable logic controllers. Or it can be said it was engineered to be used in most applications requiring serial interfaces.
A maximum of 32 transmitter-receiver pairs can be connected on the RS-485 line (at one time).
Defines point-to-point communication of electrical devices.
Supports differential transmission with low electromagnetic emission.
Functions as a balanced interface.
But, despite these significant features, more and more industries seem to switch to CAN to be used in their industrial machinery.
Why 'the switch' to CAN BUS?
RS-485 has failed to become a communication protocol; it has merely proven to be an electrical interface. It does provide a multi-drop communication capability but only for devices with at least one UART. Technically, it is a half-duplex system; only one device can transmit at a time, and the other devices have to listen. Thus, it can only provide the basic physical link for data exchange for multiple nodes serially.
Unlike CAN, where every node behaves as a master and knows precisely how and when to send the signal, RS-485 follows a typical master-slave topology. When communication is active, all the slaves/nodes receive the data transmitted by the master unit. And if a 'slave' has to answer, it works like a 'master' and sends its message. A peculiar feature of this connection is that all devices connected to the line receive everything passing on; when an element has to transmit, it activates its transmission line through an RTS signal (transmission request). The element which transmits the data receives the transmitted data, too.
With Rs-485, this is not the only drawback. There is no clarity in terms of defining:
The process for addressing the nodes
Method to avoid data collisions.
Frame structure
Communication procedure
Error detection etc.,
Not only this, one needs to enable and disable the transmitter at the correct time for proper communications and to avoid contention, which may not be practically possible; hence, several times, an RS-485 bus may have multiple messages sent out at the same time resulting overload or a possible collision; making the entire message invalid or causing data errors. This degrades the signal performance when multiple RS-485 transceivers on the bus are in one state and one single transceiver is in the opposite state, resulting in thermal shutdown or permanently damaging the system.
CAN protocol has effortlessly taken over RS-485's market segment. Even though these two might seem similar, RS-485 lacks many features that gave CAN the ability to become superior. As a result, the CAN bus seems to be replacing it in most industrial applications. CAN is not only fast, accurate and robust, but it has many other features that RS-485 has failed to offer.
3 Reasons Why CAN Bus Is Better -
The significant advantage here with CAN is that it is highly flexible and offers many unique features, leading to a substantial increase in its adoption by other industries.
CAN: By definition, a Controller Area Network is a two-wire, multi-drop, serial communication standard protocol. Just like RS-485, the signal through CAN flows on CAN high and CAN low as differential voltages. This may sound similar to RS-485, but that is not true. The features that have helped CAN become a real-time compatible solution are:
Message transmission: CAN specifies complete packets on the bus than just the physical layer. Here the hardware automatically takes care of packet's start/end detection, collision detection, back off, retry, checksum generation and verification, and a few more capabilities related to dealing with hardware faults. The user needs to transmit only the message identifier and the payload; a CAN controller adds the rest. Where RS-485 can only be implemented with UART (universal asynchronous receiver-transmitter). Also, with RS-485, nothing is defined, from where the data is coming, who gets to send it, what data is being sent, if the data received is not damaged, etc., nothing is known unless specified in the software.
Arbitration: The major problem in RS-485 is the congestion of signals. This is generally due to multiple nodes trying to send data simultaneously on the bus, resulting in overload. CAN follows arbitration, where the messages are prioritized and received in order of status. A node that loses arbitration will resend its message. This continues for all nodes until there is one node left transmitting. Due to message-wise arbitration, CAN enables multi-master operation without taking additional precautions. In the case of RS-485, this is only possible with a specific protocol, such as a token ring.
Collison and Error detection with correction: The low-level signalling allows for a collision detection scheme. When a node is "writing" the recessive state to the bus and sees it is actually in the dominant state, it knows another node is driving it. The node trying to write the recessive state backs off and waits for the end of the message. The node writing the dominant state never knows this happened. Its message is sent and received by all other nodes normally. This collision detection capability allows for peer-to-peer network architectures without any central arbitration. Nodes send messages but back off when a collision is detected, then retry after the current packet completes. Eventually, those other messages are sent, the bus is available, and the previously collided messages are sent without collision, including a 16-bit CRC checksum. RS-485 cannot trigger any message collisions; collision avoidance must be guaranteed with the application software.
CAN Vs RS-485
Conclusion:
Though RS-485 port is still added to many new-age technologies, CAN feature such as arbitration, error-message checking, improved bandwidth, and a larger data field have accelerated the demand for CAN bus, even in the industrial market. CAN is suitable for applications that require robust communications and reliability in harsh environments. Not only in the automotive industry, CAN port and compatibility can be found in many low-cost systems like drones, elevators, electronic sensors etc., these days. As CAN is not only cheaper, its various features like prioritizing the importance of frame messages and treating critical ones appropriately have given it a significant advantage over RS-485. CAN bus has drastically simplified the development and troubleshooting process at a larger scale, and at present, implementing CAN costs much less than implementing RS-485.
References:
https://www.maximintegrated.com/content/dam/files/design/technical-documents/white-papers/can-wp.pdf
https://www.cuidevices.com/blog/rs-485-serial-interface-explained
file:///C:/Users/IBDS/Downloads/13e06eed-25f0-4e15-8eb8-1c1bcf83806e_Manuale-Seriale-Modbus-ing.pdf
https://blog.protoneer.co.nz/wp-content/uploads/2014/03/artikel_20105_can-vs-rs485_e.pdf