Changed naming of 'PSU' and 'Load' voltages to 'VIN+' and 'VIN-' as I initially thought 'PSU' was referring to I2C logic level Vcc. I can't find any IN219 eval boards that don't used VIN+/VIN-. TI datasheet uses 'bus' and 'load' terminology in some circuit diagrams which might have influenced the choice?
Added power figures both from on chip register (lower resolution) as well as one calculated in Python using the full resolution voltage/current values
Align output in columns with correct significant figures
Added prompt if internal math calculations result in an overflow
Old
PSU Voltage: 3.292 V
Shunt Voltage: 0.003520 V
Load Voltage: 3.288 V
Current: 0.035200 A
New
Voltage (VIN+) : 3.292 V
Voltage (VIN-) : 3.288 V
Shunt Voltage : 0.00352 V
Shunt Current : 0.0352 A
Power Calc. : 0.11574 W
Power Register : 0.115 W
With gain = DIV_1_40MV and _cal_value = 65535 to force a math overflow in current register.
New
Voltage (VIN+) : 3.128 V
Voltage (VIN-) : 3.088 V
Shunt Voltage : 0.04000 V
Shunt Current : 3.2767 A
Power Calc. : 10.11845 W
Power Register : 10.118 W
Internal Math Overflow Detected!
Old
New
With
gain = DIV_1_40MV
and_cal_value = 65535
to force a math overflow in current register. New