<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Arduino MKR CAN Shield Review - part 1: Log BUS Traffic</title><link>/products/arduino/b/blog/posts/arduino-mkr-can-shield-review---part-1-log-bus-traffic</link><description>I&amp;#39;m trying out CAN communication with the Arduino MKR CAN Shield. I have a CAN bus test setup in the lab, with two DIY CAN drivers .If all is OK, I should be able to write firmware and plug the Arduino CAN shield onto that BUS.It can then snoop t...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Arduino MKR CAN Shield Review - part 1: Log BUS Traffic</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mkr-can-shield-review---part-1-log-bus-traffic</link><pubDate>Tue, 25 Jun 2019 09:22:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f6baade8-12b8-4167-ac90-49df371a5db4</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;ve been testing &lt;a class="jive-link-external-small" href="https://github.com/sandeepmistry/arduino-CAN/blob/d0ff8a85bb17b77ecf57a957edb66c0485fe7882/src/MCP2515.cpp" rel="nofollow ugc noopener" target="_blank"&gt;Sandeep Mistry&amp;#39;s CAN library&lt;/a&gt; further. It supports interrupts with CAN receive, and hardware filtering.&lt;/p&gt;&lt;p&gt;The interrupt functionality works nicely. You can make the Arduino sleep, and the CAN device will wake it up when receiving data..&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have difficulties with the filter though. The CAN controller (Microchip MCP2515) allows you to set a filter.&lt;/p&gt;&lt;p&gt;When you do that, the microcontroller is only contacted when there&amp;#39;s a message that it is interested in.&lt;/p&gt;&lt;p&gt;On a CAN bus, where there can be a lot of traffic, this is useful. You don&amp;#39;t have to triage through noise to find the data that&amp;#39;s intended for you.&lt;/p&gt;&lt;p&gt;But (further investigation needed) the library does not work as I expect it. It sets the filter registers of the CAN chip but the scope of the filter doesn&amp;#39;t seem to match the API.&lt;/p&gt;&lt;p&gt;I am trying now on lower level, setting the registers in my own code, and that gives the expected results.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If it turns out to be a bug in the library, I&amp;#39;ll fork it on github, try to fix it and contribute back to the original lib as a pull request.&lt;/p&gt;&lt;p&gt;If it is my understanding of the lib that&amp;#39;s wrong (a more likely scenario), I&amp;#39;ll post back on it here.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7308&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino MKR CAN Shield Review - part 1: Log BUS Traffic</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mkr-can-shield-review---part-1-log-bus-traffic</link><pubDate>Wed, 19 Jun 2019 00:46:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f6baade8-12b8-4167-ac90-49df371a5db4</guid><dc:creator>gam3t3ch</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Great stuff thanks for sharing! &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7308&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Arduino MKR CAN Shield Review - part 1: Log BUS Traffic</title><link>https://community.element14.com/products/arduino/b/blog/posts/arduino-mkr-can-shield-review---part-1-log-bus-traffic</link><pubDate>Tue, 18 Jun 2019 20:44:26 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f6baade8-12b8-4167-ac90-49df371a5db4</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The example here is useful to stream everything published on a bus.&lt;/p&gt;&lt;p&gt;When you&amp;#39;re implementing a real can device, it&amp;#39;s worth checking out the &lt;a class="jive-link-external-small" href="https://github.com/sandeepmistry/arduino-CAN/blob/master/API.md" rel="nofollow ugc noopener" target="_blank"&gt;library API&lt;/a&gt; for the &lt;a class="jive-link-external-small" href="https://github.com/sandeepmistry/arduino-CAN/blob/master/src/MCP2515.cpp" rel="nofollow ugc noopener" target="_blank"&gt;filter function&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This functionality tells the CAN device to only react to agreed messages. &lt;strong&gt;Hardware&lt;/strong&gt; is filtering messages for you. It takes care that the microcontroller never has to react on (or wake up on) non-relevant packages.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7308&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>