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.

Determining and using ADC calibration constants

Other Parts Discussed in Thread: MSP430FG4618, CC430F5137

The 2xx family chips have ADC and other calibration data in the information memory; the 5xx ones put it in TLV memory.  As far as I can see, there is no discussion of chip-specific calibration data for the 4xx chips in either the family user's guide or in the device data sheet.  The one 4xx part I have (an MSP430FG4618 in the experimenter's board) has nothing in information memory.

Is there no factory-provided calibration information in the 4xx family?

I'm a bit confused that the 5xx family guide in section 1.13.4 suggests that both REF calibration and ADC offset and gain calibration are relevant for correcting raw ADC readings, but don't describe when each should be used, or the application order if both should be used.  Oddly, neither do any of the family sample code modules I've found.  In practice, only by using both (REF factor first, then gain, then offset) do I get answers on a CC430F5137 for INCH_11 for 2.0 and 2.5 V internal reference conversions that match and are within 0.5% of what my meter tells me.  This suggests I really need both.

Is there an application note describing the process for calculating the ADC calibration values, including the voltages used and how to decouple the reference factor from the gain and offset?

  • The 4x as well as the 5x family do have an FLL for DCO stabilization, so none of them has calibration constants for the DCO.

    In the 4x family users guide, I don't see any reference to calibration data for reference voltage or ADCs. So I guess there is none.
    Info memory was not meant to hold factory-stored calibration data (it has been abused for this in 2x family), but rather for holding application information that would be difficult to store in main flash memory (just because it is difficult to know where to store it, including the flash segmentation problem that doesn't allow you to just link a flash data segment behind your code)

    About the 5x family calibration data, well, the only mentioning of calibration data in the users guide is in the ADC12 temperature sensor section.
    All other calibration stuff is device-specific, and there is no notice of how it is to be interpreted/used.

    Since external circuitry is also subject of gain errors and maybe offsets, I usually calibrate the inputs in-circuit. One offset and gain factor for all: reference, input and external circuitry.

    Peter Bigot said:
    how to decouple the reference factor from the gain and offset?

    To tell the reference error from ADC gain error, you'll need an external reference voltage.
    As long as you use the internal reference, both melt to a single value and you cannot tell whether it is the ADC gain or the reference that's wrong, as both are causing a proportional difference.

  • Unfortunately, after reading this I'm left with no more information than I started with.  It's nice to know that you too were unable to find information on 4xx (non-DCO) calibration constants or any documentation on how to use the ADC constants in the other chip families.  All that means is neither of us have found it; not that the information doesn't exist.  There is still clearly a correct way to use the constants, and clearly a way that TI uses to measure them in the other families.

    I can provide an external reference voltage if necessary.  Even if I ultimately were to use an in-circuit calibration, I would be more confident in that result and would understand it better if I were able to validate the process by matching the constants provided by the chip.

    So the questions remain: what is the proper way to use the factory-provided calibration constants, and what process can be followed to derive them?

  • Peter Bigot said:
    after reading this I'm left with no more information than I started with

    Not exyctly true, because:

    Peter Bigot said:
    It's nice to know that you too were unable to find information

    That's soem information you didn't have before, reducing the probability that you just missed it in the docs.

    Peter Bigot said:
    All that means is neither of us have found it; not that the information doesn't exist.

    That's right. The impossibility of negative proof applies here :)

    I added one more point (of many) to my notes about documentation issues. And yes, I re-read the 5x family chapter and have the same problems as you have.
    My guess (and it's only a guess, but based on reason) is that you first do an offset an gain correction to get the 'real' ADC reading. This is relative (and therefore independent) of the used reference (might even be an external one). I think it is, because there is only one offset/gain value and not one for each reference. So it must be reference-independent and therefore applied first.
    To get the actual voltage, you need to know the used reference, which is the nominal reference voltage corrected by the calibration factor.
    Applying the reference calibraiton value on the ADC reading instead of applying it on the reference voltage in the ADCMEM -> voltage formula is a mistake IMHO.

    P.s.: Maybe you noticed that in the temperature sensor formula, the ADC offset and gain are not used at all, nor is the reference calibration value. Because both, temperature sensor and ADC work both based on the same reference, so the temperature sensor gain value and offset compensate for the ADC offset and gain error too.

     

     

  • Jens-Michael Gross said:
    My guess (and it's only a guess, but based on reason) is that you first do an offset an gain correction to get the 'real' ADC reading. This is relative (and therefore independent) of the used reference (might even be an external one). I think it is, because there is only one offset/gain value and not one for each reference. So it must be reference-independent and therefore applied first.

    Or it might be reference-independent because you're supposed to correct for the reference first, then apply gain/offset correction.

    As I said originally, experimentation shows that both must be applied to get the correct answer.  On the devices I've checked, the offset is insignificant (-1), so the order doesn't make any practical difference.  It sure would be nice to get authoritative information, though, as it would make a difference if the calibrated offset were large enough.

    Jens-Michael Gross said:
    To get the actual voltage, you need to know the used reference, which is the nominal reference voltage corrected by the calibration factor.
    Applying the reference calibraiton value on the ADC reading instead of applying it on the reference voltage in the ADCMEM -> voltage formula is a mistake IMHO.

    Could be, though I once convinced myself that was the effect of applying the calibration to the ADC reading.

    As for how to do the calibration, it looks like Atmel provides some application notes that explain how they do it for their chips.

  • Peter Bigot said:
    Or it might be reference-independent because you're supposed to correct for the reference first, then apply gain/offset correction.

    No, because the reference correction does not normalize the reference. You're still on 1.5, 2 or 2.5V, which should result in a different offset with a factor of 1, 0.75 and 0.6 (as the offset usually is a constant voltage, and therefore a significantly different percentage of the value range for different references).
    However, the offset could be as well cause by a bug in the digital part and adds/subtracts a constant value from the reading. Not very likely, but then indeed independent of the reference.

    Peter Bigot said:
    Could be, though I once convinced myself that was the effect of applying the calibration to the ADC reading.


    Well, since it is a system of several equations with several variables, you can put the factor here or there, as long as it is treated equally in all equations.
    But the basic formula is V = (ADCMEM * Vref / 4095), so the reference correction factor belongs to Vref (since without it, Vref is takes as it should be and not as it really is), while offset and gain correct ADCMEM readout.

    Hmmmh, it still doesn't make much sense. At least the offset will definitely be different for different references.
    What would make sense would be an offset directly in Volt, to be subtracted from the resulting voltage rather than from the ADC reading. The gain is reference-independent. But then, the gain needs to be aplied after subtracting the offset or needs to be applied to the offset too, which makes the offset reference voltage dependent again.

    On the bottom line, only one gain/offset pair for any reference makes no sense. One variable too much for the given number of equations.

**Attention** This is a public forum