RM0444
15.8
Oversampler
The oversampling unit performs data preprocessing to offload the CPU. It can handle
multiple conversions and average them into a single data with increased data width, up to
16-bit.
It provides a result with the following form, where N and M can be adjusted:
It allows the following functions to be performed by hardware: averaging, data rate
reduction, SNR improvement, basic filtering.
The oversampling ratio N is defined using the OVFS[2:0] bits in the ADC_CFGR2 register. It
can range from 2x to 256x. The division coefficient M consists of a right bit shift up to 8 bits.
It is configured through the OVSS[3:0] bits in the ADC_CFGR2 register.
The summation unit can yield a result up to 20 bits (256 x 12-bit), which is first shifted right.
The upper bits of the result are then truncated, keeping only the 16 least significant bits
rounded to the nearest value using the least significant bits left apart by the shifting, before
being finally transferred into the ADC_DR data register.
Note:
If the intermediate result after the shifting exceeds 16 bits, the upper bits of the result are
simply truncated.
Raw 20-bit data
The
Figure 55
data to the final 16-bit result.
Result
=
Figure 54. 20-bit to 16-bit result truncation
19
Shifting
Truncation
and rounding
gives a numerical example of the processing, from a raw 20-bit accumulated
n
=
N 1
–
1
---- -
×
Conversion t
M
n
=
0
15
11
15
RM0444 Rev 5
Analog-to-digital converter (ADC)
( )
n
7
3
0
0
MS31928V2
373/1390
403
Need help?
Do you have a question about the STM32G0 1 Series and is the answer not in the manual?
Questions and answers