This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 - I2C unstable START condition

Other Parts Discussed in Thread: CC2541

Hi,
Currently I'm implementing I2C driver on CC2541.
And I saw that the driver may run smoothly several times (iterations, say 4-5 times)
and then (on next try) it waits for START condition
"while ((I2CCFG & I2C_SI) == 0);" (see code below)
 too long, actually if I don't break it programmatically, the driver stack forever.


> #define I2C_STA        BV(5)
> #define I2C_STO        BV(4)
> #define I2C_SI         BV(3)
>
> I2CCFG &= ~I2C_SI;               
>  I2CCFG |= I2C_STA;   
>  int count = 0           
>  while ((I2CCFG & I2C_SI) == 0)
>  {count++;
>   if (count > 1000) break;
 > }
> I2CCFG &= ~I2C_STA;

Why it may happen? - wrong frequency? low voltage? or something else?

All iterations in question are the same (like write a byte to an address, read several bytes).

Thank you.