AnsweredAssumed Answered

I2C repeated START

Question asked by karlis77 on Feb 27, 2016
Latest reply on Aug 31, 2016 by mazenauer.joern
Hello I am using STM32F030CC to communicate with BQ3060 fuel gauge through SMBus.

Everything is working kinda fine, but I am little worried about my repeated start condition.
I know reading 2 bytes from register should look like this:
START ADRESSwrite ACK REGISTER ACK START ADRESSread ACK DATA ACK DATA NACK

But in my case there is a STOP before the second START. I still get the data but won't this make any trouble in future?

This is my routine for reading ( I have tried autoend mode and soft end mode too, no results)
while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY))
                 {
                    asm("");
                 }
I2C_TransferHandling(I2C1, 0x16, 1, I2C_AutoEnd_Mode, I2C_Generate_Start_Write);
  while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY))
                 {
                    asm("");
                 }
I2C_SendData(I2C1, 0x8);
  while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY))
                 {
                    asm("");
                 }
I2C_TransferHandling(I2C1, 0x16, 1, I2C_AutoEnd_Mode, I2C_Generate_Start_Read);
while (I2C_GetFlagStatus(I2C1, I2C_FLAG_RXNE) == 0)
                {
                    asm("");
                }
temp_A = I2C_ReceiveData(I2C1);

This is how it looks in Digital logic analyzer
stopbeforerepeatedstart.png

Outcomes