
GD32F20x User Manual
267
Table 14-7. t
CONV
timings depending on resolution
DRES [1:0]
bits
t
CONV
(ADC clock
cycles)
t
CONV
(ns) at
f
ADC
= 28MHz
t
SMPL
(min)
(ADC clock
cycles)
t
ADC
(ADC
clock cycles)
t
ADC
(us) at f
ADC
=
28MHz
12
12.5
446 ns
1.5
14
500 ns
10
10.5
375 ns
1.5
12
429 ns
8
8.5
304 ns
1.5
10
357 ns
6
6.5
232 ns
1.5
8
286 ns
14.4.14.
On-chip hardware oversampling
The on-chip hardware oversampling circuit 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. The on-chip hardware oversampling circuit is enabled by OVSEN bit in the
ADC_OVSAMPCTL register. It provides a result with the following form, where N and M can
be adjusted, and D
out
(n) is the n-th output digital signal of the ADC:
Result=
1
M
*
∑
D
out
(n)
N-1
n=0
(12-1)
The on-chip hardware oversampling circuit performs the following functions: summing and bit
right shifting. The oversampling ratio N is defined by the OVSR[2:0] bits in the
ADC_OVSAMPCTL register. It can range from 2x to 256x. The division coefficient M means
bit right shifting up to 8-bit. It is configured through the OVSS[3:0] bits in the
ADC_OVSAMPCTL 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 data register.
Figure 14-13. 20-bit to 16-bit result truncation
Raw 20-bit data
19
15
11
7
3
0
15
11
7
3
0
Shifting
Truncation and
rounding
Note:
If the intermediate result after the shifting exceeds 16 bits, the upper bits of the result
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...