<?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[RFID 2 unit and I2C hub 1 to 6 expansion unit]]></title><description><![CDATA[<p dir="auto">Hello,<br />
The RFID 2 unit works fine when connected directly to M5Core2.<br />
Now, I connect the I2C hub to the M5Core 2 and connect the RFID 2 device to channel 0 of the I2C hub.<br />
I run the following programs. I would assume that the RFID 2 device would show with address 0x28. But it does not, it only gives 0X70 which is the I2C device itself. What am i missing here?</p>
<pre><code>#include &lt;M5Core2.h&gt;

#include "ClosedCube_TCA9548A.h"

#define FRONT 2

#define X_LOCAL  100
#define Y_LOCAL  35
#define X_OFFSET 160
#define Y_OFFSET 34

#define PaHub_I2C_ADDRESS 0x70

ClosedCube::Wired::TCA9548A tca9548a;

void setup() {
    M5.begin();
    //M5.Power.begin();
    //wire.begin();
    tca9548a.address(PaHub_I2C_ADDRESS);  // Set the I2C address.  设置I2C地址
    M5.Lcd.setTextFont(4);
    M5.Lcd.setCursor(70, 0, 4);
    M5.Lcd.setTextColor(YELLOW, TFT_BLACK);
    M5.Lcd.println(("PaHUB Example"));
    M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
}

void loop() {
    uint8_t returnCode = 0;
    uint8_t address;
    for (uint8_t channel = 0; channel &lt; TCA9548A_MAX_CHANNELS; channel++) {
        M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);
        M5.Lcd.printf(
            "                                                                ");
        M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);
        M5.Lcd.printf("CH%d : ", channel);
        returnCode = tca9548a.selectChannel(channel);
        if (returnCode == 0) {
            for (address = 0x01; address &lt; 0x7F; address++) {
                Wire.beginTransmission(address);
                returnCode = Wire.endTransmission();
                if (returnCode == 0) {
                    Serial.print("I2C device = ");
                    M5.Lcd.printf("0X%X  ", address);
                }
            }
        }
        delay(200);
    }
}
</code></pre>
]]></description><link>https://community.m5stack.com/topic/6995/rfid-2-unit-and-i2c-hub-1-to-6-expansion-unit</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 06:20:22 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6995.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Nov 2024 15:08:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Sat, 24 May 2025 00:33:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191540">@laursena</a> and <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/7741">@HappyUser</a></p>
<p dir="auto">I am also trying to get RFID 2 to work with PaHub and running into similar problems:</p>
<ol>
<li>How to work with I2C device that requires initiation ahead of time. In this case, it is</li>
</ol>
<p dir="auto">MFRC522 mfrc522(0x28);</p>
<ol start="2">
<li>Why 0x28 show up in CH0 readout while RFID 2 is plugged into CH1 on PaHub.</li>
</ol>
<p dir="auto">You mentioned to get an update version of ClosedCub.cpp? I don't have the directory in my library folder, could you please be more specific. (I also googled it but out of luck there as well).</p>
<p dir="auto">Thanks,</p>
]]></description><link>https://community.m5stack.com/post/29100</link><guid isPermaLink="true">https://community.m5stack.com/post/29100</guid><dc:creator><![CDATA[ghettokon]]></dc:creator><pubDate>Sat, 24 May 2025 00:33:36 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Thu, 05 Dec 2024 09:11:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/7741">@HappyUser</a> Thank you very much! It has solved the problem.</p>
]]></description><link>https://community.m5stack.com/post/27340</link><guid isPermaLink="true">https://community.m5stack.com/post/27340</guid><dc:creator><![CDATA[laursena]]></dc:creator><pubDate>Thu, 05 Dec 2024 09:11:15 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Thu, 05 Dec 2024 07:13:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/191540">@laursena</a> please check the version of ClosedCube.cpp and ClosedCube.h you are using. The one that is provided by M5stack is the newest.<br />
(* In the examples of M5StickCPlus in the directory Unit/PaHub you may find these documents. *)</p>
]]></description><link>https://community.m5stack.com/post/27335</link><guid isPermaLink="true">https://community.m5stack.com/post/27335</guid><dc:creator><![CDATA[HappyUser]]></dc:creator><pubDate>Thu, 05 Dec 2024 07:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Wed, 04 Dec 2024 17:40:54 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/7741">@HappyUser</a></p>
<p dir="auto">I’m experiencing a similar issue with channel 0 on my PCA9548AP while using 6 Weight I2C Units.</p>
<p dir="auto">When a Weight Unit is connected to channel 0, no response is detected.<br />
However, when connected to any other channel, the device address is shown correctly.</p>
<p dir="auto">Were you able to find a solution for this issue? I haven’t been able to resolve it yet and would appreciate any insights.</p>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://community.m5stack.com/post/27331</link><guid isPermaLink="true">https://community.m5stack.com/post/27331</guid><dc:creator><![CDATA[laursena]]></dc:creator><pubDate>Wed, 04 Dec 2024 17:40:54 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Sun, 01 Dec 2024 18:39:20 GMT]]></title><description><![CDATA[<p dir="auto">SOLVED : After remeniscing abount my life, and specifically what goes wrong here, i just realised : could it be that I am using an outdated library of ClosedCube. And yes, after using the version from 4 April 2023, everything works fine now.</p>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> In Dutch : Krijg nou wat?<br />
I put the RFID 2 module in slot 1 of the TCA 9548A module and then in channel 0 (weird because i have placed it in channel 1) i see address 0x28 of the RFID popping up.</p>
<p dir="auto">Does this mean that channel 0 on the module is not usable?<br />
Thanks</p>
<p dir="auto">In follow_up , I have checked ClosedCube_TCA9548A.cpp and the selctChannel goes like this :</p>
<pre><code>uint8_t ClosedCube::Wired::TCA9548A::selectChannel(uint8_t channel) {
    uint8_t result = 0xff;
    if (channel &lt; TCA9548A_MAX_CHANNELS) {
        Wire.beginTransmission(_address);
        Wire.write(((uint8_t)1) &lt;&lt; (channel));

        _currentChannel = channel;
        result          = Wire.endTransmission();
    }
    return result;
}
</code></pre>
<p dir="auto">That seems to be correct if I read the documentation of the Texas Instrument module TCA9548A</p>
<p dir="auto">I am really misunderstaning something or could it be that their is somekind of wire mixup in the module?</p>
<p dir="auto">Btw, I also dont see a reset channel somewhere in the code.</p>
<hr />
<p dir="auto">Now i did another experiment using PCA9548AP (the newer version).<br />
Plugging in the RFID in channel 0 gives no response.<br />
Plugging in channel 1 : software tels me the device is in channel 0<br />
Plugging in a second RFID in channel 2 :software tells met a I have another device in channel 1.</p>
<p dir="auto">I tried to increase the max number of channels to 8 (assuming that channel 0 is somehow connected to channel 7 of 8). Still no response when i attach a device physically on channel 0.</p>
<p dir="auto">This is really weird behaviour. I hope someone is at least able to reproduce this behaviour.</p>
]]></description><link>https://community.m5stack.com/post/27236</link><guid isPermaLink="true">https://community.m5stack.com/post/27236</guid><dc:creator><![CDATA[HappyUser]]></dc:creator><pubDate>Sun, 01 Dec 2024 18:39:20 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Fri, 29 Nov 2024 08:40:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/7741">@HappyUser</a></p>
<p dir="auto">have you tried to connect the RFID2 to another channel than 0? Does it show up then?</p>
<p dir="auto">Do you have other I2C units which you could connect to any channel just to see if they get picked up?</p>
<p dir="auto">For a scan an I2C device doesn't need to be initialized.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/27214</link><guid isPermaLink="true">https://community.m5stack.com/post/27214</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 29 Nov 2024 08:40:54 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Thu, 28 Nov 2024 13:57:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> Sorry for my late response, been a bit occupied. Tried exacltly the include code with the most recent version of M5Unified (0.2.1) and M5Stack board manager (version 2.1.2). Connect the RFID 2 unit to slot 0 of the TCA9548A module (boh M5Stack products.<br />
It only lists for each channel 0x70 wire ping value. I would have expected for channel 0 to have a response on 0x28 (native wire address of the RFID 2 module). Maybe it is because the RFID module has not been inititated yet. But I do not know where to put the init of the RFID module. Tried at different place in the code , to no avail. I hope someone has an idea of where I am going wrong here.```<br />
//#include &lt;M5Core2.h&gt;<br />
#include &lt;M5Unified.h&gt;<br />
#include &lt;Wire.h&gt;</p>
<p dir="auto">#include "ClosedCube_TCA9548A.h"</p>
<p dir="auto">#define FRONT 2</p>
<p dir="auto">#define X_LOCAL  100<br />
#define Y_LOCAL  35<br />
#define X_OFFSET 160<br />
#define Y_OFFSET 34</p>
<p dir="auto">#define PaHub_I2C_ADDRESS 0x70</p>
<p dir="auto">ClosedCube::Wired::TCA9548A tca9548a;</p>
<p dir="auto">void setup() {<br />
M5.begin();<br />
Wire.begin();<br />
tca9548a.address(PaHub_I2C_ADDRESS);  // Set the I2C address.  设置I2C地址<br />
M5.Lcd.setTextFont(4);<br />
M5.Lcd.setCursor(70, 0, 4);<br />
M5.Lcd.setTextColor(YELLOW, TFT_BLACK);<br />
M5.Lcd.println(("PaHUB Example"));<br />
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);<br />
}</p>
<p dir="auto">void loop() {<br />
uint8_t returnCode = 0;<br />
uint8_t address;<br />
for (uint8_t channel = 0; channel &lt; TCA9548A_MAX_CHANNELS; channel++) {<br />
M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);<br />
M5.Lcd.printf(<br />
"                                                                ");<br />
M5.Lcd.setCursor(X_LOCAL, Y_LOCAL + Y_OFFSET * channel, FRONT);<br />
M5.Lcd.printf("CH%d : ", channel);<br />
returnCode = tca9548a.selectChannel(channel);<br />
if (returnCode == 0) {<br />
for (address = 0x01; address &lt; 0x7F; address++) {<br />
Wire.beginTransmission(address);<br />
returnCode = Wire.endTransmission();<br />
if (returnCode == 0) {<br />
Serial.print("I2C device = ");<br />
M5.Lcd.printf("0X%X  ", address);<br />
}<br />
}<br />
}<br />
delay(200);<br />
}<br />
}</p>
<pre><code></code></pre>
]]></description><link>https://community.m5stack.com/post/27186</link><guid isPermaLink="true">https://community.m5stack.com/post/27186</guid><dc:creator><![CDATA[HappyUser]]></dc:creator><pubDate>Thu, 28 Nov 2024 13:57:07 GMT</pubDate></item><item><title><![CDATA[Reply to RFID 2 unit and I2C hub 1 to 6 expansion unit on Wed, 20 Nov 2024 15:14:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/7741">@HappyUser</a></p>
<p dir="auto">the code works for me using M5Core2v1.1 and the following modifications:</p>
<pre><code>//#include &lt;M5Core2.h&gt;   &lt;-- replace this with below lines
#include &lt;M5Unified.h&gt;
#include &lt;Wire.h&gt;
</code></pre>
<pre><code>    M5.begin();
    Wire.begin();  &lt;--- add this after above line
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/27108</link><guid isPermaLink="true">https://community.m5stack.com/post/27108</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 20 Nov 2024 15:14:08 GMT</pubDate></item></channel></rss>