Increase I2C clock stretching value? #3977
Slow sensors doesn't work with default clock stretching value. Users or library authors have to adjust by calling e.g. Wire.setClockStretchLimit( 500L ); on ESP8266 for it to work. Can the default clock stretching (230 uS) be increased to make the code more user friendly?
Settings in IDE
Module: ?Generic ESP8266 Module?
@icucode Only some devices require clockstretching, and of those only the really slow ones would make use of this. The whole purpose of Wire.setClockStretchLimit() is for the user to call it with the value required by the specs of the device being used.
I understand that the explicit part can be good to have to protect the I2C bus from slow devices. But the I2C specification doesn't explicitly have a timeout for clock stretching:
"4.2.2 ... I2C can be a ‘DC’ bus, meaning that a slave device stretches the master clock when
I may also have been unlucky with my I2C device since it does not explicitly tell in the datasheet how slow it is. Instead I have had to rely on time consuming trial and error to locate the problem since I don't own an oscilloscope.