cancel
Showing results for 
Search instead for 
Did you mean: 

I2C : Clock stretching

sfouques9
Associate II
Posted on April 11, 2008 at 10:22

I2C : Clock stretching

2 REPLIES 2
sfouques9
Associate II
Posted on May 17, 2011 at 09:51

Hello everybody,

I'm using a slave-chip (DPM7300) with the following I2C protocol : START-SlaveAddress+W-OpCode-N*TxData-ClockStrectching(Time for DPM to manage command)-ReStart-SlaveAddress+R-N*RxData-STOP.

The problem is the following : As the ClockStretching duration can be from nothing to 750ms, I have to release SCL line and check when the bus come free again.

BUT I2C interface from STR9 do not release the SCL line until it has sent a STOP condition. It seems impossible to switch form master to slave, or slave to master by software. (I2C interface is automatically set in master when sending Start Condition and in slave with Stop condition, according to STR9 manual)

My question is :

how can I release SCL line and poll its status without sending a STOP condition that will reset my slave device ??

Thanks,

Steph.

sfouques9
Associate II
Posted on May 17, 2011 at 09:51

Hi,

Actually, the problem doesn't exist : when the 'I2C_GenerateStart' function is called, the Start condition is only sent when SCL line is free.

So the I2C interface of STR9 does support the clock stretching ; user has just to poll the I2C_FLAG_SB to check when it had effectively been sent.

Steph.