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.

INA233: reading EIN seems to randomly report curious data

Part Number: INA233

I'm using a INA233 from an INA233EVM Kit.

I connected the board to a Mikrocontroller (nRF9160) via I2C.

The chip runs at 3.3V and monitors the power supply of the nRF9160 (VBUS also 3.3V, shunt 100mOhm, I between 25µA and 200mA).

I've setup to read VBUS and VSHUNT every 0.588ms, no average filter.

Except reading EIN that works well.

But EIN behaves very strange. I tried out both modes, with "READ_EIN Autoclear" enabled and not, but both modes don't operate well.

it works several times reading EIN, but sometimes, it seems to stick to old values (even with autoclear or explicitly CLEAR_EIN). That may occurs sometimes for 1 read sometimes for 2 or 3.

Afterwards, you either get "valid new values" (means sample counter and time are matching the configure frequence) or "continued values" (means, the sample counter is pretty high and seems to be not related to the time period since the last (sticky) read). I also read status register (INPUT, CML, MFR) but they never indicated an error nor warning.

Questions:

- are there some special preconditions which must be meet to read EIN?

- are some conditions under reading EIN doesn't clear EIN in "autoclear" mode?

Example

bat
I 19.925 : INA233 STATUS OK
I 19.925 : INA233 3305 mV (BUS)
I 19.925 : INA233 420 µV (SHUNT)
I 19.925 : INA233 4200 µA
I 19.925 : INA233 14375 µW
I 19.925 : INA233 EIN 4777865, samples 651903, (rollovers 72)
I 19.926 : INA233 4375 µW / 1323 µA, 718868 ms (906 samples/s)
I 19.926 : INA233 3145 mWs 951 mAs
I 19.926 : 3305 mV
OK
bat
I 24.415 : INA233 STATUS OK
I 24.415 : INA233 3303 mV (BUS)
I 24.415 : INA233 270 µV (SHUNT)
I 24.415 : INA233 2925 µA
I 24.415 : INA233 9375 µW
I 24.415 : INA233 EIN 4777865, samples 651903, (rollovers 72)
I 24.415 : INA233 4375 µW / 1324 µA, 4490 ms (145189 samples/s)
I 24.415 : INA233 19 mWs 5 mAs
I 24.415 : 3303 mV
OK

(about 4.4s later, reading the same values from EIN)

bat
I 62.469 : INA233 STATUS OK
I 62.469 : INA233 3302 mV (BUS)
I 62.469 : INA233 332 µV (SHUNT)
I 62.469 : INA233 3325 µA
I 62.469 : INA233 11250 µW
I 62.469 : INA233 EIN 253337, samples 34574, (rollovers 3)
I 62.469 : INA233 4375 µW / 1324 µA, 38126 ms (906 samples/s)
I 62.469 : INA233 166 mWs 50 mAs
I 62.469 : 3302 mV

(here next read returns valid data)

bat
I 68.542 : INA233 STATUS OK
I 68.542 : INA233 3303 mV (BUS)
I 68.542 : INA233 277 µV (SHUNT)
I 68.542 : INA233 2775 µA
I 68.542 : INA233 9375 µW
I 68.542 : INA233 EIN 40418, samples 5507, (rollovers 0)
I 68.542 : INA233 4375 µW / 1324 µA, 6072 ms (906 samples/s)
I 68.542 : INA233 26 mWs 7 mAs
I 68.542 : 3303 mV
OK
bat
I 55.674 : INA233 STATUS OK
I 55.674 : INA233 3302 mV (BUS)
I 55.674 : INA233 237 µV (SHUNT)
I 55.674 : INA233 1475 µA
I 55.674 : INA233 8125 µW
I 55.674 : INA233 EIN 578433, samples 79015, (rollovers 8)
I 55.674 : INA233 4375 µW / 1324 µA, 87133 ms (906 samples/s)
I 55.674 : INA233 381 mWs 115 mAs
I 55.674 : 3302 mV
OK
bat
I 58.409 : INA233 STATUS OK
I 58.409 : INA233 3302 mV (BUS)
I 58.409 : INA233 215 µV (SHUNT)
I 58.409 : INA233 2150 µA
I 58.410 : INA233 6875 µW
I 58.410 : INA233 EIN 18232, samples 2480, (rollovers 0)
I 58.410 : INA233 4375 µW / 1324 µA, 2735 ms (906 samples/s)
I 58.410 : INA233 11 mWs 3 mAs
I 58.410 : 3302 mV
OK
bat
I 76.684 : INA233 STATUS OK
I 76.684 : INA233 3302 mV (BUS)
I 76.684 : INA233 222 µV (SHUNT)
I 76.684 : INA233 2225 µA
I 76.685 : INA233 6875 µW
I 76.685 : INA233 EIN 18232, samples 2480, (rollovers 0)
I 76.685 : INA233 4375 µW / 1324 µA, 18347 ms (135 samples/s)
I 76.685 : INA233 80 mWs 24 mAs
I 76.685 : 3302 mV
OK

