In Average mode (
MD
=
‘b010
), the
ADACC
registers accumulate with each ADC sample, much as in Accumulate mode, and the
ADCNT register
increments with each sample. The
ADFLTR register is also updated with the right-shifted value of
the ADACC register. The value of the
CRS bits governs the number of right shifts. However, in Average mode, the
threshold comparison is performed upon ADCNT being greater than or equal to a
user-defined
ADRPT value. In this mode, when ADRPT = 2
CRS, the final
accumulated value will be divided by the number of samples, allowing for a threshold
comparison operation on the average of all gathered samples.