In my project I have an ESP32 (master) and 3 I2C devices:
- Arduino micro (running on 3.3V)
- DS3231 module
- MCP3426 ADC to I2C converter (also via isolators ISO1540)
The MCP3426 and DS3231 both have the same address, so they don't work together, that I will deal with later.
The ESP32 communicates with the MCP3426 when it is the only device connected.
The ESP32 does no communicate with the MCP3426 when the Arduino micro is also connected.
The ESP32 communicates with the DS3231 both when it is the only device connected and also when the micro is connected.
Why does the MCP34269 and arduino micro not work when connected to the I2C bus together?
To simplify things I've just been running the generic I2C discover routine:
#include <Wire.h>
void setup(void)
{
Serial.begin(9600);
Wire.begin();
while (!Serial); // Waiting for Serial Monitor
Serial.println("\nI2C Scanner");
}
// ---------------------------------------------------------------- /
// Arduino I2C Scanner
// Re-writed by Arbi Abdul Jabbaar
// Using Arduino IDE 1.8.7
// Using GY-87 module for the target
// Tested on 10 September 2019
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
// ---------------------------------------------------------------- /
void loop()
{
byte error, address; //variable for error and I2C address
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for (address = 127; address > 0; address-- )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address < 16)
Serial.print("0");
Serial.print(address, HEX);
Serial.println(" !");
nDevices++;
}
else if (error == 4)
{
Serial.print("Unknown error at address 0x");
if (address < 16)
Serial.print("0");
Serial.println(address, HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for the next I2C scan
}




