<?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[Atom to Atom via I2C]]></title><description><![CDATA[<p dir="auto">Hi Folks,</p>
<p dir="auto">I'm trying to get 2 M5Stack Atom's to talk together via I2C, or more specifcially, SoftI2C in Micropython.</p>
<p dir="auto">I've flashed both devices with Micropython 1.18 and have code on device A that looks like:</p>
<pre><code>import machine

i2c = machine.SoftI2C(scl=machine.Pin(26), sda=machine.Pin(32), freq=400000, timeout=50000)

data = i2c.readfrom_mem(2, 1, 10)
print(data.decode('utf-8'), end="")
</code></pre>
<p dir="auto">Then on device B, I have the code to send data:</p>
<pre><code>import machine

i2c = machine.SoftI2C(scl=machine.Pin(26), sda=machine.Pin(32), freq=400000, timeout=50000)

i2c.writeto_mem(2, 1, bytearray("Hello World"))
</code></pre>
<p dir="auto">Nothing seems to come through, I have tried <code>i2c.scan()</code> however it just returns and empty list on both.</p>
<p dir="auto">I realise these are not hardware I2C pins, but they are for the Grove cable I'm using to power the second Atom.</p>
<p dir="auto">If anyone has any examples/reference/docs or general tips, that would be great.</p>
]]></description><link>https://community.m5stack.com/topic/4221/atom-to-atom-via-i2c</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:49:45 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4221.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Apr 2022 10:55:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Atom to Atom via I2C on Fri, 13 May 2022 10:03:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/exie" aria-label="Profile: exie">@<bdi>exie</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> I have never worked with micropython, however ESP32 can act as a slave on the I2C bus without any issues, irrespective of the pins that are used (any pair of GPIO can, in fact, be used as front-end for the I2C interface). I've taken a peek to the linked thread and the idea of continuously polling the bus to reply to an address as a slave is quite cumbersome and to say the least, inefficient.</p>
]]></description><link>https://community.m5stack.com/post/17479</link><guid isPermaLink="true">https://community.m5stack.com/post/17479</guid><dc:creator><![CDATA[brus]]></dc:creator><pubDate>Fri, 13 May 2022 10:03:38 GMT</pubDate></item><item><title><![CDATA[Reply to Atom to Atom via I2C on Wed, 20 Apr 2022 22:33:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Yes, I think you are absolutely right.</p>
<p dir="auto">I just struggled to find any useful references to do this.<br />
Today I came across this post:<br />
<a href="https://forum.micropython.org/viewtopic.php?t=5320" target="_blank" rel="noopener noreferrer nofollow ugc">https://forum.micropython.org/viewtopic.php?t=5320</a></p>
<p dir="auto">So I will try this later today and see how I go.</p>
]]></description><link>https://community.m5stack.com/post/17231</link><guid isPermaLink="true">https://community.m5stack.com/post/17231</guid><dc:creator><![CDATA[Exie]]></dc:creator><pubDate>Wed, 20 Apr 2022 22:33:52 GMT</pubDate></item><item><title><![CDATA[Reply to Atom to Atom via I2C on Wed, 20 Apr 2022 15:14:44 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/exie" aria-label="Profile: Exie">@<bdi>Exie</bdi></a></p>
<p dir="auto">you would need one M5Atom to assume the I2C slave role. Right now both of your M5Atoms are acting as I2C master, but on a given I2C bus there can only be one master.</p>
<p dir="auto">That said, I have no idea whether ESP32 can assume the I2C slave role or not and if yes, whether that functionality is accessible from within micropython.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/17226</link><guid isPermaLink="true">https://community.m5stack.com/post/17226</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 20 Apr 2022 15:14:44 GMT</pubDate></item></channel></rss>