15
\$\begingroup\$

In comparing the physical layer of CAN and RS485, I am trying to find the advantages of either one over the other. I found out that they are quite similar. Both are good in terms of common mode rejection and both need protection against ESD and overvoltage. I found just one significant advantage of CAN over RS485 (regarding the physical layer) in which CAN has a fault tolerant mode which enables it to maintain the connection between CANbus nodes through just 1 data wire even though there is one data wire shorted or opened or both data wires are shorted together.

Away from collision avoidance and the message priority system that CAN has,

1. Does RS485 have the same fault tolerant mechanism?

2. Are there any other important advantages or differences between CAN and RS485 regarding the physical layer?

\$\endgroup\$
4
  • \$\begingroup\$ Maybe you could link to the CAB bus fault tolerance mode? \$\endgroup\$
    – Andy aka
    May 10, 2017 at 12:43
  • \$\begingroup\$ This pdf is talking about the fault tolerant feature of TJA1055T CAN transceiver. \$\endgroup\$
    – Macit
    May 10, 2017 at 12:48
  • 2
    \$\begingroup\$ The main difference is the bus arbitration of CAN, which means that the network topology is flexible and there is no need for a master to control traffic. In RS-485 there is no built-in mechanism to toggle who gets to send, meaning that RS-485 tends to end up in a star network topology centred around a master. This is dictated on the higher levels, but affects the physical level dramatically. \$\endgroup\$
    – Lundin
    May 18, 2017 at 11:15
  • 1
    \$\begingroup\$ Overall, there is really no reason to use RS-485 and other UART-based technologies today, unless you need some manner of backwards compatibility. One benefit used to be that all PC computers had UART, but that is no longer the case. \$\endgroup\$
    – Lundin
    May 18, 2017 at 11:18

2 Answers 2

22
\$\begingroup\$

When comparing the physical layer only, CAN and RS-485 are similar in that they both use differential signaling. This gives them both good common mode noise immunity.

The main difference is that RS-485 uses symmetric signaling. One line is 5 V and the other 0 V to signal one state, then flipped to 0 V and 5 V for the other state. This makes detecting the state very easy (a simple comparator, maybe with a little hysteresis), but presents a challenge in terminating the bus.

If you think the twisted pair carrying the signals has 120 Ω characteristic impedance, then ideally you want to put 120 Ω between the two lines. That would be 60 Ω total between the two lines. (5 V)/(60 Ω) = 83 mA. That's a lot of current for the bus, and would be drawn all the time. That comes out to nearly half a Watt quiescent power. Note that each 120 Ω terminating resistor would dissipate 208 mW, which means they'd have to be "¼ W" resistors minimum. 0805 surface mount, for example, need not apply.

Probably due to these considerations, the terminating requirements for RS-485 are somewhat relaxed. That results in a reduced usable bus speed. That's OK for most RS-485 applications since they typically run at common baud rates, rarely above 115.2 kBaud.

CAN on the other hand address termination properly. It assumes 120 Ω twisted pair is used for the different signals, and specifies 120 Ω terminating resistance at each end of the bus. There are then two important differences to avoid the problems described above:

  1. The quiescent state is undriven, meaning the lines are held at the same voltage by the terminating resistances.

  2. The active bus state (called the dominant state in the CAN spec) is each line pulled only 900 mV from the idle level. The two states are therefore 0 V or 1.8 V differential, not 5 V and -5 V like RS-485.

The power to keep a CAN bus in the dominant state is only 54 mW, and none at all to keep it in the recessive (idle) state. CAN is intended for speeds up to 1 Mbaud, made possible by better termination than RS-485.

Another major difference between CAN and RS-485 already alluded to is that RS-485 is actively driven to both states, while CAN is only ever driven to the dominant state, with the bus itself relaxing to the recessive state. This makes a significant difference at higher protocol levels to bus arbitration.

So what to use? CAN is the clear choice for new designs in most cases because:

  1. The low level signaling 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 some other node is driving the bus. 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.

  2. This collision detection capability allows for peer to peer network architectures without any central arbitration. Nodes simply send messages, but back off when 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.

  3. CAN specifies much more than just the physical layer, whereas that's all you get with RS-485. There is no standard way in RS-485 to decide who gets to send, what is being sent, how to know it got there intact, etc. CAN specifies complete packets on the bus, which include a 16 bit CRC checksum.

  4. Since several protocol layers above the physical are specified with CAN, the logic to implement them can be built into off the shelf hardware. You can find small and cheap micros with hardware that sends and receives whole CAN packets. This hardware automatically takes care of packet start/end detection, collision detection, back off, retry, checksum generation and verification, and a few more capabilities related to dealing with hardware faults.

    In contrast, with RS-485 you get a UART and the rest is your problem. While it is certainly possible to implement a robust protocol above RS-485, it's not as easy to get all the corner cases right as naïve engineers think.

