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.

ADS1231: Converting 32 bit ADC raw data to meaningful values.

Part Number: ADS1231

Hello.

I am using an Arduino Uno to read ADC Values from 24 bit ADS1231. 

I have used this code below to convert the 24 bit adc value to 32 bits which seems to work fine now if I press my sensor for positive push: (zero+offset) to 0x7FFFFF and (0+offset) to 0xFF8000000 for negative push. 24 bits for positive and 32 bit for negative which seems to be working as expected?.

Now I just need to know how to convert this number to something more meaningful like instead of going from negative full scale 0xFF8000000 to 0  midpoint to 0x7FFFFF positive full scale. I would like to have it like 0 to X where 0 is equivalent to 0xFF8000000, X/2 is equivalent to midpoint and X is the postive full scale. How do I achieve this code? 

code:

X = bit24 & adcvalue; // zero-ing the rest of the adcvalue bits except the sign bit.
   if(X==bit24) // if sign bit is = 1
   {
     adcvalue_32bit = adcvalue+0xFF000000; // sign extend adc value to 32 bit
   }
   else        // sign bit is = 0
   {
     adcvalue_32bit = adcvalue+0x00000000; // sign extend adc value to 32 bit
   }

 



  • kev,


    This is more of a coding question than a ADS1231 question. In general, we offer more help when the question centers on the ADC and how to use it.

    That being said, I don't think it is difficult to change the ADC code to show a unipolar value. Just add 800000h to any ADC output, while ignoring any change in the overflow bit. This would change the ADC output to scale from 000000h to FFFFFFh (without two's complement notation).

    If the ADC output is negative full scale, 800000h, adding 800000h converts it to 000000h (again ignoring the overflow bit as a carry). If the ADC output is at 0, 000000h, adding 800000h makes it 800000h. If the ADC output is positive full scale 7FFFFFh, adding 800000h converts it to FFFFFFh. The lower three bytes can be converted to decimal going from 0 to 16777215.

    For convenience, you may want to keep the number in a 32-bit format. If you do, you'll want to remove the carry bit by converting the most significant byte to 0s. Regardless, this will still scale the output from 0 to a 16777215.


    Joseph Wu
  • I have got the converted values in binary format and if I convert them to voltages.
    With 3.04V VREFP - LSB size = 1.41*10^-9 and with no load on my full bridge load cell I get average readings of 341000 in decimal @ 10sps and 333200 @80sps. So converting these adc codes to voltages @10sps : 341000* 1.41*10^-9 = 0.48mV (which is roughly what I read if I measure between Vinpp-Vinpn)
    My question is:
    How are the values on page 7 of the data sheet obtained. The Noise vs. Time graphs. The conversion data (nV) how is that obtained? because as I have converted above the adc codes to voltages the results are in mV not in nV so which conversion data is this? is there some formula that I am missing to do these conversions for noise?
  • Hi Kev,

    Please see my response to a similar question you posted here:

    https://e2e.ti.com/support/data_converters/precision_data_converters/f/73/p/629544/2321602#2321602

    Best regards,

    Bob B