Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet

Product codes
ATSAM4E-XPRO
Page of 1506
1359
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
Figure 45-13. Digital Averaging Function Waveforms on single trigger event, non-interleaved
The Enhanced Resolution mode doesn’t apply to temperature sensor channel when used with RTCT bit (see
).
45.6.14 Automatic Calibration
The AFEC features an automatic calibration (AUTOCALIB) mode for gain errors (calibration).
The automatic calibration sequence can be started at any time writing a‘1’ to the AUTOCAL bit of the AFEC
Control Register. The end of calibration sequence is given by the EOCAL bit in the interrupt status register
(AFEC_IS1R), and an interrupt is generated if the EOCAL interrupt has been enabled (AFEC_IER).
If FREERUN mode is to be used then automatic calibration must be run before enabling the FREERUN mode. In
any case automatic calibration should not be started while FREERUN mode is active.
The calibration sequence performs an automatic calibration on all enabled channels. The gain settings of all
enabled channels must be set before starting the AUTOCALIB sequence. For each calibrated channels, the
corresponding OFF bit in AFEC_CDOR must be also programmed to ‘1’ prior to launch the autocalibration
sequence.
If the gain (AFEC_CGR) for a given channel is changed, the AUTOCALIB sequence must then be started again.
The calibration data (on one or more enabled channels) is stored in the internal AFEC memory.
Then, when a new conversion is started (on one or more enabled channels), the converted value (in the
AFEC_LCDR or internal data registers read by means of the AFEC_CDR) is a calibrated value. 
Autocalibration is for settings, not for channels. Therefore, if a specific combination of gain and offset has been
already calibrated, and a new channel with the same settings is enabled after the initial calibration, there is no
need to restart a calibration. If different enabled channels have different gain and offset settings, the corresponding
channels must be enabled before starting the calibration.
Internal/External
Trigger event
AFEC_SEL
0
AFEC_EMR.EMR = 2, STM = 1, AFEC_CHSR[7:0] = 0xFF and AFEC_MR.USEQ = 1
CH0_0
AFEC_LCDR
0i1
0 0
0i2 0i3
CH0_1
EOC[0]
Read AFEC_CDR & AFEC_CSELR.CSEL = 0
Read AFEC_CDR & AFEC_CSELR.CSEL = 1
CH1_1
CH0_1
EOC[1]
Read AFEC_LCDR
DRDY
0 1
1 1
1
0
0 0
0
CH1_0 1i1 1i2 1i3
CH1_1
Note: 0i1, 0i2, 0i3, 1i1, 1i2, 1i3  are intermediate results and CH0/1_0/1 are final result of average function.
AFEC_SEQ1R = 0x1111_0000
internal register
CDR[0]
internal register
CDR[1]