SPRAD70 March   2023 AM2631 , AM2631 , AM2631-Q1 , AM2631-Q1 , AM2632 , AM2632 , AM2632-Q1 , AM2632-Q1 , AM2634 , AM2634 , AM2634-Q1 , AM2634-Q1

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2Applications
  5. 3Usage With AM263X
    1. 3.1 Obtaining the Register Values to Program in INA226
    2. 3.2 Programming the Register Values Using the Provided I2C Code in INA226
    3. 3.3 Obtaining the Register Values to Program in INA228
    4. 3.4 Programming the Register Values Using the Provided I2C Code in INA228
  6. 4References

Programming the Register Values Using the Provided I2C Code in INA228

  1. Input the INA part being used (INA226/INA228) as shown below:
    #define INA226     (0X00) //1 - INAA26 is used, 0 - INA228 is used
  2. Input the voltage rail that needs to be monitored as shown below:

    #define RAIL_1V2 (0x01) //1 - 1.2V rail to be monitored, 0 - 3.3V rail to be monitored

    Note: In this example, 1.2V voltage rail is being monitored using the INA with I2C device address 0x41.To monitor the 3.3V rail, the INA with the device address 0x40 needs to be used.

  3. Input the value of the Configuration Register obtained in the previous section under the macros “INA228_REG_CONFIG_MSB_VALUE” (with the Most significant Byte) and “INA228_REG_CONFIG_LSB_VALUE” (with the Least Significant Byte).
    #define INA228_REG_CONFIG_MSB_VALUE       (0x00) /* Input from the user */
    #define INA228_REG_CONFIG_LSB_VALUE       (0x00) /* Input from the user */
    Note: The value of Configuration Register (00h) in this example is "0x0000" which is it's default value, and in case the value of "ADCRANGE" needs to be "1", the register then needs to be programmed with "0x0010".
  4. Input the value of the Calibration Register value obtained in the previous section under the macros “#define: INA228_REG_SHUNT_CAL_MSB_VALUE” (with the Most significant Byte) and “#define INA228_REG_SHUNT_CAL_LSB_VALUE” (with the Least Significant Byte).
    #define INA228_REG_SHUNT_CAL_MSB_VALUE    (0x33) /* Input from the user */
    #define INA228_REG_SHUNT_CAL_LSB_VALUE    (0x33) /* Input from the user */
  5. ADC Configuration Register is programmed with the default value of 0xFB68 as explained in the previous section.
    #define INA228_REG_ADC_CONFIG_MSB_VALUE   (0xFB) /* Default value */
    #define INA228_REG_ADC_CONFIG_LSB_VALUE   (0x68) /* Default value */
  6. Run the provided project on Code Composer Studio™ (CCS) and obtain the Current, Shunt Voltage and Bus Voltage, Die temperature, Energy, Charge and Power values on the console output as shown in the image below.
    GUID-20230227-SS0I-R2CK-XBH3-XT569CTMKMZX-low.pngFigure 3-3 CCS Console Output
  7. Input these values in the excel in the column "Returned Value(in Hex)" to calculate the actual Current, Shunt Voltage and Bus Voltage, Die temperature, Energy, Charge and Power values by multiplying with the corresponding LSB values.
  8. In #FIG_FBR_43W_TVB, the following output values were obtained.
    GUID-20230227-SS0I-VCVJ-KPZP-HTGTS40FWZBT-low.pngFigure 3-4 Measurements Obtained Highlighted
Note: The Alert pin of the INA device can be connected to a general-purpose input/output (GPIO) on the AM263x, which provides a response to a single user-defined event or to a Conversion Ready notification, if desired.