One limitation of CAN that may require work around for some applications is the limit of 8 data bytes per packet. This is also a good thing for the collision/retry mechanism, but is something you have to consider if you intend to pass streaming data over CAN. However, doing the same with RS-485 isn't as trivial as it might appear at first glance either.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ "Probably due to these considerations, the terminating requirements for RS-485 are somewhat relaxed. That results in a reduced usable bus speed." I don't know exactly what you mean by saying that but RS485 can achieve a bit rate up to 10Mbit/s which is 10 times higher than what CAN could afford. \$\endgroup\$
    – Macit
    May 10, 2017 at 14:11
  • \$\begingroup\$ What about the fault tolerant mechanism? Does RS485 have such a feature? \$\endgroup\$
    – Macit
    May 10, 2017 at 14:12
  • \$\begingroup\$ @Maj: For short lengths, RS-485 can go fast. However, if a typical twisted pair transmission line is used, the ends will not be terminated properly. \$\endgroup\$ May 10, 2017 at 14:39
  • 1
    \$\begingroup\$ Please correct your answer: "5 V and -5 V like RS-485.". This is wrong. The common mode voltage range for RS485 is -7 to +12V, eg. ±7 on top of 0-5V signal range \$\endgroup\$ Mar 31, 2023 at 22:17
  • \$\begingroup\$ I have a question that I've posed as a comment below : why didn't RS485 go with an undriven quiescent state? Any ideas? \$\endgroup\$
    – Milind R
    Oct 6, 2023 at 10:36
-1
\$\begingroup\$

RS485 uses +/- 400mV not 0-5V so the termination resistor is smaller wattage than CAN bus. There is an advantage that many (everyone) seems to miss. Because RS485 is actually bidirectional around 0V ie it must be a full H bridge, this means current flows one way or the other. It's not about the voltage levels but the actual current direction. So this differs from CAN where you are effectively looking at 2 different signals relative to GND. You want to see that there is this 2.5V level RELATIVE to GND and that these two lines are at the same voltage relative to GND or that one is above and one is below 2.5V relative to GND.

These are two very different things. CAN only works when there is a GND to refer to, so GND has to follow the signal everywhere. This means that if you want to use isolated CAN then you need that GND reference.

Now RS485 is basically an AC drive out of a H bridge, the electrons flow one way or the other, what the voltage relative to GND is totally irrelevant. the voltage is not being compared to GND, it's the direction of the electrons flow that is being looked at, so you do not need a GND. This means that in situations where you want to join two systems together that do not share a ground or you don't need to then it's fine and where grounds are not common but differ, it's fine because the measurement is not relative to GND and taking it out means that isolation can be avoided where CAN would require it.

The main reason to use CAN is that providing you don't use the same ID for two devices no device needs to know about any other device and devices can just be added to the bus.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Sorry but this is just wrong. RS-485 output between 1.5V to 6.0V is allowed, and receiving side requires +/- 200mv. So a 120 ohm termination resistor must handle 0.3W. CAN bus standard says 0.25W, unless you want to handle short circuits to battery voltage. And RS-485 is about voltage levels, not current direction. Both RS-485 and CAN are differential buses and they both require common ground between tranceivers, RS-485 can just handle more common-mode voltage than CAN. The difference is relevant and RS-485 bus voltages at the receiver must be between -7 and +12V compared to local ground. \$\endgroup\$
    – Justme
    Aug 21, 2022 at 20:05
  • 1
    \$\begingroup\$ Yes the differential output can be as high as 5V (+/-2.5V) but the was these two busses work is quite differently. CAN creates a virtual ground around the 2.5V, this is why many circuits actually split the 120 ohms into 2 and put a capacitor there to try and hold that point. So there is a positive and negative voltage or differential drive relative to that 2.5V not ground. RS485 is differential to ground which means it must be true push pull and ground becomes irrelevant as it's voltage polarity you measure not magnitude. \$\endgroup\$
    – Mr T
    Aug 23, 2022 at 18:15
  • 1
    \$\begingroup\$ You can split the termination of RS-485 in same way as CAN does. And you can run RS-485 using transmitter enable to make it simulate differential open drain like CAN. And you can bias RS-485 idle near 2.5V with fail-safe biasing, as long as the differential exceeds the logic 1 threshold of 200mV at all times. RS-485 has hysteresis so magnitude of either polarity must exceed certain threshold. CAN just has larger threshold. I was not concentrating on how similar or different they are, just the false claims in your answer. \$\endgroup\$
    – Justme
    Aug 23, 2022 at 19:47
  • \$\begingroup\$ @Justme : Related to this, I am curious why RS485 did not choose to have an undriven state at 2.5V like CAN instead of mandating that the bus must read mark (logic 1) at idle? Then one could implement split-termination, do away with the fail-safe biasing, and say the signals are either 0, 1 or idle. \$\endgroup\$
    – Milind R
    Oct 6, 2023 at 10:34
  • \$\begingroup\$ @MilindR Because it is a differential bus like CAN, the A-B differential voltage must be either more than +0.2V for valid logic level and less than -0.2V for other valid logic level, and range between -0.2V to +0.2V is undefined by standard. The A and B wires, when they are at equal potential, can be in range of -7V to +7V to ground. So, any voltage like your 2.5V bias is acceptable. So, it's the role of the application to use fail-safe biasing if it is relevant to the application. If CAN mandates such a DC bias then it's not up to the application. CAN levels are >0.9V and <0.5V so same thing. \$\endgroup\$
    – Justme
    Oct 6, 2023 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.