Struggling to write I²C using Wire lib

Hello There!

I am trying to write/read registers of an BNO055 Breakout board using an ESP32 Devkit.
Currently i am failing at the very first step of the way. Write I2C commands:


I am just trying to send out a simple write to one register, but my Logic analyzer shows me that this never gets send and only the address gets send.
Maybe someone can point me in the right direction or has experienced something similar.

Thanks!

1 Like

your commands look good to me. I checked in one of my sketch using wire.h and here are the only differences:

Wire.begin();  // no parameters included. Arduino 33IOT used.
Wire.write( uint8_t (register to wirte) ; // not sure to force the format will help you
Wire.write( ....)
Wire.endTransmission();

some basic advices when dealing in I2C with an unknow module:

do check twice the module adress, or use an I2C scanner;
try to first reach a register to read with a known start up value. For example, the embeded LSM6DS3 on 33 IOT has a dedicated register "WHO AM I" with a fixed value. Very confortable to get a simple status of your module;
take a deep dive into the module datasheet. It is often the ONLY place with good info to drive the module. Maybe a config needs to be done before activating the module.

Wish you louck with further experiments!

Alternatively, you may fisrt use a library, only in order to confirm your module is ok, and can communicate with the board (and you coul check the signals with your logic analyser).

Your logic analyzer output looks rather uncommon. The slave seems to stretch the clock signal which lets the master wait for almost 1ms to send the clock signal for the ACK/NACK. It's possible that this is too long for the ESP32 I2C hardware.

Do you have other I2C hardware (best one that does the i2C in hardware) to check if the basic I2C bus of your module works correctly?

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