An5250 PDF
An5250 PDF
An5250 PDF
Contents
1. Overview 1.
2.
Overview............................................................................ 1
ADC basics ........................................................................ 1
2.1. Defining ADC ......................................................... 1
This document explains the analog-to-digital converter 2.2. ADC block description ........................................... 2
(ADC) basics and the key parameters. The document 2.3. ADC terminology ................................................... 4
also lists the ADC errors sources and how to increase 3. ADC errors......................................................................... 6
3.1. ADC errors related to itself ..................................... 6
ADC accuracy from system point of view. 3.2. ADC errors related to the whole system ................. 9
4. How to increase the ADC accuracy ................................. 12
This application note uses the ADC embedded in the 4.1. Reduce the effects of the ADC-related errors ....... 12
Kinetis microcontroller as an example. However the 4.2. Minimize the ADC errors related to the external
same principles are applied to other ADCs too. The environment ........................................................................ 13
5. References........................................................................ 19
accuracy of analog to digital conversion has an impact 6. Revision history ............................................................... 19
on overall system quality and efficiency.
To be able to improve ADC accuracy, understand which
factors affect errors. The ADC itself, can’t fully ensure
the accuracy of results, it depends on the overall system
design.
For this reason, carefully prepare before starting your
development. Many factors including voltage reference,
PCB layout, I/O switching, and analog source
impedance and so on can affect the ADC accuracy
depending on the application.
2. ADC basics
In the real world, signals mostly exist in analog form. You can use the ADC of the microcontroller to
sample such signals, so that the signals can be converted to the digital values. The application software
can then process the digital outputs and make decisions depending on the actual requirements.
The limitation imposed by the finite number of digital outputs decides how close the output is to the
analog input. In order to get closer between digital result and analog signal, the higher resolution of
ADC is needed.
At the end of all the comparisons you get the corresponding digital output for the analog input. The
successive approximation steps are shown in Table 1. The digital output obtained from the ADC is D5h
when the analog input is 2.75 V.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
2 Freescale Semiconductor, Inc.
ADC basics
For ADC end user, it is important to note the ADC inputs and multiplex logic, conversion speed and
triggering logic, calibration logic, and conversion result processing, as described in Figure 2.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 3
ADC basics
2.3.2. Resolution
The ADC resolution is defined as the smallest incremental voltage that can be recognized and thus
causes a change in the digital output. It is expressed as the number of bits output by the ADC. Therefore,
an ADC which converts the analog signal to a 12-bit digital value has a resolution of 12 bits.
The smallest incremental voltage that can be recognized is expressed in terms of LSB.
1 LSB = (VAREF - VSS)/2n
Where LSB = Least-significant bit
n = Number of digital bits output by the ADC
VAREF = Reference voltage
VSS = Analog ground
An ADC which has ‘n’ bit digital output provides 2n digital values. It includes both 0 and 2n-1.
With a 3.3 V reference voltage, the resolution is 3.3/212 = 3.3/4096 = 0.805 (mV).
2.3.3. Quantization
The quantization of an analog signal by the ADC can be processed only in the finite number of steps
which can be produced by the ADC.
The quantization error is the error introduced by the process of quantization. Ideally, any analog input
voltage can be maximum of 1/2 LSB away from its nearest digital code. Therefore, the quantization
error is 0.5 LSB for the ADC.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 5
ADC errors
3. ADC errors
This section lists the ADC errors related to itself and the whole system.
Digital Output
Eo > 0
2
Actual transfer curve
1
0.5LSB VAIN
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
6 Freescale Semiconductor, Inc.
ADC errors
Digital Output
4095
EG > 0
4094.5LSB VAIN
0.5LSB
ED > 0
Actual step
1LSB
width
ED < 0
VAIN
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 7
ADC errors
EL
2
Actual transfer curve
1
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
8 Freescale Semiconductor, Inc.
ADC errors
Digital Output
ET
VAIN
V
Vref = 3.3V
(4095h)
Unused ADC translation range
2.5V
(3102h)
t
Figure 9. ADC dynamic range
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
10 Freescale Semiconductor, Inc.
ADC errors
The charging of the internal sampling capacitor Csh is controlled by switches with resistance Rsh. With
the addition of source resistance (with RIN), the time required to fully charge the hold capacitor
increases.
Figure 10 shows the analog signal source resistance effect. The effective charging of CADC = CIN+ Csh is
governed by RIN+ Rsh, so the charging time constant becomes tc = (RIN+Rsh) × CADC. The required
settling time to be safe to sample the input is tc x multiplier, where the multiplier is 11, 8.3, 6.93
respectively for ADC resolution of 16-bit, 12-bit, and 10-bit. If the sampling time is less than the settling
time required, the digital value converted by the ADC is less than the actual value. Therefore, ensure
that the analog signal source resistance be within the ADC specification.
SW(S/H)
RIN Rsh
+ + CIN Csh +
VIN - Vcsh(t)
(Vcin0) (Vcsh0)
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 11
How to increase the ADC accuracy
Digital and analog signal passing Digital and analog signal tracks Recommended Grounding
close to each other crossing each other on different between signals
side of the PCB
ADC
Noise induced
Internal noise
from PCB tracks
As the ILE is the integral of the DLE, it can be considered as the indicator of the maximum error. Do not
add the DLE and ILE together to calculate the maximum error that may occur at any digital step.
The maximum error values specified in the datasheet are the worst error values measured in laboratory
test environment over the given voltage and temperature range.
The ILE and DLE are dependent on the ADC design. It is difficult to calibrate them. They can be
calibrated by the measured ADC curve stored in the microcontroller memory but this needs calibration
of each individual device in final application.
Offset and gain errors can be compensated using the Kinetis ADC self-calibration feature or by
microcontroller firmware.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 13
How to increase the ADC accuracy
4.2.3. Matching the ADC dynamic range to the maximum signal amplitude
This method improves accuracy by a proper selection of the reference voltage or by using a preamplifier
stage to obtain the maximum possible resolution using the full ADC output range.
The reference voltage is selected in the expected range of the signal to be measured. If the measured
signal has an offset, then the reference voltage should also have a similar offset. If the measured signal
has defined maximum amplitude, then the reference voltage should also have a similar maximum value.
By matching this reference voltage to the measurement signal range, we obtain the maximum possible
resolution using the full ADC output range.
In Kinetis device, the ADC reference voltage is connected to the external VREFH and VREFL pins that
should be tied to ground. This makes it possible to match the reference voltage and the measured signal
range. For example, if the measured signal varies between 0 V and 2.5 V, it is recommended to choose
VREFH = 2.5 V, possibly using a reference voltage like AD780.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
14 Freescale Semiconductor, Inc.
How to increase the ADC accuracy
the sampling time to be longer than the settle time. For more information on settling time, see the
AN4373. Always ensure that the analog signal source resistance be within the ADC specification.
Kinetis MCU
VAIN RAIN
+ AINx RADC
-
+
+
12-bit ADC - VSSA
Vc
VAIN
tc t
Digital and analog signal passing Digital and analog signal tracks Recommended Grounding
close to each other crossing each other on different between signals
side of the PCB
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 15
How to increase the ADC accuracy
Sensor Sensor
ADC ADC
Ground Loop
Do not ground the shield at both ends Ground the shield at the receiver end only
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
16 Freescale Semiconductor, Inc.
How to increase the ADC accuracy
Power supply
D1 C1
D C
Digital circuitry Analog circuitry
Digital Micro
Ground (Noise and noise controller
generating) (Affected by noise)
A1 B1
A B Analog
Ground
4.2.8.2. Separating the power supplies for the analog and digital circuits
It is desirable to have separate analog and digital power supplies in cases where there is a lot of analog
and digital circuits external to the microcontroller (see Figure 17).
If you use a switching-type power supply for the digital circuitry, you should use a separate linear
supply for the analog circuit. Also, if you expect a lot of noise on the DC power supply due to I/O
switching etc., it is preferable to use a separate supply for the analog circuit.
Also it is recommended to use star typology to supply power for analog and digital circuits to avoid
interference between each other.
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 17
How to increase the ADC accuracy
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
18 Freescale Semiconductor, Inc.
Revision history
5. References
Following references are available on www.nxp.com:
1. MPC57xx SAR ADC Implementation and Use (Document: AN4881)
2. Filter-Based Algorithm for Metering Applications (Document: AN4265)
3. FFT-Based Algorithm for Metering Applications (Document: AN4255)
4. Using the FFT on the Sigma-Delta ADCs (Document: AN4847)
5. Cookbook for SAR ADC Measurements (Document: AN4373)
6. Revision history
Table 2 is the revision history table.
Table 2. Revision history
Revision number Date Substantive changes
0 01/2016 Initial release
How to Increase the Analog-to-Digital Converter Accuracy in an Application, Application Note, Rev. 0, 01/2016
Freescale Semiconductor, Inc. 19
How to Reach Us: Information in this document is provided solely to enable system and software implementers to
use Freescale products. There are no express or implied copyright licenses granted hereunder to
Home Page: design or fabricate any integrated circuits based on the information in this document.
freescale.com
Web Support: Freescale reserves the right to make changes without further notice to any products herein.
freescale.com/support Freescale makes no warranty, representation, or guarantee regarding the suitability of its
products for any particular purpose, nor does Freescale assume any liability arising out of the
application or use of any product or circuit, and specifically disclaims any and all liability,
including without limitation consequential or incidental damages. “Typical” parameters that may
. be provided in Freescale data sheets and/or specifications can and do vary in different
applications, and actual performance may vary over time. All operating parameters, including
“typicals,” must be validated for each customer application by customer's technical experts.
Freescale does not convey any license under its patent rights nor the rights of others. Freescale
sells products pursuant to standard terms and conditions of sale, which can be found at the
following address: freescale.com/SalesTermsandConditions.
Freescale, the Freescale logo, and Kinetis are trademarks of Freescale Semiconductor, Inc., Reg.
U.S. Pat. & Tm. Off. All other product or service names are the property of their respective
owners. ARM, the ARM Powered logo, and Cortex are registered trademarks of ARM Limited
(or its subsidiaries) in the EU and/or elsewhere. All rights reserved.