SoftwareWire icon indicating copy to clipboard operation
SoftwareWire copied to clipboard

Sending data without a STOP condition behavior.

Open Koepel opened this issue 3 years ago • 0 comments

This is not an issue, this is just informative. There is a difference between the Arduino Wire library (for the Arduino Uno) and the SoftwareWire library when writing data to a Target that does not acknowledge to its I2C address (because it is busy with other things).

The difference came up because of this topic on the Arduino forum: https://forum.arduino.cc/t/wire-library-repeated-start/952211/

Simplified code:

Wire.beginTransmission(0x08);
Wire.write( 0xAA);
Wire.endTransmission( false);  // parameter "false" for no STOP

When the Target does not exist or does not acknowledge to its I2C address, then the Arduino Wire library ignores the parameter and sends a STOP. The SoftwareWire library checks the parameter and does not send a STOP.

The idea is that the Controller can claim the I2C bus until the Target is ready. On the Arduino forum, the question was if the Controller could not send a STOP condition when the Target is not ready, but send a STOP after the data was successful delivered to the Target. That is not possible with either library.

I don't know who is correct. Changing the behavior could violate the I2C standard.

Koepel avatar Jan 30 '22 15:01 Koepel