Page 1 of 1

Can't talk to any i2c devices

Posted: Tue Nov 27, 2018 11:59 pm
by jludwig
I've been trying to get two different i2c devices working with an ESP32 (MPL3115A2 and MPU9250). I can get these to work just fine with a 3.3V Arduino Pro Mini. I have debugged the MPL3115A2 more in-depth using a logical analyzer and a JTAG adapter. I am debugging the MPL3115A2 whomai command which fails. It doesn't fail because of an i2c error, but because the expected byte returned from the whomai regiser is 0 not 0xC4. I've debugged the SDA/SCL signals on both an ESP32 and a 3.3V Arduino. The i2c protocol analyzer in my logic analyzer software recognizes the same commands and responses for both. The slave seems to return the correct response (0xC4).

3.3V Arduino signals for whoami register read
i2c_arduino_wide_whoami.png
i2c_arduino_wide_whoami.png (24.91 KiB) Viewed 5437 times
ESP32 signals for whoami register read
i2c_esp32_wide.png
i2c_esp32_wide.png (28.48 KiB) Viewed 5437 times
This is the code I am using, although I also ported the Arduino ESP32 core and MPL3115A2 driver to an ESP-IDF project and got the same results.

Does anyone know why this is a problem? Is there any kind of ROM or base FW update I need to perform on my device?

Re: Can't talk to any i2c devices

Posted: Wed Nov 28, 2018 2:34 pm
by ESP_Valik
Could you provide code example?

Re: Can't talk to any i2c devices

Posted: Wed Nov 28, 2018 6:30 pm
by jludwig
This was the problem: https://www.esp32.com/viewtopic.php?f=19&t=6848 Updating the i2c file in the Arduino core fixed.

Re: Can't talk to any i2c devices

Posted: Wed Nov 28, 2018 11:10 pm
by idahowalker