SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The ADC12 control provides capability for averaging of ADC results. The averaging module utilizes a modified moving average (MMA) algorithm, to reduce hardware resources and avoid the need to store up to 32 ADC samples per result. Averaging is provided on the first 6 result registers (ADC Result Register 0-5). Averaged ADC results can be read by firmware in the ADC Averaged Result Registers following completion of an ADC conversion sequence.
Modified Moving Average (MMA) algorithm is a type of IIR filter defined by the following equation:
where
Firmware can select from 4 options for ADC averaging (4X, 8X, 16X, 32X):
The averaging result register is stored immediately following the calculation of the moving average. Upon receipt of the next ADC sample, the ADC sample value and current moving average are used for calculation of the next moving average. In addition, 5 fractional bits from the moving average calculation are stored for use in the next moving average calculation. These fractional bits ensure better accuracy of the moving average over time.
No oversampling or decimation is used during the averaging process. The average value is calculated over several separate consecutive sequences of conversion. Therefore the non averaged result is always more responsive than the averaged result.