SBOA539 January 2023 INA219 , INA232
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.