Electronic – LTC2485 I2C Data Format

adcdatasheeti2c

I am trying to understand the I2C data format of a 24 bits ACD (LTC2485).

The data sheet says it returns 4 bytes (32 bits integer), but is unclear as to where the 24 bits I seek are located.

Here is what I do not understand :

The role of the bits 31 and 30

The two most significant bits (30, 31) are used to indicate over range or under range conditions. They are also used to tell in which "quater" of the full range the signal is located.

The documentation says: If the bit 31 is set, then the signal is between 0V and +Vref otherwise, the signal is between -Vref and 0V.

I understand this as: if the signal is between 0V and +Vref, the code is between 2^23 and 2^24 and if the signal is between -Vref and 0V the code is between 0 and 2^23.

A similar reasoning can be used for bit 30, and Vref/2. That's how binary number works. Both bits can be used to tell in which "quater" of the full range the signal is.

Form this, I guess that bit 31 is bit 23 of the signal, bit 30 corresponds to bit 22, and so on. Thus, the three first bytes should be my 24 bit code.

However, the documentation later tells:

The second bit is the most significant bit (MSB) of the result.

Which would indicate that the result is shifted by one bit. But later on:

The function of these two bits is summarized in Table 1. The next 24
bits contain the conversion results in binary two’s complement format.
The remaining six bits are Sub LSBs below the 24-bit level.

Which would indicate that the result is shifted by two bits, and that bits 31 and 30 are redundant (see my explanation above).

And last, the example code provided, uses … 32 bits instead of 24.

signed int32 x;
// Reading X
x ^= 0x80000000;
voltage = (float) x;
voltage = voltage * 5.0 / 2147483648.0;// Multiply by Vref, divide by 2^31

As a result, I feel lost. Given the 4 bytes I get (let's call them bytes 0 to 3 by order of retrieval) how do I get the voltage measured by the ADC ? What is the role of "The remaining six bits are Sub LSBs below the 24-bit level" ?

Thanks for reading me. The documentation of the part is available here. Explanations on the I2C data format are page 15.

Best Answer

LTC2485 is a "24-bit plus sign" converter. So, officially, there are 25 bits in 2's complement representation.

The 2's complement number is bits 30 to 0. The least significant 6 bits are not part of the 25 bits (sort of bonus garbage bits that probably have little meaning in most situations).

Bit 31 is more-or-less ** the complement of Bit 30 under normal conditions when the input is inside the normal operating range** (\$-0.5\cdot V_{REF} \lt V_{IN} \lt 0.5\cdot V_{REF}\$). If bit 30/31 are the same and the result bits are as shown in table 3 (all zeros with both high, or all 1s with both low), you know the input is larger or smaller than the reference voltage (overrange condition).

Oftentimes that would indicate a broken sensor or similar issue so you'd want to deal with it appropriately.

** except for a possible difference right at zero input.

enter image description here

enter image description here

So, your 25 bit signed result can be had by left-shifting the 32-bit number by one bit and masking out the least significant (now) 7 bits.

The least significant 6 bits are going to be pretty much all noise, but if you're doing calculations in double precision or 64 bit biased fixed point, it probably doesn't cost anything extra to use them (you can consider the result as a 31 bit signed number once you left-shift it). ENOB (Equivalent Number of Bits) of most ADCs is not better than about 20, bits and that's under ideal conditions.