Other Parts Discussed in Thread: INA219, ,
When using an INA219 common driver (in openbmc) to calculate voltage, current and power for INA220, is there any parameters need to be adjusted to calculate it correctly?
[Current 219's settings]
calibration = 4096
shunt_div=100
bus_voltage_shift=3
bus_voltage_lsb = 4000
power_lsb_factor = 20
[Environment]
6 fans unpleasent. Each fan spec is, 12v 4.50A.
[Result]
Voltage=24890, shift 3 and multi 4000 = 12444000 uV (24890 >> 3 * 4000) -- this looks ok.
Current=65535, multiple 1000, divide by 1000 and then cast to signed = -1
Power=2 multiply 20000 = 40000
[Questions]
1. What difference on calculating voltage, current and power in between INA220 and INA219?
2. How to interpret 40000 of power? According EE, the power should less than 10w for total 6 empty fan slot.
3. Does it mean it has inverse current as current=-1?
[Additional Notes]
In driver, it is calculate the value as following:
shunt_voltage = register value / 100
bus voltage = ( register value >> voltage_shift ) * bus_voltage_lsb *ps: voltage_shift is 3 and bus_voltage_lsb is 4000
current = (register value * current_lsb_uA) / 1000 *ps: current_lsb = 1000
power = (register value * power_lsb_uW) *ps: power_lsb_uW = power_lsb_factor * current_lsb_uA = 20 * 1000 = 20000, so register = 2, it shows 40000.