This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

INA229_239EVM: Several issues: TI-SCB register width, and sysconfig bug

Part Number: INA229
Other Parts Discussed in Thread: TI-SCB, INA229, SYSCONFIG

Hi!

As I can't find a bug-report button on the TI-SCB page, I'll report them here:

1. When manually reading values of accumulated charge from INA229 via TI-SCB, as described in section 4.2.4.1 of the user guide at https://www.ti.com/lit/ug/sbou241e/sbou241e.pdf
the value is returned as if it were a signed 32-bit value, not signed 40-bit that it actually is. This means that in my logs, I now get to unwrap the results in post-processing, when the charge value goes above 31 bits.

GOT: {'address': 10, 'value': -2145068005}

EXPECTED: {'address': 10, 'value': 2149899289}

Is there a newer TI-SCB firmware version, where that bug is fixed?

2. Looking for a potential cause,, I happened upon your sysconfig tool that the TI-SSCB code is supposedly based on. Unrelated to the first bug (which is likely caused somewhere in the JSON formatting code), the code generated there has an obvious typo in INA229.c:

double INA229_getCHARGE_C(INA229_Handle sensor)
{
    double data = INA229_getENERGY_signedLSB(sensor);

    data = data * sensor->currentlsb;

    return data;
}

(Why you would return doubles from functions named "something_signedLSB" I refuse to try and understand)