Figure 103. 20-Bit To 16-Bit Result Truncation; Figure 104. Numerical Example With 5-Bits Shift And Rounding; Oversampler - ST STM32L4x6 Reference Manual

Table of Contents

Advertisement

Analog-to-digital converters (ADC)
16.3.29

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 ADCx_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 ADCx_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
ADCx_DR data register.
Note:
If the intermediary result after the shifting exceeds 16-bit, the result is truncated as is,
without saturation.
The
Figure 104
data to the final 16-bit result.
The
Table 95
conversion data equal to 0xFFF.
478/1693
Result

Figure 103. 20-bit to 16-bit result truncation

gives a numerical example of the processing, from a raw 20-bit accumulated

Figure 104. Numerical example with 5-bits shift and rounding

below gives the data format for the various N and M combinations, for a raw
DocID024597 Rev 3
n
N 1
=
1
---- -
×
Conversion t
=
M
n
0
=
( )
n
RM0351

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32L4x6 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF