<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Some comments on Arduino Dock and I2C communication]]></title><description><![CDATA[<p dir="auto">The only method to communicate between the Omega and the Arduino Dock is via I2C</p>
<p dir="auto">In <a href="https://wiki.onion.io/Tutorials/Arduino-Dock/Using-the-Arduino-Dock" rel="nofollow">https://wiki.onion.io/Tutorials/Arduino-Dock/Using-the-Arduino-Dock</a> it says:</p>
<ul>
<li>
<p dir="auto"><em><strong>Using I2C in a Sketch</strong></em></p>
<p dir="auto"><em>Right now the Onion Library joins the I2C bus with an address of 0x08 and listens for a write of 0xde 0xad (get it? 'dead' ha ha ha) when resetting. If you need a Sketch to use I2C, make sure to build this functionality into your I2C handling to comply with the Arduino Dock flashing procedure.</em></p>
</li>
</ul>
<p dir="auto">This has a few implications:</p>
<ol>
<li>
<p dir="auto">Since the Arduino can only join the I2C bus as a master (using <strong>Wire.begin()</strong>) or a slave (using <strong>Wire.begin(&lt;i2c-addr&gt;)</strong>) the above statement <strong>REQUIRES</strong> the Arduino to join the I2C bus as a slave using <strong>Wire.begin(0x08)</strong></p>
</li>
<li>
<p dir="auto">Since it is required from the above that the Arduino lists for a write from the Omega of <strong>0xde 0xad</strong> it is necessary to know what action the Arduino should take when it receives this message.</p>
<p dir="auto">From gleaning the code in <a href="https://github.com/OnionIoT/Onion-Arduino-Library/blob/master/Onion/OnionLibrary.cpp" rel="nofollow">https://github.com/OnionIoT/Onion-Arduino-Library/blob/master/Onion/OnionLibrary.cpp</a> it is found that the code to be executed on the Arduino on receipt of this message is:</p>
<p dir="auto"><strong><code>wdt_enable(WDTO_15MS);</code></strong></p>
<p dir="auto">It would be extremely helpful if this was described in the documentation.</p>
</li>
<li>
<p dir="auto">Because the Arduino <strong>HAS TO BE</strong> an I2C slave on address <strong>0x08</strong> as above, it is not possible for it to be an I2C master and control other I2C devices.</p>
<p dir="auto">This is not necessarily a big deal since the Omega can still use I2C to access any Arduino I2C shields that may be plugged into the Arduino Dock</p>
<p dir="auto">But again, it would be helpful if this was clear in the documentation</p>
</li>
<li>
<p dir="auto">Note that sending the <strong>0xde 0xad</strong> message from the Omega to the Arduino can be performed by the following call to the code in <a href="https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/lib/onion-i2c.c" rel="nofollow">https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/lib/onion-i2c.c</a> in the <a href="https://github.com/OnionIoT/i2c-exp-driver" rel="nofollow">https://github.com/OnionIoT/i2c-exp-driver</a> library:<br />
<strong><code>i2c_write(0, 0x08, 0xde, 0xad);</code></strong></p>
</li>
</ol>
]]></description><link>http://community.onion.io/topic/790/some-comments-on-arduino-dock-and-i2c-communication</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 20:10:23 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/790.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 May 2016 08:23:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Some comments on Arduino Dock and I2C communication on Thu, 19 May 2016 08:38:56 GMT]]></title><description><![CDATA[<p dir="auto">The only method to communicate between the Omega and the Arduino Dock is via I2C</p>
<p dir="auto">In <a href="https://wiki.onion.io/Tutorials/Arduino-Dock/Using-the-Arduino-Dock" rel="nofollow">https://wiki.onion.io/Tutorials/Arduino-Dock/Using-the-Arduino-Dock</a> it says:</p>
<ul>
<li>
<p dir="auto"><em><strong>Using I2C in a Sketch</strong></em></p>
<p dir="auto"><em>Right now the Onion Library joins the I2C bus with an address of 0x08 and listens for a write of 0xde 0xad (get it? 'dead' ha ha ha) when resetting. If you need a Sketch to use I2C, make sure to build this functionality into your I2C handling to comply with the Arduino Dock flashing procedure.</em></p>
</li>
</ul>
<p dir="auto">This has a few implications:</p>
<ol>
<li>
<p dir="auto">Since the Arduino can only join the I2C bus as a master (using <strong>Wire.begin()</strong>) or a slave (using <strong>Wire.begin(&lt;i2c-addr&gt;)</strong>) the above statement <strong>REQUIRES</strong> the Arduino to join the I2C bus as a slave using <strong>Wire.begin(0x08)</strong></p>
</li>
<li>
<p dir="auto">Since it is required from the above that the Arduino lists for a write from the Omega of <strong>0xde 0xad</strong> it is necessary to know what action the Arduino should take when it receives this message.</p>
<p dir="auto">From gleaning the code in <a href="https://github.com/OnionIoT/Onion-Arduino-Library/blob/master/Onion/OnionLibrary.cpp" rel="nofollow">https://github.com/OnionIoT/Onion-Arduino-Library/blob/master/Onion/OnionLibrary.cpp</a> it is found that the code to be executed on the Arduino on receipt of this message is:</p>
<p dir="auto"><strong><code>wdt_enable(WDTO_15MS);</code></strong></p>
<p dir="auto">It would be extremely helpful if this was described in the documentation.</p>
</li>
<li>
<p dir="auto">Because the Arduino <strong>HAS TO BE</strong> an I2C slave on address <strong>0x08</strong> as above, it is not possible for it to be an I2C master and control other I2C devices.</p>
<p dir="auto">This is not necessarily a big deal since the Omega can still use I2C to access any Arduino I2C shields that may be plugged into the Arduino Dock</p>
<p dir="auto">But again, it would be helpful if this was clear in the documentation</p>
</li>
<li>
<p dir="auto">Note that sending the <strong>0xde 0xad</strong> message from the Omega to the Arduino can be performed by the following call to the code in <a href="https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/lib/onion-i2c.c" rel="nofollow">https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/lib/onion-i2c.c</a> in the <a href="https://github.com/OnionIoT/i2c-exp-driver" rel="nofollow">https://github.com/OnionIoT/i2c-exp-driver</a> library:<br />
<strong><code>i2c_write(0, 0x08, 0xde, 0xad);</code></strong></p>
</li>
</ol>
]]></description><link>http://community.onion.io/post/5642</link><guid isPermaLink="true">http://community.onion.io/post/5642</guid><dc:creator><![CDATA[Kit Bishop]]></dc:creator><pubDate>Thu, 19 May 2016 08:38:56 GMT</pubDate></item><item><title><![CDATA[Reply to Some comments on Arduino Dock and I2C communication on Fri, 05 May 2017 23:56:20 GMT]]></title><description><![CDATA[<p dir="auto">I am still relatively new to the Arduino world - I am guessing that if I have an Arduino sketch that is collecting data from I2C sensors such as BME280 or Gas sensors then the sketch won't work in with the Arduino dock R2 + Omega 2+? I would have re-write those sketches?</p>
]]></description><link>http://community.onion.io/post/12980</link><guid isPermaLink="true">http://community.onion.io/post/12980</guid><dc:creator><![CDATA[Ashu Joshi]]></dc:creator><pubDate>Fri, 05 May 2017 23:56:20 GMT</pubDate></item></channel></rss>