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: Communicating with INA219 over I2C

Part Number: INA219
Other Parts Discussed in Thread: INA226, SYSCONFIG

Tool/software:

Hello we are using the TI INA219 with a STM H7 Nucleo reference board over I2C.  Questions:

1. Are there any sample device drivers from TI for using TI's  INA219 over I2C?

2. Would TI recommend an I2C speed mode of at least 400 KHz (fast mode) or would standard mode I2C (100 KHz) work?  We saw in the datasheer support for fast and high speed mode, but it appearded the min on fast mode range is standard mode 100KHz?

3. Should the I2C bus be configured with an analog filter enabled or disabled? 

4. Is there a coefficient of digital filter value that the I2C bus master should use to communicate with the INA219?

4. On pg 6 of the datasheet below on bus timing it shows clock fall time and rise time, as well as a data fall time, etc.

Does this require the I2C bus on which the INA219 resides master be configured for the shown rise and fall times specifically for the INA219 i.e., like shown below? 

Thank you again,

Tammy

  • Hi Tammy,

    I'm looking into this I'll get back to you shortly.

    Best,
    Mallika Senthil

  • Hi Tammy,

    1. Are there any sample device drivers from TI for using TI's  INA219 over I2C?

    We don't have a driver specifically at the moment, but what kind of driver where you looking into? We do have a GUI platform that can communicate with the device using the SCB and EVM. You'll find more information at the link below: https://www.ti.com/tool/INA219EVM

    Would TI recommend an I2C speed mode of at least 400 KHz (fast mode) or would standard mode I2C (100 KHz) work?  We saw in the datasheer support for fast and high speed mode, but it appearded the min on fast mode range is standard mode 100KHz?

    The INA219 will work in both modes.

    3. Should the I2C bus be configured with an analog filter enabled or disabled? 

    At this frequency it shouldn't matter.

    On pg 6 of the datasheet below on bus timing it shows clock fall time and rise time, as well as a data fall time, etc.

    No you shouldn't need to set the rise and fall times on the MCU.

    Best,
    Mallika Senthil

  • "but what kind of driver where you looking into?" When we have used other TI HW we have been able to get sample projects/device driver source code for the HW for using the parts device drivers like i.e., ina219/src/driver_ina219.c at main · libdriver/ina219 Open source online someone posted but not TI supported) but for using INA219 over I2C. Do you have this for this part?  When folks ship using this part with the master in an end device the gui app wont be used, don't you have customers that integrate this in a solution and integrate drivers/BSP to communicate with it like you have for other TI HW platforms? When we have used the other TI parts, TI supplies software examples of how to use/integrate them. That is what we needed. Thank you again.

  • Hi Tammy,

    I'm looking into this, I'll get back to you soon.

    Best,
    Mallika Senthil

  • Hi Tammy,

    There are some drivers not made by TI for the INA219, such as the Linux INA2xx driver. This is not made by TI, so we cannot provide specific support for this driver.

    We generally provide software examples and setup code through SysConfig. The INA219 is not in SysConfig yet, but we do have code for a similar device, the INA226, this can be used as a good starting point. Please find the code here:
    https://dev.ti.com/sysconfig/index.html?product=ascstudio&module=/ti/sensors/currentsensor/INA226 

    but it appearded the min on fast mode range is standard mode 100KHz?

    Please note, the min on fast mode range is 1kHz, not 100kHz.

    n pg 6 of the datasheet below on bus timing it shows clock fall time and rise time, as well as a data fall time, etc.

    To clarify further, you shouldn't have to adjust I2C communication for our devices if your MCU is using standard I2C, but it's good to ensure your timing is compatible with our device, as shown in the bus timing table.

    Best,
    Mallika Senthil