GD32F403xx User Manual
116
zero, and then up- counting to 128 x CKLIM (def ined in CTC_CTL1 register), and then stop
until next REF sync pulse detected. If any REF sync pulse detected, the current CTC trim
counter value is captured to REFCAP in status register (CTC_STAT), and the counter
direction is captured to REFDIR in status register (CTC_STAT). The detail is showing as
f ollowing figure.
Figure 6-2. CTC trim counter
CKOK
CKWARN
CKERR
CKWARN
REFMISS
0
+1
-1
+2
-2
CTC STATUS
TRIM VALUE
CKLIM
3 x CKLIM
128 x CKLIM
RLVALUE
Counter value
CLOCK
6.3.3.
Frequency evaluation and automatically trim process
The clock f requency evaluation is performed when a REF sync pulse occur. If a REF sync
pulse occurs on down-counting, it means the current clock is slower than correct clock (the
f requency of 48M). It needs to improve TRIMVALUE in CTC_CTL0 register. If a REF sync
pulse occurs on up-counting, it means the current clock is f aster than correct clock (the
f requency of 48M). It needs to reduce TRIMVALUE in CTC_CTL0 register. The CKOKIF,
CKWARNIF, CKERR and REFMISS in CTC_STAT register shows the frequency evaluation
scope.
If the AUTOTRIM bit in CTC_CTL0 register is setting, the automatically hardware trim mode
enabled. In this mode, if a REF sync pulse occurs on down-counting, it means the current
clock is slower than correct clock, the TRIMVALUE will be increased automatically to raise
the clock f requency. Vice versa when it occurs on up -counting, the TRIMVALUE will be
reduced automatically to reduce the clock frequency.
◼
Counter < CKLIM when
REF sync pulse is detected.
The CKOKIF in
CTC_STAT register set, and an interrupt generated if CKOKIE bit in
Содержание GD32F403 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F403xx Arm Cortex M4 32 bit MCU User Manual Revision 2 6 Jul 2022 ...
Страница 177: ...GD32F403xx UserManual 177 Peripheral Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 SDIO SDIO ...
Страница 217: ...GD32F403xx UserManual 217 ensures that no conversion is in progress ...