Tool/software:
Hi experts,
I read the result register for current measurement 1000 times. I found that I got negative value(unit: V), but it shouldn't be like this.
here is our pin definition schematic.
I need you double confirm my parameters writting in config register and my conversion.
Our HW member use the scope to see the AIN1 and GND, it shows the value almost to keep on the 3.3V, and rarely down to -100 mV, but never shows the negative value lower than -1V.
Take AIN1 and GND as an example to discuss. Based on the data sheet, the sequence would be (1)write config, (2)wait (3) read result:
1. The value prepared to write is 0xD383 (1101 0011 1000 0011), I use linux cmd
# i2cset -y 3 0x48 0x01 0xD3 0x83 i
I also change the byte order such as # i2cset -y 3 0x48 0x01 0x83 0xD3 i, but it will get the negative value as well.
here is the detail:
OS : 1 : Start a single conversion (when in a power-down state)
MUX: 101 : AINP = AIN1 and AINN = GND
PGA: 001 : FSR = ±4.096 V(1)
MODE: 1 : Single-shot conversion mode or power-down state
RD: 100 : DR = 1600 SPS (default)
2. Wait a second.
3. Then, I got result value from the result register: 0xb001 with cmd
# i2cget -y 3 0x48 0x00 w
4. Based on the data sheet, the result is over 0x7FF0, I take it with NOT operation, the result turns to 0x4FFE, then reserve higher 3 byte, I got 0x4FF
5. The final step, multiple the resolution 2 mV with 0x4FF = 2*1279 mV = 2558 mV, so the voltage differential is – 2.558V
Are there any wrong conversion steps or parameters in my example? thanks.
Best regards,
Tony Liu