Dual I2C busses on Arduino IDE (Arduino Wire problem)
Posted: Wed Nov 02, 2022 11:14 pm
I have a commercial PCB with an ESP 12-F, PCF8563 Clock, and SSD1306 based OLED. The PCF & SSD1306 are on two different IC2 busses for some stupid reason. Details:
PCF is SDA=0, SCL=2, Address 0x51
1306 is SDA=5, SCL=4. Address 03C
I can communicate fine with one or the other using Wire.begin(0,2) or Wire.begin(5,4), but have not been able to talk to both in the same sketch.
I tried using "Wire.end();" since that is supposed to "Disable the Wire library, reversing the effect of Wire.begin(). To use the Wire library again after this, call Wire.begin() again." Sounds perfect., but ........
When I use it, I get a compiler error that "class TwoWire has no member named 'end'". Looking at Wire.h and Wire.cpp files, they both include the end() function. So ?????
1. Any suggestions about this error? The Wire.h file has a note that it was modified in 2020, so it is fairly recent.
2. Alternative ideas? An I2C multiplexer probably isn't in the cards. If there is no software solution I will use a knife and soldering iron to put both devices on the same bus.
PCF is SDA=0, SCL=2, Address 0x51
1306 is SDA=5, SCL=4. Address 03C
I can communicate fine with one or the other using Wire.begin(0,2) or Wire.begin(5,4), but have not been able to talk to both in the same sketch.
I tried using "Wire.end();" since that is supposed to "Disable the Wire library, reversing the effect of Wire.begin(). To use the Wire library again after this, call Wire.begin() again." Sounds perfect., but ........
When I use it, I get a compiler error that "class TwoWire has no member named 'end'". Looking at Wire.h and Wire.cpp files, they both include the end() function. So ?????
1. Any suggestions about this error? The Wire.h file has a note that it was modified in 2020, so it is fairly recent.
2. Alternative ideas? An I2C multiplexer probably isn't in the cards. If there is no software solution I will use a knife and soldering iron to put both devices on the same bus.