SBOA539 January   2023 INA219 , INA232

 

  1.   Abstract
  2.   Trademarks
  3. 1Overview
    1. 1.1 INA232 and INA219
  4. 2Migrating From INA219 to INA232
    1. 2.1 Package Selection and Pinout
    2. 2.2 Device Address
    3. 2.3 Shunt Voltage Range
    4. 2.4 Power Supply and IO Voltage Levels
    5. 2.5 Digital Interface and Data Format
    6. 2.6 Register Set
    7. 2.7 Accuracy
    8. 2.8 Unique Features
  5. 3Implementation
    1. 3.1 Identify Suitable Migration Projects
    2. 3.2 Bench Setup and Hardware
    3. 3.3 Result Registers and Calculation
    4. 3.4 Software Implementation

Software Implementation

It is necessary to distinguish between INA232 and INA219 for the purpose of both programming and retrieving results. The default configuration register value is used to tell the two devices apart. Pseudocode of device detection is shown in Figure 3-4. The rest of the code deals with setup, read, and math calculation.

Configuration and Calibration registers are programmed depending on the device connected. Based on the settings determined by design parameters, if INA219 is connected, 2FFFh and 5000h are programed; if INA232, 4727h and 0A00h are programed. Similar to programming the device, retrieving and calculating measurement results are also slightly different depending on the device connected. Table 3-2 shows the details for calculation.

The program works with either INA219 or INA232 seamlessly, Figure 3-5 shows sample output logs.

Figure 3-4 Pseudocode
Figure 3-5 Verification Datalogs