You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In ina219.go there's a check for the overflow flag respresented in the voltage register. This error reads bus voltage register overflow. This is a misnomer.
This register is documented in the datasheet as follows:
Math Overflow Flag
The Math Overflow Flag (OVF) is set when the Power or Current calculations are out of range. It indicates that
current and power data may be meaningless.
This flag indicates not an overflow in the voltage register, but an overflow in the power and current registers, which are read out later in the code.
This is unfortunate, because the data in the voltage register is completely valid in such a state. The problem would be a misconfiguration in the calibration register, causing the internal calculations from shunt voltage to current and power to fail. The sad thing about this, is that a lot of precision is lost in this conversion, as the registers the chip is working with are very small (16 bits). I'd like to retrieve the Voltage value, and do the calculations myself in the code instead of on the chip.
Expected behavior
I would like the library to clarify the error message, and ideally provide a way to retrieve the measured full-scale voltage and shunt voltage regardless of this calculation overflow.
Personally I also think this library would be more useful calculating the current/power itself instead of relying on the chip, but that's out of the scope of this specific request.
Describe the bug
In
ina219.go
there's a check for the overflow flag respresented in the voltage register. This error readsbus voltage register overflow
. This is a misnomer.This register is documented in the datasheet as follows:
This flag indicates not an overflow in the voltage register, but an overflow in the power and current registers, which are read out later in the code.
This is unfortunate, because the data in the voltage register is completely valid in such a state. The problem would be a misconfiguration in the calibration register, causing the internal calculations from shunt voltage to current and power to fail. The sad thing about this, is that a lot of precision is lost in this conversion, as the registers the chip is working with are very small (16 bits). I'd like to retrieve the Voltage value, and do the calculations myself in the code instead of on the chip.
Expected behavior
I would like the library to clarify the error message, and ideally provide a way to retrieve the measured full-scale voltage and shunt voltage regardless of this calculation overflow.
Personally I also think this library would be more useful calculating the current/power itself instead of relying on the chip, but that's out of the scope of this specific request.
Additional context
Device datasheet: https://www.ti.com/lit/gpn/ina219
The text was updated successfully, but these errors were encountered: