Other Parts Discussed in Thread: INA228, TI-SCB, SYSCONFIG
Hello,
The INA238 is out of stock everywhere but I really need it and find someone on Aliexpress selling it. I bought it and tested 2 units, and the result below is the same.
I wrote a driver from scratch so it's possible I made a mistake. I recorded the I2C transaction with a logic analyzer, please find the log file below:
write to 0x45 ack data: 0x00 0x80 0x00
write to 0x45 ack data: 0x3E
read to 0x45 ack data: 0x54 0x49
write to 0x45 ack data: 0x3F
read to 0x45 ack data: 0x22 0x81
write to 0x45 ack data: 0x00 0x00 0x10
write to 0x45 ack data: 0x00
read to 0x45 ack data: 0x00 0x00
write to 0x45 ack data: 0x02 0x27 0xC0
write to 0x45 ack data: 0x02
read to 0x45 ack data: 0x27 0xC0
write to 0x45 ack data: 0x01 0xF4 0x92
write to 0x45 ack data: 0x01
read to 0x45 ack data: 0xF4 0x92
write to 0x45 ack data: 0x06
read to 0x45 ack data: 0x00 0x00
write to 0x45 ack data: 0x05
read to 0x45 ack data: 0x00 0x00
write to 0x45 ack data: 0x0B
read to 0x45 ack data: 0x00 0x00
As you can see, I first reboot the device by writing 0x8000 in the config register. Then I can successfully read "TI" in the company id register, but the first weird reply is the next one, I should read 0x2381 or 0x2380 but I'm reading 0x2281 (which is another TI reference though).
Then I'm writing 0x10 into the config register to set the scale range to 40mV. Then I'm reading the same register and got 0x00.
Then I'm writing 0x27c0 into the shunt calib register and I read back 0x27c0, so everything is ok here.
Then I'm writing 0xF492 into the ADC config register and I read back 0xF492, same, ok here.
But then, I'm reading the bus voltage register (I plugged a 3V supply on it) and the temperature register but I get 0x0000 for both.
Lastly I'm reading the DIAG_ALRT register and get 0x0 when I should read 0x1. 0x0 means "a checksum error is detected in the device trim memory space."
I confirm that I have the exact same result with 2 different units soldered on 2 different custom boards. If it was fake, I shouldn't read any register right? Do you have an idea on this issue?
Thanks for your help,
Arthur