Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

Offset Compensation incorrect using ADS1242

Other Parts Discussed in Thread: ADS1242, REF3012, ADS1247, REF3020, REF5020

I am using ADS1242 in the attached Pt100 measurement circuit.

2678.0772_001.tif

RT is a Pt100 sensor. Range approx 20R to 380R.
R1 sets the probe current at approx 400uA. It is reasonably constant over the measurement range.
R2 is a 200R reference resistor.
R3 ensures conditions for ADS1242 buffer inputs are satisfied. (>188mV)
Vp=Probe voltage (42mV @ RT=100R,  146mV @ RT=380R)
Vr=Reference voltage (84mV @ RT=100R,  77mV @ RT=380R)

The circuit has a fully ratiometric measurement therefore gain calibration of ADS1242 and absolute value of REF3012 do not affect the temperature measurement.

I need linearity to resolve RT (sensor) to 0.01R.
I am achieving approx 19 usable bits so I have plenty of resolution.
This 0.01R delta results in dVp=3.5uV and dVr=0.3uV.
I realise this is very close to the Maximum ±0.0015% FS integral-non-linearity of 2.3uV.

ADS1242 is configured for Buffer ON, PGA=8, Data rate=15Hz.
The converter essentially free runs with calibration commands and MUX changes synchronised to microprocessor interrupt triggered by falling edge of -DRDY.
The conversion results are transferred in main-line code approx 10ms after the interrupt routine ends.

The measurement sequence (for debugging) is:

1. Take -PDWN high.
2. ADS1242 Reset using timed SCK pulses.
3. WrReg (ACR, 0<<nDRDY | 1<<U_nB | 1<<SPEED | 1<<BUFEN | 0<<BITORDER | 0<<RANGE | 0<<DR1 | 0<<DR0); //15Hz
   WrReg (SETUP, 0<<ID | 0<<BOCS | 3<<PGA0); //Burnouts Off, Gain=8
   WrReg (MUX, 0x33);

4. On 2nd DRDY edge  - Issue SYSOCAL (2 dummy initial conversions)
5. On next DRDY edge - No Action; //Conversion with MUX=0x33 starts automatically
6. On 2nd DRDY edge  - Issue WrReg (MUX, 0x32); {Read PRT_ZERO counts in main code}
7. On 2nd DRDY edge  - Issue WrReg (MUX, 0x10); {Read PRT_REF  counts in main code}
8. On 2nd DRDY edge  - No Action;               {Read PRT_PRB  counts in main code}
                                                {Read OCR Register in main code}
9. Take -PDWN low.

I find offset calibration errors are causing big errors in sensor resistance measurement. The following table shows my results:

   RT    MUX=0x33  MUX=0x32  MUX=0x10     OCR   Calc RT   ADS1242   Comment
---------------------------------------------------------------------------
100.048   000000    89E296    44F5E4    000311  100.026   Unipolar  Non-Linear
380.080   000000    7DF6F6    EF64E6    00033E  380.100   +SYSOCAL

100.048   0002BD    89EA87    44FDD6    000000  100.041   Unipolar  Linear
380.080   000347    7E0025    EF6E0E    000000  380.064   No CAL    (Manual Offset)

100.048   FFFDB3    44F126    227B6E    0002D2  100.032   Bipolar   Non-Linear
380.080   FFFDEE    3EFC54    77B34F    0002C5  380.088   +SYSOCAL

100.048   00021C    44F543    227F18    000000  100.039   Bipolar   Linear (ish)
380.080   00015B    3F0011    77B727    000000  380.088   No CAL    (Manual Offset)

