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.

wrong reading from bus i2c

Part Number: INA219

Hi,

We are using INA219 for Bus voltage measurement.

The I2C bus are connected to a programmer component (FPGA).

We try to make read and write from the INA219 and do not succeed.

When we read from register 00 (configuration) we do not see the default values (399F).

When we read from register 01 (shunt voltage) we accept values that does not make sense.

Do we need to do anything while turning on the system?

Do you have a sample code in C/C++?

Thanks alot in advance

Orit

  • The code would be different for every microcontroller, so information about the INA219EVM probably would not help you.

    What do you actually read? Can you show oscilloscope traces of the two I²C lines?

  • Hello Orit,

    Waveforms of the I2C commands would be helpful. What is your clock speed? What serial bus address did you choose for this INA219?

    What is the reading you get when reading the configuration register?

    Would you please provide a schematic, the shunt resistor value, and the load currents the shunt resistor is measuring when you read bad Vshunt values?

    Sincerely,

    Peter

  • Hi Peter,

    Thank you for your response.

    We work at a speed of 115,200

    I have 2 components on the same bus. One at the address 1000001 (A1=GND, A2=Vs) and the other at the address 1000100 (A1=Vs, A2=GND)

    Regarding the reading configuration register, I can not check at the moment. I will get back an answer soon

    schematic that I have is:

    Thank you

    Orit

  • Hi Clemens,

    Thank you for your response.

    In both components I read the same values even though one is connected to 5.5V and the other to 12V.

    The values that I read are:

     - Configuration 0A81

     - Shunt voltage 8144

     - Bus voltage 8D03

     - Power 2452

     - Current 0A09

     - Calibration 2268

    I do not write to any register at first. So I would expect to read from  Configuration register the default value: 399F.

    Can this register change in any other way except from my writing?

    Thank you

    Orit

  • Please show oscilloscope traces of the two I²C lines.

  • Hey Orit,

    You need to replace R623 and R622 with 0-Ω resistors. The address pins should have no resistance loaded onto them or else this can affect how the device detects the host writing to its slave address. This is probably the root cause here.

    Best,

    Peter