(here too few samples)
bat
I 84.622 : INA233 STATUS OK
I 84.622 : INA233 3303 mV (BUS)
I 84.622 : INA233 447 µV (SHUNT)
I 84.622 : INA233 4475 µA
I 84.622 : INA233 14375 µW
I 84.622 : INA233 EIN 121539, samples 16638, (rollovers 1)
I 84.622 : INA233 4375 µW / 1324 µA, 7938 ms (2095 samples/s)
I 84.622 : INA233 34 mWs 10 mAs
I 84.623 : 3303 mV
OK

(next too many samples)

  • Hi Achim, 

    What is the value for the MFR_DEVICE_CONFIG register? The EIN_STATUS field may be useful in telling us if the EIN accumulator is encountering an inconsistent value. Also, a scope shot of the I2C communication of when the same value is being read would be useful. Any error condition scope shot would be helpful in troubleshooting. It may also be worth swapping the device to see if the device is malfunctioning. 

    Best,

    Mohamed 

  • I 19.059 : INA233 MFR CONFIG 0000 0110
    I 19.060 : INA233 MFR ADC CONFIG 0100 000 011 011 111
    I 19.063 : INA233 STATUS 1010 0100 0000 0000
    I 19.064 : INA233 INPUT_STATUS 0000 0000
    I 19.064 : INA233 4027 mV (BUS)
    I 19.064 : INA233 337 µV (SHUNT)
    I 19.064 : INA233 3375 µA
    I 19.064 : INA233 13125 µW
    I 19.064 : INA233 EIN 47374, samples 4994, (rollovers 0)
    I 19.064 : INA233 5928 µW / 1472 µA, 5508 ms (906 samples/s)
    I 19.064 : INA233 32 mWs 7 mC

    That's the values with EIN autoclear. In that case reading EIN succeeded. 

    (I connect VBUS now to the battery and not longer to the 3.3V. But that's not related to the issue  sporadic reading EIN "ghost values".)

    > EIN_STATUS field

    My "ina233.pdf" shows "SBOS790 – APRIL 2017".

    I didn't find a "EIN_STATUS" field, maybe it's the "STATUS_INPUT 7Ch"?

    > Also, a scope shot of the I2C communication of when the same value is being read would be useful.

    Not sure, what a "scope shot" is? Do you mean the electrical values of the I2C bus? Or something as a logic analyzer trace? No, I don't have that. As I wrote, the other values read over I2C seems to be OK. So I don't assume an issue there. I also clear the MCU block array before reading the EIN block. I check the leading 6. And it would be really irritating, that a I2C issue cases to read the same EIN block twice.

     

  • I 23.206 : INA233 EIN samples 0, retry.
    I 23.206 : INA233 STATUS 1010010000000000
    I 23.207 : INA233 INPUT_STATUS 00000000
    I 25.208 : INA233 EIN samples 0, retry.
    I 25.208 : INA233 STATUS 1010010000000000
    I 25.209 : INA233 INPUT_STATUS 00000000
    I 27.211 : INA233 STATUS 1010010000000000
    I 27.212 : INA233 INPUT_STATUS 00000000
    I 27.212 : INA233 4027 mV (BUS)
    I 27.212 : INA233 280 µV (SHUNT)
    I 27.212 : INA233 2800 µA
    I 27.212 : INA233 11250 µW
    I 27.212 : INA233 EIN 530615, samples 8327, (rollovers 8)
    I 27.212 : INA233 39826 µW / 9889 µA, 9183 ms (906 samples/s)
    I 27.212 : INA233 365 mWs 90 mC
    bat
    I 49.621 : INA233 STATUS 1010010000000000
    I 49.621 : INA233 INPUT_STATUS 00000000
    I 49.621 : INA233 4030 mV (BUS)
    I 49.621 : INA233 360 µV (SHUNT)
    I 49.622 : INA233 3600 µA
    I 49.622 : INA233 14375 µW
    I 49.622 : INA233 EIN 530615, samples 8327, (rollovers 8)
    I 49.622 : INA233 39826 µW / 9882 µA, 22409 ms (371 samples/s)
    I 49.622 : INA233 892 mWs 221 mC
    I 49.622 : 4030 mV
    OK
    bat
    I 64.942 : INA233 STATUS 1010010000000000
    I 64.942 : INA233 INPUT_STATUS 00000000
    I 64.942 : INA233 4028 mV (BUS)
    I 64.942 : INA233 287 µV (SHUNT)
    I 64.942 : INA233 2550 µA
    I 64.942 : INA233 10000 µW
    I 64.942 : INA233 EIN 530615, samples 8327, (rollovers 8)
    I 64.942 : INA233 39826 µW / 9887 µA, 14321 ms (581 samples/s)
    I 64.942 : INA233 570 mWs 141 mC
    I 64.942 : 4028 mV
    OK
    bat
    I 73.271 : INA233 STATUS 1010010000000000
    I 73.272 : INA233 INPUT_STATUS 00000000
    I 73.272 : INA233 4028 mV (BUS)
    I 73.272 : INA233 205 µV (SHUNT)
    I 73.272 : INA233 2050 µA
    I 73.272 : INA233 8125 µW
    I 73.272 : INA233 EIN 530615, samples 8327, (rollovers 8)
    I 73.272 : INA233 39826 µW / 9887 µA, 9330 ms (892 samples/s)
    I 73.272 : INA233 371 mWs 92 mC
    I 73.272 : 4028 mV
    OK
    bat
    I 88.466 : INA233 STATUS 1010010000000000
    I 88.466 : INA233 INPUT_STATUS 00000000
    I 88.467 : INA233 4028 mV (BUS)
    I 88.467 : INA233 425 µV (SHUNT)
    I 88.467 : INA233 4250 µA
    I 88.467 : INA233 17500 µW
    I 88.467 : INA233 EIN 379391, samples 41769, (rollovers 5)
    I 88.467 : INA233 5676 µW / 1409 µA, 15194 ms (2749 samples/s)
    I 88.467 : INA233 86 mWs 21 mC
    I 88.467 : 4028 mV
    OK

    Above a STATUS fields of an failure case.

    It starts with reading 0 samples for two times. The STATUS-WORD shows some bits, which are according my documentation

    Bit 15 "not supported" default 0 => I read 1

    Bit 13 "INPUT, but INPUT_STATUS is 0

    Bit 10 "not supported" default 0 => I read 1

    (Edited: uups, I read the status byte 0x78 instead of the word 0x79, the right value is 0001 0000 0000 0000)

    So, I don't see an error condition. But reading EIN sticks on "EIN 530615, samples 8327, (rollovers 8)" for 4 times until new values are then reported. For me this seems, that the INA233 still accumulates EIn (without clearing it) and so the latest read spans much more than just the last time period. 

    So, what blocks the EIN from being read?

    > It may also be worth swapping the device to see if the device is malfunctioning. 

    Then I hope, not too many device will be malfunctioning ;-)

  • I 38.707 : INA233 MFR CONFIG 00000010
    I 38.708 : INA233 MFR ADC CONFIG 0100000011011111
    I 38.708 : INA233 STATUS 1010010000000000
    I 38.708 : INA233 INPUT_STATUS 00000000
    I 38.709 : INA233 1 waits
    I 38.711 : INA233 STATUS 1010010000000000
    I 38.712 : INA233 INPUT_STATUS 00000000
    I 38.712 : INA233 4028 mV (BUS)
    I 38.712 : INA233 285 µV (SHUNT)
    I 38.712 : INA233 2850 µA
    I 38.712 : INA233 11250 µW
    I 38.712 : INA233 EIN 240791, samples 25246, (rollovers 3)
    I 38.712 : INA233 5961 µW / 1479 µA, 27839 ms (906 samples/s)
    I 38.712 : INA233 165 mWs 40 mC
    OK
    ina
    I 44.732 : INA233 MFR CONFIG 00000010
    I 44.732 : INA233 MFR ADC CONFIG 0100000011011111
    I 44.732 : INA233 STATUS 1010010000000000
    I 44.733 : INA233 INPUT_STATUS 00000000
    I 44.734 : INA233 1 waits
    I 44.736 : INA233 STATUS 1010010000000000
    I 44.736 : INA233 INPUT_STATUS 00000000
    I 44.736 : INA233 4027 mV (BUS)
    I 44.736 : INA233 280 µV (SHUNT)
    I 44.736 : INA233 2800 µA
    I 44.736 : INA233 11250 µW
    I 44.736 : INA233 EIN 50145, samples 5463, (rollovers 0)
    I 44.736 : INA233 5736 µW / 1424 µA, 6024 ms (906 samples/s)
    I 44.736 : INA233 34 mWs 8 mC
    OK
    ina
    I 65.864 : INA233 MFR CONFIG 00000010
    I 65.864 : INA233 MFR ADC CONFIG 0100000011011111
    I 65.865 : INA233 STATUS 1010010000000000
    I 65.865 : INA233 INPUT_STATUS 00000000
    I 65.866 : INA233 1 waits
    I 65.868 : INA233 STATUS 1010010000000000
    I 65.869 : INA233 INPUT_STATUS 00000000
    I 65.869 : INA233 4028 mV (BUS)
    I 65.869 : INA233 265 µV (SHUNT)
    I 65.869 : INA233 2650 µA
    I 65.869 : INA233 10000 µW
    I 65.869 : INA233 EIN 50145, samples 5463, (rollovers 0)
    I 65.869 : INA233 5736 µW / 1424 µA, 21133 ms (258 samples/s)
    I 65.869 : INA233 121 mWs 30 mC
    OK
    ina
    I 87.579 : INA233 MFR CONFIG 00000010
    I 87.579 : INA233 MFR ADC CONFIG 0100000011011111
    I 87.580 : INA233 STATUS 1010010000000000
    I 87.580 : INA233 INPUT_STATUS 00000000
    I 87.581 : INA233 2 waits
    I 87.583 : INA233 STATUS 1010010000000000
    I 87.584 : INA233 INPUT_STATUS 00000000
    I 87.584 : INA233 4030 mV (BUS)
    I 87.584 : INA233 277 µV (SHUNT)
    I 87.584 : INA233 2775 µA
    I 87.584 : INA233 11250 µW
    I 87.584 : INA233 EIN 175567, samples 19164, (rollovers 2)
    I 87.584 : INA233 5725 µW / 1420 µA, 21715 ms (882 samples/s)
    I 87.584 : INA233 124 mWs 30 mC
    OK
    ina
    I 98.645 : INA233 MFR CONFIG 00000010
    I 98.645 : INA233 MFR ADC CONFIG 0100000011011111
    I 98.645 : INA233 STATUS 1010010000000000
    I 98.646 : INA233 INPUT_STATUS 00000000
    I 98.647 : INA233 3 waits
    I 98.649 : INA233 STATUS 1010010000000000
    I 98.650 : INA233 INPUT_STATUS 00000000
    I 98.650 : INA233 4028 mV (BUS)
    I 98.650 : INA233 337 µV (SHUNT)
    I 98.650 : INA233 3375 µA
    I 98.650 : INA233 13125 µW
    I 98.650 : INA233 EIN 180115, samples 19692, (rollovers 2)
    I 98.650 : INA233 5716 µW / 1419 µA, 11066 ms (1779 samples/s)
    I 98.650 : INA233 63 mWs 15 mC
    OK
    ina
    I 03.428 : INA233 MFR CONFIG 00000010
    I 03.429 : INA233 MFR ADC CONFIG 0100000011011111
    I 03.429 : INA233 STATUS 1010010000000000
    I 03.429 : INA233 INPUT_STATUS 00000000
    I 03.431 : INA233 3 waits
    I 03.433 : INA233 STATUS 1010010000000000
    I 03.433 : INA233 INPUT_STATUS 00000000
    I 03.433 : INA233 4027 mV (BUS)
    I 03.433 : INA233 402 µV (SHUNT)
    I 03.433 : INA233 4025 µA
    I 03.434 : INA233 16250 µW
    I 03.434 : INA233 EIN 39878, samples 4338, (rollovers 0)
    I 03.434 : INA233 5745 µW / 1426 µA, 4783 ms (906 samples/s)
    I 03.434 : INA233 27 mWs 6 mC
    OK

    Same issues using "CLEAR_EIN" instead of auto clear.

  • ina
    I 47.715 : INA233 MFR CONFIG 00000010
    I 47.715 : INA233 MFR ADC CONFIG 0100000011011111
    I 47.716 : INA233 STATUS 1010010000000000
    I 47.716 : INA233 INPUT_STATUS 00000000
    I 47.717 : INA233 1 waits
    I 47.719 : INA233 STATUS 1010010000000000
    I 47.719 : INA233 INPUT_STATUS 00000000
    I 47.720 : INA233 4026 mV (BUS)
    I 47.720 : INA233 217 µV (SHUNT)
    I 47.720 : INA233 2175 µA
    I 47.720 : INA233 9375 µW
    I 47.720 : INA233 EIN 1958833, samples 213901, (rollovers 29)
    I 47.720 : INA233 5723 µW / 1421 µA, 235874 ms (906 samples/s)
    I 47.720 : INA233 1349 mWs 335 mC
    OK
    ina
    I 54.299 : INA233 MFR CONFIG 00000010
    I 54.300 : INA233 MFR ADC CONFIG 0100000011011111
    I 54.300 : INA233 STATUS 1010010000000000
    I 54.301 : INA233 INPUT_STATUS 00000000
    I 54.301 : INA233 1 waits
    I 54.303 : INA233 STATUS 1010010000000000
    I 54.304 : INA233 INPUT_STATUS 00000000
    I 54.304 : INA233 4028 mV (BUS)
    I 54.304 : INA233 175 µV (SHUNT)
    I 54.304 : INA233 1750 µA
    I 54.304 : INA233 6875 µW
    I 54.304 : INA233 EIN 54368, samples 5971, (rollovers 0)
    I 54.304 : INA233 5690 µW / 1412 µA, 6584 ms (906 samples/s)
    I 54.304 : INA233 37 mWs 9 mC
    OK
    ina
    b 56.356 : INA233 MFR CONFIG 00000010
    b 56.356 : INA233 MFR ADC CONFIG 0100000011011111
    b 56.357 : INA233 STATUS 1010010000000000
    b 56.357 : INA233 INPUT_STATUS 00000000
    b 56.358 : INA233 2 waits
    b 56.359 : INA233 EIN samples 0 for 2057 ms, retry.
    b 56.359 : INA233 STATUS 1010010000000000
    b 56.359 : INA233 INPUT_STATUS 00000000
    b 58.361 : INA233 EIN samples 0 for 4059 ms, retry.
    b 58.361 : INA233 STATUS 1010010000000000
    b 58.361 : INA233 INPUT_STATUS 00000000
    I 60.364 : INA233 STATUS 1010010000000000
    I 60.365 : INA233 INPUT_STATUS 00000000
    I 60.365 : INA233 4030 mV (BUS)
    I 60.365 : INA233 317 µV (SHUNT)
    I 60.365 : INA233 3175 µA
    I 60.365 : INA233 12500 µW
    I 60.365 : INA233 EIN 49982, samples 5496, (rollovers 0)
    I 60.365 : INA233 5683 µW / 1410 µA, 6061 ms (906 samples/s)
    I 60.365 : INA233 34 mWs 8 mC
    OK
    ina
    I 75.215 : INA233 MFR CONFIG 00000010
    I 75.215 : INA233 MFR ADC CONFIG 0100000011011111
    I 75.216 : INA233 STATUS 1010010000000000
    I 75.216 : INA233 INPUT_STATUS 00000000
    I 75.219 : INA233 STATUS 1010010000000000
    I 75.219 : INA233 INPUT_STATUS 00000000
    I 75.219 : INA233 4030 mV (BUS)
    I 75.219 : INA233 317 µV (SHUNT)
    I 75.219 : INA233 3175 µA
    I 75.219 : INA233 12500 µW
    I 75.219 : INA233 EIN 123322, samples 13536, (rollovers 1)
    I 75.219 : INA233 5694 µW / 1412 µA, 14926 ms (906 samples/s)
    I 75.219 : INA233 84 mWs 20 mC
    OK
    ina
    I 89.145 : INA233 MFR CONFIG 00000010
    I 89.145 : INA233 MFR ADC CONFIG 0100000011011111
    I 89.146 : INA233 STATUS 1010010000000000
    I 89.146 : INA233 INPUT_STATUS 00000000
    I 89.147 : INA233 2 waits
    I 89.149 : INA233 STATUS 1010010000000000
    I 89.150 : INA233 INPUT_STATUS 00000000
    I 89.150 : INA233 4030 mV (BUS)
    I 89.150 : INA233 325 µV (SHUNT)
    I 89.150 : INA233 3250 µA
    I 89.150 : INA233 13125 µW
    I 89.150 : INA233 EIN 114734, samples 12633, (rollovers 1)
    I 89.150 : INA233 5676 µW / 1408 µA, 13931 ms (906 samples/s)
    I 89.150 : INA233 79 mWs 19 mC
    OK
    ina
    b 96.243 : INA233 MFR CONFIG 00000010
    b 96.243 : INA233 MFR ADC CONFIG 0100000011011111
    b 96.244 : INA233 STATUS 1010010000000000
    b 96.244 : INA233 INPUT_STATUS 00000000
    b 96.245 : INA233 EIN samples 0 for 7097 ms, retry.
    b 96.246 : INA233 STATUS 1010010000000000
    b 96.246 : INA233 INPUT_STATUS 00000000
    I 98.249 : INA233 STATUS 1010010000000000
    I 98.249 : INA233 INPUT_STATUS 00000000
    I 98.249 : INA233 4028 mV (BUS)
    I 98.249 : INA233 305 µV (SHUNT)
    I 98.249 : INA233 1175 µA
    I 98.249 : INA233 12500 µW
    I 98.249 : INA233 EIN 75266, samples 8251, (rollovers 1)
    I 98.249 : INA233 5701 µW / 1415 µA, 9099 ms (906 samples/s)
    I 98.249 : INA233 51 mWs 12 mC
    OK

    That's some logs using the "diff" instead of try to clear EIN.

    Also here, EIN seems to stick to some values and later it's possible to read EIN. But "later" may be several seconds.

  • > It may also be worth swapping the device to see if the device is malfunctioning. 

    Unfortunately digikey nor mouser have no INA233EVM in stock ;-(.

    Same for arrow.

  • Hi Achim, 

    A good way to decipher whether or not it is a microcontroller is to use the INA233 EVM GUI which is located here: https://www.ti.com/tool/INA233EVM. This would let you know whether it is a device issue or a setup issue. Also, having a scope shot showing the I2C levels will help us as everything would be 100% visible there, rather than viewing things on either side of the setup. Please let me know if you have any questions

    Best,

    Mohamed 

  • Hi Mohamed,

    that App doesn't read EIN "automatically", you need to press a read button frequently. If TI has implemented a "trick" in that app, then that's what I'm asking for. Just using the PC App doesn't help.

    It's really irritating, that reading all the other values/registers works well, but EIN fails randomly. It seems, the the I2C stuff works also with the EIN, but the actual values of the 6 bytes are curious. With auto-clear it read EIN, but sometimes it doesn't clean it. Reading without auto-clear it sometimes read the same bytes for several seconds and then continues as the internal EIN have been update, but not forwarded to the I2C.

    Are there errata's for the INA233? What's the newest Document?

    Otherwise, I guess I need to wait for INA233EVMs gets again available.

  • Is there something as a "reference implementation", e.g. for Arduino?

  • Hi Achim, 

    I will look into this and get back to you by Monday. I apologize for the inconvenience. 

  • Hi Mohamed,

    digikey was much faster than I assumed. I received today a new INA233 (no EVM-Kit) and put that plain INA233 on a board. The irritation is gone. I consider, it was just a broken device.

    Thanks for your help.

  • Hi Achim,

    I'm glad we got this figured out! Thank you for using E2E, and please let me know if you have any further questions. For now I will close the thread.