I2C Problems

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
}

Arduino.jpg

Arduino.jpg

It looks like you need an oscilloscope to look at the signals. You seem to have done your paperwork.

The Arduino Micro is a 5V board with a ATmega32U4 running at 16MHz. According to the datasheet it needs at least 4.5V to run at 16MHz.
Manufacturer's page of the ATmega32U4: https://www.microchip.com/wwwproducts/en/ATmega32u4.
If the 5V pin is used to power the Arduino Micro with 3.3V, then the maximum frequency is 10.7 MHz.

If the USB connector is connected to the computer, then the USB 5V will flow into your 3.3V via a mosfet (see schematic of Micro), trying to lift the ESP32-WROOM-32 module to 5V. Perhaps something is already damaged.

Manufacturer's page of the isolated DC/DC-adapter: https://www.murata.com/en-eu/products/productdetail?partno=MGJ2D051505SC.
That is 5V in, with two outputs:
+15V 80mA
-5V 40mA
Those are not supposed to combine to create 20V.

Manufacturer's page of the AMS1117: Advanced Monolithic Systems - Voltage Regulator.
It's absolute maximum input voltage is 15V. But it gets 20V.

The schematic is not complete. I don't know what is powering the LMP2234 and I don't know where your 5V and 3.3V come from (the normal 5V and 3.3V).

So far I found four serious problems and one of them is damaging the the ESP32-WROOM-32 module by applying 5V to it when a USB cable is connected to the Micro.
Could it explain the I2C behavior ? maybe, I'm not sure.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.