
792
SAM G51 [DATASHEET]
11209C–ATARM–20-Dec-13
fields will be part of the sequence. Each USCHx field has a corresponding enable, CHx, in ADC_CHER (USCHx field
with the lowest x index is associated with bit CHx of the lowest index).
Note:
The reference voltage pins always remain connected in normal mode as in sleep mode.
32.6.7 Comparison Window
The ADC Controller features automatic comparison functions. It compares converted values to a low threshold or a high
threshold or both, according to the CMPMODE function chosen in the Extended Mode Register (ADC_EMR). The
comparison can be done on all channels or only on the channel specified in CMPSEL field of ADC_EMR. To compare all
channels the CMP_ALL parameter of ADC_EMR should be set.
Moreover a filtering option can be set by writing the number of consecutive comparison errors needed to raise the flag.
This number can be written and read in the CMPFILTER field of ADC_EMR.
The flag can be read on the COMPE bit of the Interrupt Status Register (ADC_ISR) and can trigger an interrupt.
The High Threshold and the Low Threshold can be read/write in the Comparison Window Register (ADC_CWR).
If the comparison window is to be used with LOWRES bit set in the ADC_MR, the thresholds do not need to be adjusted
as adjustment will be done internally. Whether or not the LOWRES bit is set, thresholds must always be configured in
consideration of the maximum ADC resolution.
32.6.8 ADC Timings
Each ADC has its own minimal Startup Time that is programmed through the field STARTUP in the Mode Register
(ADC_MR).
A minimal Tracking Time is necessary for the ADC to guarantee the best converted final value between two channel
selections. This time has to be programmed through the TRACKTIM field in the ADC_MR.
Warning: No input buffer amplifier to isolate the source is included in the ADC. This must be taken into consideration to
program a precise value in the TRACKTIM field. See the product “ADC Characteristics” section.
32.6.9 Last Channel Specific Measurement Trigger
The last channel (higher index available) embeds a specific mode allowing a measurement trigger period which differs
from other active channels. This allows efficient management of the conversions especially if the channel is driven by a
device whose variation has a totally different frequency from other converted channels (for example, but not limited to,
temperature sensor).
The temperature measurement can be made in different ways through the ADC controller. The different methods for the
measure depend on the configuration bits TRGEN in the ADC_MR and CH7 in the ADC_CHSR.
The last channel measure can be triggered like the other channels by enabling its associated conversion channel index
7, writing 1 in CH7 of the ADC_CHER.
The manual start can only be performed if TRGEN bit in ADC_MR is disabled. When the START bit in the ADC_CR is
set, the last channel conversion will be scheduled together with the other enabled channels (if any). The result of the
conversion is placed in the ADC_CDR7 register and the associated flag EOC7 is set in the ADC_ISR.
If the TRGEN bit is set in the ADC_MR, the last channel is periodically converted together with the other enabled
channels and the result is placed on the ADC_LCDR and ADC_CDR7 registers. Thus the last channel conversion result
is part of the Peripheral DMA Controller buffer (see
Figure 32-6).