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.

ADS7142: how to translate the raw adc value from the i2c read result

Part Number: ADS7142


HI 

we now can read the raw value from the channel AIN0 or AIN1 :

value = ads7142_i2c_read(REG_ACC_CH0_MSB);
value <<= 8;
value |= ads7142_i2c_read(REG_ACC_CH0_LSB);
return value;

if the raw value could be used as the adc result directly without any revising on it ?

  • Hello,

    As a debug suggestion, use a known DC value and compare the measured ADC value to the known DC input. This will help to confirm you are reading the correct data and from the correct channel.

    Using the raw data from the device as-is depends on your system, and how the firmware is set up. if your system can support their needed task with analyzing the raw data, then you can move forward as it

    But if your system needs to use voltage values of the measured data, then you will need to find the LSB value of your system, using equation 1 in the datasheet      (LSB = FSR/(2^12)

    then take this value and multiply it by the decimal equivalent of the ADC output data.

    Regards

    Cynthia

  • Hi  

    thanks for your suggestion, now we use the high precision mode , (LSB = FSR/(2^N),we use N=16.  the FSR is 1.8V.  we calculate the voltage output from the adc value . but the voltage value has an error with the input voltage  .

    how we correct it ?

    for example: we get the raw value is 27619,  the voltage value  calculated is  27619/65535*1.8= 0.785v .while the input value we measured is 0.805v

    thanks 

  • Hello,

    The high precision mode of this device still uses a 12bit measurement, then takes sixteen of those measurements and averages them together.

    This effectively gives you an LSB size using N=16

    Also note that in this mode, the data is read from the ACCUMULATOR_DATA register and not the data buffer

    Using this mode also slows down how often new valid data is available as sixteen samples need to be collected. On page 39 of the datasheet the high precision mode section is found.  There is also equations about the accumulator in the datasheet on page 24 to calculate the high precision data.

    If the input source is not stable or clean, then the average of the consecutive samples may reflect different than the instantaneous measurement of the input. But it does seem as you are calculating it correctly. I would suggest using a clean, stable DC source and monitoring it during the conversion to see if it is moving.  Remember that the LSB for a 16 bit device is in the microvolts, thus movement in the input in that same range will affect the ADC measurement. It does not have to be big change to be reflected in a 16 bit measurement

    Regards

    Cynthia