2 Overview
The ADC is a SAR with a sampling rate of up to 130 ksps, at 12-bit resolution. The ADC is connected to an analog input multiplexer for selection between multiple single-ended or differential inputs. In single-ended conversions, the ADC measures the voltage between the selected input channels and 0V (GND). In differential conversions, it measures the voltage between two selected input channels. The selected ADC input channels can either be internal (e.g. a voltage reference) or external analog input pins.
The ADC supports sampling in bursts, where a configurable number of conversion results are accumulated into a single ADC result, or a sample accumulation. The ADC input signal is fed through a sample-and-hold circuit that ensures the input voltage of the ADC is held at a constant level during sampling.
Selectable voltage references from the internal Voltage Reference (VREF) peripheral, AVDD supply voltage, or external VREF pin (VREFA).
A digital window compare feature is available for monitoring the input signal and can be configured only to trigger an interrupt, if the sample is below or above a user-defined threshold; or if it is inside or outside a user-defined window, with minimum software intervention required.
The analog input channel is selected by writing to the MUXPOS bit field in the MUXPOS
(ADCn.MUXPOS) register. Any of the ADC input pins, GND, internal inputs, or temperature
sensor can be selected as a single-ended input to the ADC. The ADC is enabled by writing
a ‘1
’ to the ADC ENABLE bit in the Control A (ADCn.CTRLA) register. The
voltage reference and input channel selections will not go into effect before the ADC is
enabled.
The ADC does not consume power when the ENABLE bit is ‘0
’.
The ADC generates a 10- or 12-bit right-adjusted result which can be read from the
Result (ADCn.RES) register.
The conversion equations, where VAINP and VAINN are the positive and negative ADC inputs and VREF is the selected ADC voltage reference are listed below.
- Single-ended 12-bit conversion:
- Single-ended 10-bit conversion:
- Differential 12-bit conversion:
- Differential 10-bit conversion: