
GD32L23x User Manual
125
15
REFDIR
CTC trim counter direction when reference sync pulse
When a reference sync pulse occurred during the counter is working, the CTC trim
counter direction is captured to REFDIR bit.
0: Up-counting
1: Down-counting
14:11
Reserved
Must be kept at reset value.
10
TRIMERR
Trim value error bit
This bit is set by hardware when the TRIMVALUE in CTC_CTL0 register overflow
or underflow. When the ERRIE in CTC_CTL0 register is set, an interrupt occur. This
bit is cleared by writing 1 to ERRIC bit in CTC_INTC register.
0: No trim value error occur
1: Trim value error occur
9
REFMISS
Reference sync pulse miss
This bit is set by hardware when the reference sync pulse miss. This is occur when
the CTC trim counter reach to 128 x CKLIM during up counting and no reference
sync pulse detected. This means the clock is too fast to be trimmed to correct
frequency or other error occur. When the ERRIE in CTC_CTL0 register is set, an
interrupt occur. This bit is cleared by writing 1 to ERRIC bit in CTC_INTC register.
0: No Reference sync pulse miss occur
1: Reference sync pulse miss occur
8
CKERR
Clock trim error bit
This bit is set by hardware when the clock trim error occur. This is occur when the
CTC trim counter greater or equal to 128 x CKLIM during down counting when a
reference sync pulse detected. This means the clock is too slow and cannot be
trimmed to correct frequency. When the ERRIE in CTC_CTL0 register is set, an
interrupt occur. This bit is cleared by writing 1 to ERRIC bit in CTC_INTC register.
0: No Clock trim error occur
1: Clock trim error occur
7:4
Reserved
Must be kept at reset value.
3
EREFIF
Expect reference interrupt flag
This bit is set by hardware when the CTC counter reach to 0. When the EREFIE in
CTC_CTL0 register is set, an interrupt occur. This bit is cleared by writing 1 to
EREFIC bit in CTC_INTC register.
0 : No Expect reference occur
1: Expect reference occur
2
ERRIF
Error interrupt flag
This bit is set by hardware when an error occurred. If any error of TRIMERR,
REFMISS or CKERR occurred, this bit will be set. When the ERRIE in CTC_CTL0
register is set, an interrupt occur. This bit is cleared by writing 1 to ERRIC bit in
CTC_INTC register.