1.9 Best Practices for Improving ADC Performance
The performance of an ADC depends on the quality of the input signals and
power supplies. The following points should be taken into consideration for improving
the accuracy of ADC
measurements:
Note: Some points mentioned below might not
be applicable for all megaAVRs based on their feature set. Refer to
the
device data
sheet
for further information.
- Understand the ADC, its features, and how they are intended to be used
- Understand the application requirements
- Ensure that the source impedance is not too high compared to the sampling rate used. If the source impedance is too high, the internal sampling capacitor will not be charged to the correct level and the result will be inaccurate.
- It is important to take great care of the analog signal paths like analog reference (VREF) and analog power supply (AVCC). Use filtering if the analog power supply is connected to a digital power supply. That is, the AVCC pin on the device should be connected to the digital supply pin (VCC) via an LC network. For more information about this LC network, refer to the respective device data sheet.
- Keep analog signal paths as short as possible. It is also important that the impedance of the PCB tracks is not too high, as it will result in a longer charging period for the sample/hold capacitor of the ADC.
- Ensure that the analog tracks run over the analog ground plane
- Avoid having the analog signal path close to digital signal paths with high switching noise, such as communication lines and clock signals
- Consider decoupling of the analog signal between signal input and ground for single-ended inputs
- Avoid toggling of port pins while the ADC conversion is in progress in order to prevent the switching noise affecting the accuracy. The ADC is most sensitive to switching of the I/O pins powered by AVCC (PORTC).
- Disable digital input on the corresponding ADC channel to minimize the power consumption
- Switch off all unused peripherals by writing the corresponding bit in the Power Reduction register (PRR) to '1'
- Use the ADC noise reduction mode to get more accurate results
- Wait until the ADC, reference, or sources are stabilized before sampling, as some sources (for example, bandgap) need time to stabilize after they are enabled
- Before triggering an ADC conversion, wait until the ADC completes any ongoing conversions. Ensure that enough time is given for the reference and input source to be stabilized. For example, the bandgap voltage needs a certain amount of time to stabilize when it is selected as ADC input.
- Apply offset and gain calibration to the measurement
- Use oversampling to increase resolution and eliminate random noise
- AVCC must not differ more than ±0.3V from VCC
- The reference voltage can be made more immune to noise by connecting a capacitor between the AREF pin and ground
- For differential signals, the decoupling has to be between the positive and negative inputs. The decoupling capacitor value depends on the input signal. If the signals are switching fast, the decoupling capacitor must be lower.
- Whenever the input MUX setting or reference voltage selection is modified, it is recommended to discard the first conversion result
- When switching to a differential channel (with gain settings), the first conversion result may have a poor accuracy due to the required settling time for the automatic offset cancellation circuitry. Thus, it is better to discard the first sample result.
- Linear interpolation methods such as one-point (offset) calibration and two-points (offset and gain) calibration method can be used based on the application’s needs