GD32A50x User Manual
269
14.4.
Function overview
Figure 14-1. ADC module block diagram (for ADC0 and ADC1)
ADC_IN0
ADC_IN1
· ·
·
ADC_IN15
GPIO
C
h
a
n
ne
l
se
le
c
to
r
V
SENSE
V
REF+
V
REF-
V
DDA
V
SSA
Routine data registers
(
16 bits
)
Routine
channels
Channel Management
Trig select
T
R
IG
S
E
L
A
P
B
B
U
S
EOC
ADC
Interrupt
SAR ADC
CLB
self calibration
DRES[1:0]
12, 10, 8, 6 bits
OVSS[3:0]
OVSR[2:0]
OVSE
TOVS
Over
sampler
V
REFINT
S
o
ftw
a
re
Analog
watchdog
0/1
In
te
rr
u
p
t
g
e
n
e
ra
to
r
watch dog
event 0/1
to SHRTIMER
watch dog
event 0/1
ETSRC
14.4.1.
Foreground calibration function
During the foreground calibration procedure, the ADC calculates a calibration factor which is
internally applied to the ADC until the next ADC power-off. The application must not use the
ADC during calibration and must wait until it is completed. Calibration should be performed
before starting A/D conversion. The calibration is initiated by software by setting bit CLB=1.
CLB bit stays at 1 during all the calibration sequence. It is then cleared by hardware as soon
as the calibration is completed.
When the ADC operating conditions change (such as supply power voltage V
DDA
, positive
reference voltage V
REF+
, temperature and so on), it is recommended to re-run a calibration
cycle.
The internal analog calibration can be reset by setting the RSTCLB bit in ADC_CTL1 register.
Calibration software procedure:
1.
Ensure that ADCON=1.
2.
Delay 14 CK_ADC to wait for ADC stability.
3.
Set RSTCLB (optional).
4.
Set CLB=1.
5.
Wait until CLB=0.