Datasheet

When USEQ is set, the user can define the channel sequence to be converted by configuring AFEC_SEQxR and
AFEC_CHER so that channels are not interleaved during the averaging period. Under these conditions, a sample is
defined for each end of conversion as described in the figure below
.
Therefore, if the same channel is configured to be converted four times consecutively and AFEC_EMR.RES = 2, the
averaging result is placed in the corresponding channel internal data register (read by means of the AFEC_CDR) and
the AFEC_LCDR for each trigger event.
In this case, the AFE real sample rate remains the maximum AFE sample rate divided by 4.
When USEQ is set and the RES field enables the Enhanced Resolution mode, it is important to note that the user
sequence must be a sequence being an integer multiple of 4 (i.e., the number of the enabled channel in the Channel
Status register (AFEC_CHSR) must be an integer multiple of 4 and the AFEC_SEQxR must be a series of 4 times
the same channel index).
Figure 52-13. Digital Averaging Function Waveforms on a Single Trigger Event, Non-interleaved
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_1CH0_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 results of average function.
AFEC_SEQ1R = 0x1111_0000
internal register
CDR[0]
internal register
CDR[1]
52.6.15 Automatic Error Correction
The AFEC features automatic error correction of conversion results. Offset and gain error corrections are available.
The correction can be enabled for each channel and correction values (of
fset and gain) are defined per Sample &
Hold unit.
To enable error correction, the ECORR bit must be set in the AFEC Channel Error Correction register
(AFEC_CECR). The offset and gain values used to compensate the results are set per Sample & Hold unit basis
using the AFEC Correction Select register (AFEC_COSR) and the AFEC Correction Values register (AFEC_CVR).
AFEC_COSR is used to select the Sample & Hold unit to be displayed in AFEC_CVR. This selection applies both to
read and write operations in AFEC_CVR.
AFEC_CVR.OFFSETCORR and AFEC_CVR.GAINCORR must be filled with the values of corrective data. This data
is computed from two measurement points in signed format. The correction is the same for all functional modes.
The final conversion result after error correction is obtained using the following formula, which is implemented after
averaging in 2’s complement format, with:
OFFSETCORR—the offset correction value. OFFSETCORR is a signed value.
GAINCORR—the gain correction value
SAM E70/S70/V70/V71 Family
Analog Front-End Controller (AFEC)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 1668