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

Product codes
ATSAM4E-XPRO
Page of 1506
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
1356
programmed into the AFEC_TEMPMR by means of TEMPCMPMOD field. These values define the way the
TEMPCHG flag will be raised in the AFEC_IS1R.
The TEMPCHG flag can be used to trigger an interrupt if there is something to update/modify in the system
resulting from a temperature change.
In any case, if temperature sensor measure is configured, the temperature can be read at anytime in AFEC_CDR
(AFEC_CSELR must be programmed accordingly prior to read AFEC_CDR) without any specific software
intervention.
45.6.13 Enhanced Resolution Mode and Digital Averaging Function
The Enhanced Resolution Mode is enabled if RES field is set to 
13
-bits resolution or more in the AFEC Extended
Mode Register (AFEC_EMR). FREERUN mode is not supported if Enhanced Resolution Mode is used.
There is no averaging on the temperature sensor channel if the temperature sensor measure is triggered on RTC
event (see “Temperature Sensor” on page 1353).
In this mode the AFE Controller trades conversion performance for accuracy by averaging multiple samples, thus
providing a digital low-pass filter function.
If 1-bit enhancement resolution is selected (RES = 2 in the AFEC_EMR), the AFEC effective sample rate is
maximum AFEC sample rate divided by 4, therefore the oversampling ratio is 4.
When 2-bit enhancement resolution is selected (RES = 3 in the AFEC_EMR), the AFEC effective sample rate is
maximum AFEC sample rate divided by 16 (oversampling ratio is 16).
When 3-bit enhancement resolution is selected (RES = 4 in the AFEC_EMR), the AFEC effective sample rate is
maximum AFEC sample rate divided by 64 (oversampling ratio is 64).
When 4-bit enhancement resolution is selected (RES = 5 in the AFEC_EMR), the AFEC effective sample rate is
maximum AFEC sample rate divided by 256 (oversampling ratio is 256).
The selected oversampling ratio applies to all enabled channels (except temperature sensor channel if triggered
by RTC event).
The average result is valid into an internal register (read by means of the AFEC_CDR) only if EOCn (n
corresponding to the index of the channel) flag is set in AFEC_ISR and OVREn flag is cleared in the AFEC_OVER.
The average result is valid for all channels in the AFEC_LCDR only if the DRDY bit is set and the GOVRE bit is
cleared in the AFEC_ISR.
Note that the AFEC_CDR is not buffered. Therefore, when an averaging sequence is on going, the value in this
register changes after each averaging sample. On the other hand, overrun flags in the AFEC_OVER rise as soon
as the first sample of an averaging sequence is received and thus the previous averaged value is not read (even if
the new averaged value is not ready).
As the consequence, when an overrun flag rises in the AFEC_OVER, it only means that the previous unread data
is lost but it does not mean that this data has been overwritten by the new averaged value as the averaging
sequence concerning this channel can still be on going.
The samples can be defined in different ways for the averaging function depending on the configuration of the
STM bit in the AFEC_EMR and USEQ bit in the AFEC_MR.
When USEQ is cleared, there are two possible ways to generate the averaging through the trigger event. If the
STM bit is cleared in the AFEC_EMR every trigger event generates one sample for each enabled channel as
described in 
. Therefore four trigger events are requested to get the result of averaging
if RES = 2.