Electronic – Does clock speed matter when recovering from I2C bus lock up

bit-bangclock-speedi2c

When there is I2C lock caused by slave device driving the SDA line low you need to manually generate a few clock signals by doing a simple bit banging on the SCL pin. I thought that this need to be done with the same frequency as the I2C communication was running before the lock up but it also works for me if I do a bit banging with a much lower frequency. Let's say I have I2C clock speed configured to be 100kHz, then I have a lock up and I generate a few clock signals with a frequency of 4kHz and immediately I2C is working fine again. Please explain if the frequency of bit banging does matter when unlocking I2C bus.

Best Answer

Does clock speed matter when recovering from I2C bus lock up?

Simple answer: No.

Detailed answer: As you know, slaves are not programmed to run at a specified frequency because SCLK is generated and "served" by the master. To ensure proper resetting, just refer to the timing diagram shown in the datasheet (i.e. minimum hi- and low-pulse duration).

After 9 or 10 clock pulses, slave should send an ACK and release the SDA line. If not then a hardware reset or power-cycle (God forbid!) may be required.