My question then is, why does SYSOCAL with MUX=0x33 not produce the same effect as performing a measurement of MUX=0x33 ? It seems to overcompensate thereby producing a -VE count for MUX=0x33 measurement.


  • Nigel,

    The way the SELFOCAL works is there is an internal short that takes place in the device, and the difference between the conversion result and zero is placed in the OCR register.  Then  when the system runs in normal operation, the value of the OCR is subtracted from each measurement.  This calibration does not take into account any outside affects.  The SYSOCAL needs you to place an external short at the inputs, otherwise it operates the same way.

    You might explore the differences between the two.  One thing to point out, every time you run the OCAL the numbers in the OCR may be different, even if on the same inputs.  This is often due to noise.  The REF3012 is not the best reference to use for 24 bit converters and this may be causing you some noise.  Some customers store OCR values at different mux positions, and then rewrite them to the OCR before taking a measurement.  That helps with maintaining consistency, as the values are in your control.

    Another device you may want to look at is the ADS1247 that has a built in reference, clock and current output DACs.  In this way you can achieve a much better ratiometric system.

    Best regards,

    Bob B

     

  • Hi Bob,

    Thank you for your reply. You reply has generated several more questions:

    1. When using the buffer, does SELFOCAL short both IN+ and IN- inputs to GND thereby violating Vin MIN Buffer ON  (GND + 0.05 V) ?

    2. Because I think SELFOCAL does violate Vin MIN, I use SYSOCAL with IN+ and IN- connected to the same MUX pin (i.e, MUX=0x33). I assumed this was a valid method of inputting 0V differential. Is this valid or invalid ? (I've been reading many other posts about offsets and cannot find anyone else who has mentioned this)

    Bob Benjamin said:
    The REF3012 is not the best reference to use for 24 bit converters

    You also say each time I run OCAL the results will be different. Well actually no ... within my 18 to 19 usable bits the counts are quite stable.

    3. What exactly is the problem with REF3012 ?

     

  • Nigel,

    Regarding 1, when SELFOCAL runs, the inputs are disconnected from the outside world and are internally shorted together.  So no, they are not connected to ground.

    For 2, the method you have been using should be ok, but if there is a slight offset at the mux, you might not catch it.  That is why I was curious to see if there is a difference between the SELFOCAL and the SYSOCAL.  Of course, the SELFOCAL won't show any mux offset either.

    And, you misquoted me.  I said there may be differences...not will be differences.... in the OCAL results.  If your supplies or reference is noisy, you may see a difference from cal to cal.  For example, the REF3012 has 14uVpp noise.  With that much noise, your 24 bit converter is now more like 18 or 19 bits.  It also has substantial drift at 50ppm.  Unfortunately I can't provide you with a better reference at this reference voltage.  We usually use the REF50xx family for 24 bit converters.  The REF5020 has 4ppm drift with 6uVpp noise.  The REF3020 has23uVpp noise.  So you can see that one reference is quite a bit better than the other.

    So if you are happy with throwing away the lower bits, the REF3012 is ok.  Just remember that the ocal is done at the 24 bit level.  I would try the SELFOCAL, which will just remove the converter offset, and then run your measurements again.

    Best regards,

    Bob B

  • Hi Bob,

    I've been working on another problem hence the delay in replying.

    Bob Benjamin said:
    Regarding 1, when SELFOCAL runs, the inputs are disconnected from the outside world and are internally shorted together.  So no, they are not connected to ground.

    Does that mean the common mode voltage at the buffer inputs isn't defined and depends on other factors ? Could it ever be out-of-spec ?


    I wanted to test your comments about MUX offset so have re-produced the table above but included external short circuit measurements.

       RT    MUX-0x33  MUX-0x32  MUX-0x10    OCR     Calc RT   ADS1242           Comment
    ------------------------------------------------------------------------------------
      0.000   000321    8ebef0    00031d    000000     0.000   Unipolar-No Cal   Linear
    100.048   000388    89ead0    450039    000000   100.051   (Manual Offset)
    380.080   0003ae    7e00b9    ef70c3    000000   380.076
     
      0.000   000000    8eb7b3    000000    0002e2     0.000   Unipolar+SYSOCAL  Non-Linear
    100.048   000000    89e384    44f7cd    000301   100.032
    380.080   000000    7dfab2    ef69dc    0002c6   380.084
     
      0.000   000000    8eb855    000000    000274     0.000   Unipolar+SELFOCAL Non-Linear
    100.048   000000    89e503    44f87a    00028a   100.034
    380.080   000000    7df95a    ef68de    000305   380.094


      0.000   0001ca    475ef0    0001c8    000000    -0.000   Bipolar           Linear
    100.048   0001e2    44f55c    227ffc    000000   100.049
    380.080   0001cb    3f00e1    77b871    000000   380.064

      0.000   fffdc9    475b51    fffdb9    000302    -0.025   Bipolar+SYSOCAL   Non-Linear
    100.048   fffe62    44f1c2    227bee    0002c3   100.035
    380.080   fffdbd    3efce0    77b51e    00023f   380.097

      0.000   fffe29    475b7f    fffe31    0002ba    -0.020   Bipolar+SELFOCAL  Non-Linear
    100.048   fffde9    44f28b    227c9b    000296   100.038
    380.080   fffdd1    3efc79    77b52e    0002d8   380.108

    Regarding MUX offset: Notice that the counts for 0 ohm measurement (MUX=0x10) are very similar to those for MUX=0x33. This gives me confidence that MUX=0x33 is an adequate method for measuring system offset.

    Lets examine the shift in each measurement's counts between performing No Calibration & performing OCAL.

    --- = -ve counts clipped at 0

       RT     MUX-0x33  MUX-0x32  MUX-0x10   OCR      ADS1242 Mode
    ----------------------------------------------------------------
      0.000     ---       73d       ---      2e2   Unipolar+SYSOCAL
    100.048     ---       74c       86c      301    321 Expected
    380.080     ---       607       6e7      2c6

      0.000     ---       69b       ...      274   Unipolar+SELFOCAL
    100.048     ---       5cd       7bf      28a    321 Expected
    380.080     ---       75f       7e5      305

      0.000     401       39f       40f      302   Bipolar+SYSOCAL
    100.048     380       39a       40e      2c3    1ca Expected
    380.080     40e       401       353      23f

      0.000     3a1       371       397      2ba   Bipolar+SELFOCAL
    100.048     3f9       2d1       361      296    1ca Expected
    380.080     3fa       468       343      2d8


    There are three things to notice here:

    1. The differences between SYSOCAL & SELFOCAL  seem to be lost in noise.

    2. The shift in counts after OCAL is much more than expected. As you can see it is approximately double.

    3. OCR value is substantially less than the actual shift in counts.

     

    Can you explain these observations please ?

     

    Regards

    Nigel

  • Nigel,

    I'm really having a hard time trying to figure out what you are trying to tell me.  The charts really don't mean much to me.  All the parts are tested and perform as shown in the datasheet.  If you are using the value in the OCR to determine the amount of offset in your system, that is the wrong approach.  The value in the OCR will be a correction value. This value could be huge (thousands of codes in some cases we've seen) and yes it will contain some of the actual device offset.

    If you run the SELFOCAL, you should get the datasheet performance for offset that is typically 7.5ppm of full scale.  You cannot use the OCR value and say that number is the device's offset.  That is the correction factor that is subtracted from the converted code so that a 0V differential input (shorted) gives the final result of 0 code.  You might argue that correction value is the offset, but that correction value takes non-analog (digital) effects into account also.

    If you run the SYSOCAL, it will take into account the offset that does exist as a part of the system, as well as the calculated value that the SELFOCAL considers.  Again, the OCR value is not the offset, but may  contain offset information.

    The best way to determine the actual offset is to run the calibration and then drive the system with a known voltage, then compare the output code with the known voltage.  It would appear that you would have some difficulty doing this as the offset error of the ADS1242 will be in your noise region.

    Best regards,

    Bob B

  • Hi Bob,

    Bob Benjamin said:
    If you are using the value in the OCR to determine the amount of offset in your system, that is the wrong approach.

    I am not using OCR in any way. I'm only reporting its value in the tables above. You have though, confirmed its absolute value isn't simply related to the output code. In effect answering my point No 3 above.

     

    Bob Benjamin said:
    If you run the SELFOCAL, you should get the datasheet performance for offset that is typically 7.5ppm of full scale

    Hmmm Not sure I agree. In the datasheet there is a footnote against Offset Error. - NOTES: (1) Calibration can minimize these errors. I read the value given as the error without OCAL.  What is not clear is how effective OCAL is at reducing this error.

    Also 7.5ppm is only at Vcc=5V & PGA=1. I have Vcc=3.3V & PGA=8 so must expect significantly worse offset. (I achieve 55ppm but am not complaining about that. I just want to correct for it)

     

    Bob Benjamin said:
    I'm really having a hard time trying to figure out what you are trying to tell me

    OK I have posted a large amount of data and we got side-tracked into discussions about noise , so I'll re-phrase the one important question I have:

    1. I reset the ADC. (ADC is therefore uncalibrated)
    2. I set MUX = 0x33. ( A measurement which ideally would give a result code = 0)
    3. I take a measurement and get a result of 0x1ca .
    4. I issue a SYSOCAL command (or even SELFOCAL - it makes little difference)
    5. I take another measurement and get a result of 0xfffdc9 (-0x237) .

    Question: Why does OCAL not shift my "zero" of 0x1ca closer to a count of 0 but instead over corrects and actually makes it worse (-0x237) ?

    Regards
    Nigel

  • Nigel,

    Thanks for bringing the discussion back around to the beginning.  I think that I'm able to better view your entire data set now.  Regarding the data, what do you specifically mean by unipolar vs bipolar.  Are you changing the Range bit?  Offset calibration should only be done with Range = 0.

    Also, I'm very curious to see a series of consecutive readings at the same mux position to see how consistent they are and if by averaging a series of readings the averaged value is closer to the desired value. 

     I apologize that I hadn't reread the entire post to see what voltage you were running at.  The offset will be typically 15ppm for PGA = 1, and will be slightly worse for PGA = 8.  I still think that what you are seeing is related to noise.  The series of data readings would be helpful for me to understand if that is really the case.  If there is 14uV of noise on the reference, and that noise is being gained by 8 at the input, I don't think that it would be unreasonable to see some kind of response in the data.  I understand your point about the nature of the readings you are getting.  You should be able to get very close to zero code after the calibration and the inputs shorted.  The range of codes you are getting from before cal to after cal is about 1000 codes peak to peak, which is about 19uVpp.

    I'm not exactly sure what is going on for the offset calibration other than it takes two tdata periods.  I do know that often times multiple readings are taken and an average is used.  Let's assume that there are multiple readings and an average value is used and placed in the OCR.  If the input is noisy, then the next reading could be above or below the predicted offset.  This could appear as over correction.  Again, seeing a series of readings may show this behaviour.

    Best regards,

    Bob B

  • Hi Bob,

    Bob Benjamin said:
    Regarding the data, what do you specifically mean by unipolar vs bipolar

    Unipolar / Bipolar refer to the UB bit in the ACR register.

    Bob Benjamin said:
    Are you changing the Range bit?

    Range = 0 throughout.

    I have taken 50 consecutive samples without any calibration and another 50 consecutive samples with SYSOCAL. I've sorted the readings and posted a graph. As you can see there are three or four outliers in each case but that the readings from one set of samples can never be confused with those from the other set. (NoCal always +ve, SYSOCAL always -ve)

    Regards
    Nigel

     

  • Nigel,

    This is strange that the data points are so similar in appearance.  Again, I think this is related to the reference.  First I would take more samples to see if the noise is oscillating or has some specific pattern.  You would probably benefit if your reference capacitor is close to the ADS1242 reference input.  You might also increase the value of the cap to 2.2-4.7uF.  At some point I think this reference will oscillate if the output capacitance is too large, so definitely don't go over 10uF.  This cap should also be a low ESR cap.  The reference input should also have a bypass cap of 0.47uF.  Bottom line, with shorted inputs you should only see about a +/-2ppm of full scale if you did a histogram plot.

    You might want to try and take a look at the reference output with a scope and see what it looks like with the ADS1242 converting.

    You might try a better reference.  The REF50xx family is a good reference family.  The REF5020 is 2.048V, which is the smallest output we offer for that family.  You would need to adjust your resistor values, but you would benefit by having less noise in your system.

    A third option, that I mentioned in an earlier post, is to use the ADS1247 and drive the RTD/Reference input ratio-metrically with the current DAC that is built into the ADS1247.  You will get better overall performance and see less drift issues using this part.

    Best regards,

    Bob B