How to get the best ADC accuracy AN2834
38/49 DocID15067 Rev 3
3.3.4 ADC calibration
This method requires knowledge of the internal ADC structure and of how the ADC
converter is implemented inside the microcontroller. This is necessary to design a
physical/mathematical model of the ADC implementation.
A proper physical model (which is usually a schem
atic diagram) is used as a basis for
describing it mathematically. From the mathematical model, each element in the model can
be obtained by a set of equations (for example, resistor/capacitor values which represent bit
weights). To solve these equations, it is necessary to perform a set of practical
measurements and obtain a set of solvable equations.
From the measured values and mathematical computation of the model, all the known
values of
model elements (resistors, voltages, capacitors,...) can be put into the schematic
diagram.
As a result, instead of the ADC sche
matic with the designed values, an ADC schematic with
the real values for a given microcontroller can be obtained.
Computed model parameters are stored in the microcontroller memory after calibration and
used in pos
t-processing to correct ADC values.
3.3.5 Minimizing internal CPU noise
When the CPU operates, it generates a lot of internal and external signal changes which are
transferred into the ADC peripheral through capacitive coupling. This disturbance influences
ADC precision (unpredictable noise due to different microcontroller operations).
To minimize influences of the CPU (and of other per
ipherals) on ADC, it is necessary to
minimize digital signal changes during sampling and conversion time (digital silence). This is
done using one of the following methods (applied during sampling and conversion time):
• minimizing I/O pin changes
• min
imizing internal CPU changes (CPU stop, wait mode)
• stopping clock for unnecessary peripherals (timers, communications...)