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.

INA219: I2C interfacing problem

Part Number: INA219

Hello.

I have problem with ACK bit from INA219. I get ACK bit after sending SLAVE_ADDRESS_WRITE ((0x40)<<1), but after sending pointer of Configuration Register or something else pointer, i dont get ACK bit.

what's wrong?

This my code for STM32F103:

I2C_GenerateSTART(I2C1, ENABLE);
while (I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)!=SUCCESS){};

I2C_Send7bitAddress(I2C1, SLAVE_ADDRESS_WRITE, I2C_Direction_Transmitter); A0 - A1 ->GND


while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));
I2C_Cmd(I2C1, ENABLE);

I2C_SendData(I2C1, 0x00);
read_SR1=I2C_ReadRegister(I2C1,I2C_Register_SR1);
read_SR2=I2C_ReadRegister(I2C1,I2C_Register_SR2);
while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));

  • Hello Alexey,

    It is hard to say the problem for sure, but my best guess here would be that the I2C controller may be sending the stop bit after the device address.  This way, when you try to send the register address it's treated as the device address, and there would be no device with that address to send the ACK. 

    If that ends up not being the issue, then post a screen capture of a scope shot of the communication for further debug.