TLA2024: I got the negative value, double confirm the way of read the result register and conversion.

Part Number: TLA2024

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

  • Hi Tony,

    I'll review this and get back to you by Thursday.

    Best Regards,

    Angel

  • Hi Angel, 

    I am looking forward to your feedback, thanks.

    Best regards,

    Tony Liu

  • Hi Tony,

    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

    I'm not too sure what you are doing in this step.

    Can you provide logic analyzer captures of when you do a data read from the ADC? This will help clarify what the actual binary value you are receiving from the ADC is, and confirm if it corresponds to what is being applied to the input pins.

    Best Regards,

    Angel

  • Hi Angel,

    3. Then, I got result value from the result register: 0xb001 with cmd

    Because I got the value from ADC, it's over 7FF0, shouldn't 0xB001 be converted to the negative value?

    Can you provide logic analyzer captures of when you do a data read from the ADC?

    I will be looking for support from our HW team.

    Do you think the value I got from ADC with byte order is wrong or entire value is wrong?

    Thank you.

    Best regards,

    Tony Liu

  • Hi Angel,

    Just in case I conduct the wrong conversion. Could you provide the conversion procedure of getting the value 0xb001 from ADC with below configuration?

     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

    Thank you.

    Best regards,

    Tony Liu

  • Hi Angel,

    I am another engineer who co-developed with Tony, and I would like to add and confirm some information.
    We need to read the current detection values ​​from the four channels (AIN0~3) of TLA2024.

    1. I want to confirm with you whether the method and address I read are correct?

    Follow the documentation Table 7. Configuration Register Field Descriptions:

    OS: 1
    MUX: 100
    (100: AINP = AIN0 and AINN = GND
    101: AINP = AIN1 and AINN = GND
    110: AINP = AIN2 and AINN = GND
    111: AINP = AIN3 and AINN = GND)
    PGA: 001 (default)
    MODE: 1
    DR: 100 (default)
    Reserved: 03h=00011 (default)

    So that the addresses for reading the four channels are as follows:
    AIN0 = 0xC583
    AIN1 = 0xD583
    AIN2 = 0xE583
    AIN3 = 0xF583

    For reading, I am using the i2c linux tool:


    Write Address:
    i2cset -y 3 0x48 0x01 0xC5 0x83 i


    Read Address Value:
    i2cget -y 3 0x48 0x00 w

    If I read value is 0xc029. According to the documentation, this is a 12-bit register, so I took the first 12 bits of the read value (0xc029), resulting in 0xc29.

    Is this correct?

    2. If I read a value between 0x8000 and 0xFFF0, how should I convert it?

    Is the above method correct? If there are any errors, please let me know.
    thank you!

    Best regards,
    Andrea Chen

  • Hi Andrea,

    I will take a closer look at the procedure and get back to you early next week.

    In the meantime, can you provide logic analyzer captures of the I2C communication lines when you do a conversion data read to help verify that the data from the ADC is being captured correctly?

    Best Regards,

    Angel

  • Hi Angel,

    Here are the logic analyzer captures of the I2C communication lines. We check the I2c signal and compare the oscilloscope value and the read value. The values are both 0xd017. Setting command and parameters: # i2cset -y 3 0x48 0x01 0xF3 0x83 i

    According to the value 0xd017, it hasoverflowed. We also measured the voltage of AIN3 on our board with the scope, and the result is that the minimum is 0.3V and the maximum is 3.88V.

     

    So I would like to ask, how should we calculate the value after reading 0x900e?

    Best regards,

    Tony Liu

  • Hi Tony Lui,

    The following table in the data sheet shows in detail how to convert between input signal voltage and output digital values:

    I believe the data from the ADC is not being interpreted correctly.

    For starters, since the TLA2024 is a 12-bit ADC, the last four bits of data when doing a conversion reading should be reserved (value of 0), which is not the case when you claim that you are receiving 0x900E:

    The oscilloscope capture is zoomed out, and it's hard to interpret what is going on without really having a more detailed capture of your digital communication transactions.

    Best Regards,

    Angel

  • Hi Angel,

    Do you have any suggestions for me to read the value of ADC? Is this correct?
    Looking forward to your reply.

    Thank you!

    Best regards,
    Andrea Chen

  • Hi Angel, 

    Sorry about that, the 0x900e is old content in my reply, I had updated my reply to replace 0x900e with 0xd017, but I missed updating the last sentence.

    The following table in the data sheet shows in detail how to convert between input signal voltage and output digital values:

    We did, but it shows the output value goes negative, it doesn't match the value we designed and measured by the oscilloscope. That's why we need you to confirm the conversion. Do you confirm my conversion in my first reply?

    I believe the data from the ADC is not being interpreted correctly.

    So do we, so we need your support, no more progress or removed bugs so far. I think we have verified the value from i2cget which match the value from ADC result register, am I right?

    For starters, since the TLA2024 is a 12-bit ADC, the last four bits of data when doing a conversion reading should be reserved (value of 0), which is not the case when you claim that you are receiving 0x900E:

    the decoder of the oscilloscope and value by i2cget show the same thing that the last four bits are not the value of 0 before we have the conversion. Or you can point out which steps we are doing wrong?

    The oscilloscope capture is zoomed out, and it's hard to interpret what is going on without really having a more detailed capture of your digital communication transactions.

    Do you want to zoom in on these six positions?

  • Hi Angel, 

    the decoder of the oscilloscope and value by i2cget show the same thing that the last four bits are not the value of 0 before we have the conversion. Or you can point out which steps we are doing wrong?

    ====> Or do you mean the value should be 17d0 in this case?

  • Hi Tony Liu,

    Yes the 6 positions captured would have to been zoomed in to verify what is actually being sent on the I2C lines by the device.

    An ADC reading of 0x17D0, with a FSR setting of +/-4.096V, would correspond to a voltage reading of 0.762V at the input pins.

    What is the actual signal being applied to each of the analog input pins, and what is the MUX configuration setting being used?

    Best Regards,

    Angel

  • Hi Angel,

         Thanks, I will look for our HW team support again, it will be provided next early week.

    An ADC reading of 0x17D0, with a FSR setting of +/-4.096V, would correspond to a voltage reading of 0.762V at the input pins.

    The conversion of these positive numbers is very clear. If the ADC reading is 0xD7D0 with an FSR setting of 4.096 scale level, what would be the voltage value from the input pins?

    What is the actual signal being applied to each of the analog input pins, and what is the MUX configuration setting being used?

    It is the configuration you are looking for. I quote again.

    Hi Angel,

    Here are the logic analyzer captures of the I2C communication lines. We check the I2c signal and compare the oscilloscope value and the read value. The values are both 0xd017. Setting command and parameters: # i2cset -y 3 0x48 0x01 0xF3 0x83 i

  • Hi Tony Liu,

    Yes, please provide more detailed captures of the I2C communication.

    The conversion of these positive numbers is very clear. If the ADC reading is 0xD7D0 with an FSR setting of 4.096 scale level, what would be the voltage value from the input pins?

    0xD7D0 would correspond to a voltage of -1.286V at the inputs.

    It is the configuration you are looking for. I quote again.

    Where is the comment on the input signal being applied?

    Best Regards,

    Angel

  • Hi Angel,

    here are the zoomed captures of the I2C communication.

    0xD7D0 would correspond to a voltage of -1.286V at the inputs.

    How do you calculate to -1.286V? my calculation is -1.284V. Could you list your operation?

    Where is the comment on the input signal being applied?

    Best regards,

    Tony Liu

  • Hi Tony Liu,

    Angel is out of the office today, we will respond to you in the next 1-2 days

    Thanks for your patience

    -Bryan

  • Hi Tony Liu,

    Thanks for providing the zoomed in I2C captures, I will take a closer look at these and get back to you tomorrow.

    Best Regards,

    Angel

  • Hi Toni Liu,

    I went over your I2C captures,

    They I2C communication looks correct.

    The first byte is 0x90 which is the device address and write bit.

    Second byte is 0x00 which is the pointer to the conversion register.

    Third byte is 0x91 which is the device address and the read bit.

    Fourth byte is the data MS Byte, which is 0x45

    Fifth byte is the data LS Byte, which is 0xA0.

    The conversion register data is therefore 0x45A0 (last four bits should always be zero, which they are here).

    With a Full-scale setting of +/-4.096V, 1LSB corresponds to 2mV.

    The ADC conversion result 0x45A in HEX corresponds to 1,114 in decimal.

    1,114 * 2mV = 2.228V

    The conversion result shown from your I2C captures, 0x45A0, corresponds to 2.228V.

    Best Regards,

    Angel