Can't talk to any i2c devices

jludwig
Posts: 2
Joined: Tue Nov 27, 2018 11:17 pm

Can't talk to any i2c devices

Postby jludwig » Tue Nov 27, 2018 11:59 pm

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 4913 times
ESP32 signals for whoami register read
i2c_esp32_wide.png
i2c_esp32_wide.png (28.48 KiB) Viewed 4913 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?

ESP_Valik
Posts: 1
Joined: Wed Nov 28, 2018 2:03 pm

Re: Can't talk to any i2c devices

Postby ESP_Valik » Wed Nov 28, 2018 2:34 pm

Could you provide code example?

jludwig
Posts: 2
Joined: Tue Nov 27, 2018 11:17 pm

Re: Can't talk to any i2c devices

Postby jludwig » Wed Nov 28, 2018 6:30 pm

This was the problem: https://www.esp32.com/viewtopic.php?f=19&t=6848 Updating the i2c file in the Arduino core fixed.

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

Re: Can't talk to any i2c devices

Postby idahowalker » Wed Nov 28, 2018 11:10 pm


Who is online

Users browsing this forum: Google [Bot] and 70 guests