How to get the best ADC accuracy
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 schematic 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 schematic 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 post-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 peripherals) 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
•
minimizing internal CPU changes (CPU stop, wait mode)
•
stopping clock for unnecessary peripherals (timers, communications...)
38/49
DocID15067 Rev 3
AN2834
Need help?
Do you have a question about the STM32 and is the answer not in the manual?
Questions and answers