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.

INA260: Is the power register value really calculated from the current and voltage register values?

Part Number: INA260

Hello.

There is an interesting phenomenon in the power calculation of the INA260, which I do not understand:

In a simple test setup, I measure the current through a power resistor simultaneously with 4 INA260's,
connected in series, where the voltage is about 5V and the resistance is about 22Ohm.

I read elsewhere in the forum that the INA260 is not well suited to measure currents in this current / voltage range.
I am therefore aware of this and it is not relevant for the problem to be solved.
Later, measurements are to be taken in the range >35V and >10A. The current setup is only for simple tests.

The communication with the 4 INA260's runs without errors.

The mode is continuous measurement, reading takes place every 5s
[ AVG=111, VBUSCT=101=2.116 ms, ISHCT=101=2.116 ms (1024*2*2.116ms = 4.3s) ]
and provides plausible values for current and voltage,
whereby the current value certainly deviates considerably from the real current,
but interestingly, it is the same in all ICs.

INA260#1:
raw i: 0x00 0xa3 | real i: 0xffffffa3 -> -116.25 mA

raw u: 0x0e 0x73 | real u: 0x0e73     -> 4623.75 mV
raw p: 0x00 0x5f | real p: 0x005f     ->  950.00 mW   != 0.11625*4.62375=0.537W!!
INA260#2:
raw i: 0x00 0xa3 | real i: 0xffffffa3 -> -116.25 mA
raw u: 0x0e 0x6a | real u: 0x0e6a     -> 4612.50 mV
raw p: 0x00 0x5d | real p: 0x005d     ->  930.00 mW   != 0.11625*4.61250=0.536W!!
INA260#3:
raw i: 0x00 0xa3 | real i: 0xffffffa3 -> -116.25 mA
raw u: 0x0e 0x63 | real u: 0x0e63     -> 4603.75 mV
raw p: 0x00 0x5d | real p: 0x005d     ->  930.00 mW   != 0.11625*4.60375=0.535W!!
INA260#4:
raw i: 0x00 0xa3 | real i: 0xffffffa3 -> -116.25 mA
raw u: 0x0e 0x5e | real u: 0x0e5e     -> 4597.50 mV
raw p: 0x00 0x5d | real p: 0x005d     ->  930.00 mW   != 0.11625*4.59750=0.534W!!

The power value is where it gets interesting:

According to the datasheet, this value is calculated by multiplying the values from the current and voltage registers.


This can also be seen in the example in the datasheet:

14975*10 / 1000 = 149.75 and
 12.5*11.98     = 149.75

It looks different in the measured values.

Is the power value really calculated from the current and voltage register values?
Or where am I wrong?

Best regards

Hannes



  • Hello.

    The error was in the data conversion.
    P=U*I is of course valid for the INA260 :-)

    The first implementation of the data conversion was done in place using a unit with v=(v>>8)|(v<<8).
    This resulted in negative values when bit 8 was set in b[1], which was incorrect.

    The new implementation requires 2 bytes more memory for the variables, but the result is correct!

    // do not do that:
    union { uint8_t b[2]; int16_t value; } u;
    i2c_read_blocking(p->i2cbus_port, ina260_addr, u.b, 2, false);
    u.value=(u.value>>8)|(u.value<<8); fp=(float)u.value * LSB;

    // do it this way:
    uint8_t b; int16_t value;
    i2c_read_blocking(p->i2cbus_port, ina260_addr, u.b, 2, false);
    value=(b[0]<<8)|b[1]; fp=(float)value * LSB;