Clock stretching allows an I2C slave device to force the master device into a wait state. A slave device may perform clock stretching when it needs more time to manage data, such as store received data, or prepare to transmit another byte of data. This typically occurs after the slave device has received and acknowledged a byte of data. Whether or not clock stretching is needed depends on the functions of the slave device. Here are two examples:

1. A processing device, such as a microprocessor or a microcontroller may need additional time to process an interrupt, receive and manage data, and perform the appropriate function(s).

2. A simpler device, such as an EEPROM, does not process data internally, so it does not need clock stretching to perform any of its functions.

As per I2C protocol, there is no limit for the duration of a clock stretching period. However, if a timeout has been configured, a Bus Lock or other error may occur.

< Prodigy Community Forum – Click here