Hello,
Have Sparkfun Qwiic Pro Micro and SparkFun Qwiic Mux Breakout.
Controlling using Arduino IDE under Windows 10.
With default mux address 0x70, I have no problems getting a response using the BasisControl example. The system sees a mux card at address 0x70. However, interesting things happen if I change the mux address to non-default (0x71 or 0x72).
I start the script with mux having a default address. No problems, I can see mux address 0x70. Then without resetting Pro Micro, I disconnect mux and change its address to 0x71 or 0x72. Connect to Pro Micro. In Serial Monitor, I can see the card with the new address. However, if I power cycle Pro Micro or upload the same script (BasicControl), I do not see any output in the Serial Monitor. The same situation with mux connected or disconnected. I tried to change the mux address in Mux_Control with no effect. Only the way to get responses back is to return mux to its default address.
Is it any way to use Pro Micro and mux with a non-default address? I need to use a non-default address because of SHTC3 sensors (they have fixed address 0x70).
Thanks.
About 1/3 of the way down here https://learn.sparkfun.com/tutorials/qw … e-overview there’s a chart that shows what address configurations are possible (simply ‘jump’ the relevant pads to assign anew)
Be sure to read through the entire guide as it will clarify many other useful features - best of luck!
Appreciate reply. However, as it is can be seen from my post, I’m able to change the mux address. You can see that and the problem description in the paragraph starting “I start the script .”
I probably need to put my question differently. Can Sparkfun Pro Micro Qwiic USB work with Sparkfun MUX using a not default MUX address?
Thanks.
Maybe share a couple photos, showing both sides of the board…be sure to show the i2c pads that are jumped/soldered (per the link that shows exactly how to do this).
Do you see this after changing the address?
Qwiic Mux Shield Read Example
Mux not detected. Freezing...
No. The serial monitor is completely empty.
This is when no jumpers soldered
This is when ADR 1 jumper soldered and Pro MIcro was NOT power cycled/script updated
After power cycle/script upload
Making that change won’t affect other things printing on the serial monitor, something else is causing the trouble of nothing showing up.
Change the address to 0x71 by closing only address jumper 0 then try this code and see if that works.
#include <Wire.h>
#include <SparkFun_I2C_Mux_Arduino_Library.h> //Click here to get the library: http://librarymanager/All#SparkFun_I2C_Mux
QWIICMUX myMux;
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("Qwiic Mux Shield Read Example");
Wire.begin();
if (myMux.begin(0x71) == false)
{
Serial.println("Mux not detected. Freezing...");
while (1)
;
}
Serial.println("Mux detected");
myMux.setPort(1); //Connect master to port labeled '1' on the mux
byte currentPortNumber = myMux.getPort();
Serial.print("CurrentPort: ");
Serial.println(currentPortNumber);
Serial.println("Begin scanning for I2C devices");
}
void loop()
{
Serial.println();
byte nDevices = 0;
for (byte address = 1; address < 127; address++)
{
Wire.beginTransmission(address);
byte error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address < 0x10)
Serial.print("0");
Serial.print(address, HEX);
Serial.println();
nDevices++;
}
else if (error == 4)
{
Serial.print("Unknown error at address 0x");
if (address < 0x10)
Serial.print("0");
Serial.println(address, HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found");
else
Serial.println("Done");
delay(1000);
}
Yes, changingif (myMux.begin() == false)
to ```
if (myMux.begin(0x72) == false)
Does it mean that problem with the empty parameter in myMux.begin() and I should not use it working with a non-standard address?
Does it mean that problem with the empty parameter in myMux.begin() and I should not use it working with a non-standard address?
Correct.
The library knows the boards default address is 0x70, leaving myMux.begin() blank will cause the library to automatically use 0x70 for an address.
If you change the address with the jumpers, you need to tell the code where to find the board by specifying the address in the begin line. Otherwise the code looks for a board at 0x70 when it’s actually somewhere else and then things don’t work.