{"id":1514,"date":"2014-09-11T10:08:36","date_gmt":"2014-09-11T10:08:36","guid":{"rendered":"https:\/\/ibex.tech\/resources\/?p=1514"},"modified":"2022-02-18T15:05:16","modified_gmt":"2022-02-18T15:05:16","slug":"can-vs-rs485","status":"publish","type":"post","link":"https:\/\/ibex.tech\/resources\/geek-area\/communications\/can-bus\/can-vs-rs485","title":{"rendered":"CAN vs RS485"},"content":{"rendered":"<p>\nCAN (Controller Area Network) and RS485 are both popular standards in fieldbus systems.\n<\/p>\n<p>\nRS485 only addresses layer 1 (the physical layer)\n<\/p>\n<p>\nCAN also adds layer 2 (the data link&nbsp;layer) in the OSI model.\n<\/p>\n<p>\nBoth 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. &nbsp;Both offer similar speeds of operation based on cable length. Indeed the cabling requirement and termination requirement is the same \/ very similar.\n<\/p>\n<h4>\nRS485<br \/>\n<\/h4>\n<p>\nRS485 is not a protocol, it only provides the basic rules&nbsp;and the physical link for data&nbsp;exchange to&nbsp;enable the transmission of serial messages using a multi-drop bus.\n<\/p>\n<p>\nThe 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).\n<\/p>\n<p>\nImplementing CAN bus on a microcontroller&nbsp;can be a real pig of a job to get right and fully debug. &nbsp;Implementing RS485 based protocols is usually pretty easy and quick, and if you don&#39;t like any of the existing protocols out there just roll your own!\n<\/p>\n<p>\nRS485 is easy to add to virtually any embedded or general computing device as it just uses a low cost transceiver IC connected&nbsp;to a UART (TX and RX pins).\n<\/p>\n<p>\nVery easy to debug using an osciliscope&nbsp;or logic analyser.\n<\/p>\n<p>\nMax transmission rate 10Mbits (up to 12m)\n<\/p>\n<p>\nMax bus length 1200m&nbsp;(at 100kbps)\n<\/p>\n<h4>\nCAN bus<br \/>\n<\/h4>\n<p>\nIts easy to buy off the shelf CAN bus equipment and ready made cabling.\n<\/p>\n<p>\nImplementing 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. &nbsp;However once you&#39;ve done it communicating with new equipment is pretty easy.\n<\/p>\n<p>\nCAN bus has a lot of fault tolerance built in &#8211; it is very good for fault tolerant \/ handling system design.\n<\/p>\n<p>\nA 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.\n<\/p>\n<p>\nCAN bus deals with collisions where multiple devices all want to send data at once.\n<\/p>\n<p>\nLimited data permitted per frame.\n<\/p>\n<p>\nMax transmission rate 1Mbits (up to 50m)\n<\/p>\n<p>\nMax bus length 1600m (at 50kbps)\n<\/p>\n<h4>\nWhich Is Best?<br \/>\n<\/h4>\n<p>\nRS485 is very simple to implement, very robust from a data integrity as it crosses the wire point of view and very versatile.\n<\/p>\n<p>\nCAN 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. &nbsp;CAN is not so suited to applications where large&nbsp;blocks of data need to be passed.\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&nbsp;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. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,95],"tags":[],"class_list":["post-1514","post","type-post","status-publish","format-standard","hentry","category-can-bus","category-rs485"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/comments?post=1514"}],"version-history":[{"count":8,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1514\/revisions"}],"predecessor-version":[{"id":1523,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/1514\/revisions\/1523"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/media?parent=1514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/categories?post=1514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/tags?post=1514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}