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.

INA239: Read VBUS at 0x0000 some rare times

Part Number: INA239
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I use INA239 to get VBUS and current.

I used Sysconfig.

Some rare case, I read 0x0000 on VBUS register. 

The ADC is configured as continuous.

I read the register asynchronously.

Should I check CNVR bit ?

If yes, how it works because it is configured in continuous mode ?

If not, what appends if the register is updated during the reading ?

Regards,

Sébastien

  • Hi Sébastien,

    There should be no need to check CNVR bit, the register stores previous result.

    The registers are buffered to prevent conflict like you described, ie, if conversion finishes during a reading communication, the register will be updated after the reading operation completes. This prevents bogus readings.

    I would make sure VBUS pin connection is solid. It might also be a good idea to inspect the SPI waveforms. This can help rule out potential math issues in the software.  

    Regards, Guang

  • Hi Guang,

    Thanks for your answer.

    I have 5 prototypes and I have the same problem on all boards. So it is not a connection problem.

    It happens on different voltages, so it is not on a specific voltage of VBUS.

    Do you have examples of bad use to obtain a value of 0x0000 on the VBUS register in continuous mode?

    It is very hard to inspect SPI bus during errors because it happens a couple of times on each 24 hours.

    Regards,

  • Hi Sébastien,

    After talking to colleagues, I found no similar cases. There have been one case where all-zeros were read but the device was damaged and it has other failures.

    Can you read other registers such as Shunt, and DIAG_ALRT to see if results/flags are as expected?   

    Regards, Guang

  • Yes, I can read the current register without any problem.

    I can read VBUS register with the right value most of the time (problem is seen 1/50000 reads)

    So it might be a timing problem, but how and why ?

    I have no interrupt on my firmware.

  • Hi Sébastien,

    Can you share your configuration and ADC settings? Maybe we could do an experiment on our end to see if we can duplicate the issue.   

    Regards, Guang

  • The configsys is on the first post. Do you need something else ?

    I use the code generated by SysConfig.

  • Hi Sébastien,

    We experimented with the same exact setting on an EVM, and didn’t find any erroneous reading after capturing a large amount of data.

    I understand it may not be easy, but I still think it is a good idea to capture the communication waveform when zero-reading happens. This might be the only way to tell if the issue comes from the IC itself.   

    Regards, Guang