911
SAM4CP [DATASHEET]
43051E–ATPL–08/14
disabled (ADC_CSR[3] = 0), ADC_SEQR1 fields USCH1 up to USCH8 must not contain the value 3. Thus the length of
the user sequence may be limited by this behavior.
As an example, if only four channels over 8 (CH0 up to CH3) are selected for ADC conversions, the user sequence
length cannot exceed four channels. Each trigger event may launch up to four successive conversions of any
combination of channels 0 up to 3 but no more (i.e., in this case the sequence CH0, CH0, CH1, CH1, CH1 is impossible).
A sequence that repeats the same channel several times requires more enabled channels than channels actually used
for conversion. For example, the sequence CH0, CH0, CH1, CH1 requires four enabled channels (four free channels on
application boards) whereas only CH0, CH1 are really converted.
40.6.7 Comparison Window
The ADC Controller features automatic comparison functions. It compares converted values to a low threshold, a high
threshold or both, depending on 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 CMPALL bit 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 ADC_ISR and can trigger an interrupt.
The high threshold and the low threshold can be read/write in the Compare Window register (ADC_CWR).
If the comparison window is to be used with the LOWRES bit in ADC_MR set to 1, 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.
40.6.8 ADC Timings
Each ADC has its own minimal startup time that is programmed through the field STARTUP in 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 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 ADC Characteristics section.
40.6.9 Temperature Sensor
The temperature sensor is internally connected to channel index 7. For temperature measurement, the TEMPON bit
must be written to 1 in ADC_TEMPMR.
The temperature measurement can be made in different ways through the ADC controller. The different methods of
measurement depend on the configuration bits TRGEN in ADC_MR and CH7 in ADC_CHSR.
The temperature measurement can be triggered like the other channels by enabling its associated conversion channel
index 7, writing to 1 the bit CH7 of ADC_CHER.
The manual start can only be performed if TRGEN bit in ADC_MR is disabled. When the START bit in ADC_CR is written
to 1, the temperature sensor 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 ADC_ISR.
If the TRGEN bit is set in ADC_MR, the channel of the temperature sensor is periodically converted together with other
enabled channels and the result is placed on ADC_LCDR and ADC_CDR7. Thus the temperature conversion result is
part of the Peripheral DMA Controller buffer. The temperature channel can be enabled/disabled at anytime but this may
not be optimal for downstream processing.