RM0432
21.4.30
Oversampler
The oversampling unit performs data pre-processing to offload the CPU. It is able to 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 to perform by hardware the following functions: 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,
and can range from 2x to 256x. The division coefficient M consists of a right bit shift up to
8 bits, and is defined using the OVSS[3:0] bits in the ADC_CFGR2 register.
The summation unit can yield a result up to 20 bits (256x 12-bit results), which is first shifted
right. It is then truncated to 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 intermediary result after the shifting exceeds 16-bit, the result is truncated as is,
without saturation.
Figure 133
data to the final 16-bit result.
Table 137
data equal to 0xFFF.
Result
Figure 132. 20-bit to 16-bit result truncation
19
Raw 20-bit data
Shifting
Truncation and rounding
gives a numerical example of the processing, from a raw 20-bit accumulated
Figure 133. Numerical example with 5-bit shift and rounding
19
Raw 20-bit data
3
Final result after 5-bit shift
and rounding to nearest
gives the data format for the various N and M combinations, for a raw conversion
n
=
N 1
–
1
---- -
×
=
Conversion t
M
n
=
0
15
11
15
15
11
B
7
15
1
D
RM0432 Rev 6
Analog-to-digital converters (ADC)
( )
n
7
3
7
3
D
B
0
0
MS34453V1
7
0
F
MS34454V1
665/2301
724
Need help?
Do you have a question about the STM32L4+ Series and is the answer not in the manual?