CAN (Controller Area Network) and RS485 are both popular standards in fieldbus systems.

RS485 only addresses layer 1 (the physical layer)

CAN also adds layer 2 (the data link layer) in the OSI model.

Both are based on multiple nodes connected to a shared serial bus with one or more acting as a master being possible. Both offer good interference rejection and cable distance if good quality cabling and connectors are used.  Both offer similar speeds of operation based on cable length. Indeed the cabling requirement and termination requirement is the same / very similar.

RS485

RS485 is not a protocol, it only provides the basic rules and the physical link for data exchange to enable the transmission of serial messages using a multi-drop bus.

The message content (the bits on the bus) is completely user defined. This is an advantage in terms of simplicity, but when its comes to compatibility it is both a disadvantage (no one single communication structure used) and an advantage (lots of protocols use it for different purposes).

Implementing CAN bus on a microcontroller can be a real pig of a job to get right and fully debug.  Implementing RS485 based protocols is usually pretty easy and quick, and if you don't like any of the existing protocols out there just roll your own!

RS485 is easy to add to virtually any embedded or general computing device as it just uses a low cost transceiver IC connected to a UART (TX and RX pins).

Very easy to debug using an osciliscope or logic analyser.

Max transmission rate 10Mbits (up to 12m)

Max bus length 1200m (at 100kbps)

CAN bus

Its easy to buy off the shelf CAN bus equipment and ready made cabling.

Implementing CAN bus on a low level microcontroller (e.g. in C without a nice fancy library) can be a real pig of a job to get right and fully debug.  However once you've done it communicating with new equipment is pretty easy.

CAN bus has a lot of fault tolerance built in – it is very good for fault tolerant / handling system design.

A CAN bus interface can only be provided in embedded devices which incorporate a CAN bus controller peripheral. However whilst not present on all embedded devices, many families offer versions incorporating it without a significant cost penalty.

CAN bus deals with collisions where multiple devices all want to send data at once.

Limited data permitted per frame.

Max transmission rate 1Mbits (up to 50m)

Max bus length 1600m (at 50kbps)

Which Is Best?

RS485 is very simple to implement, very robust from a data integrity as it crosses the wire point of view and very versatile.

CAN is much better from a higher level protocol point of view and its ability to handle faults and collisions, but is harder to implement in software if a high level library is not available for your platform.  CAN is not so suited to applications where large blocks of data need to be passed.

 

 

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

  1. sandeep verma

    2 years ago

    Very helpful content and explanation is very fantastic.

Comments

Your email address will not be published. Required fields are marked *