Hi,
I'm using the code shown below to interface with an external I2C device. First I send some data to set the coordinates of the register that I want to read, then I make a read operation and after that there is a "empty write" operation which shouldn't happen.
Wire.beginTransmission(_slaveNumber);
Wire.write(page);
Wire.write(reg);
Wire.endTransmission(false); //A repeated start can be used to fetch the data
Wire.requestFrom(_slaveNumber, dataNum);
while(Wire.available()) {
*data = Wire.read();
data++;
}
Wire.endTransmission(true); // stop transmitting - after this there are no more calls
to i2c library but there is that empty write
This could be a bug in the i2c library which has gone unnoticed, it's pretty visible using a sniffer as you can see in the attached image. It shows a read to the same registers of an external device every second. As you can see the empty write comes just after the read operation. Take the third line as example (first empty read): the previous read operation starts at time stamp 305.484 and lasts for 409us, so ending at 305.484+409 = 305.893, and the empty write starts at 305.923, just 30us after the previous one.
