GD32A50x User Manual
463
Figure 18-65.
Timing chart of up counting mode, change TIMERx_CAR on the go
TIMER_CK
CEN
PSC_CLK
CNT_REG
94
95
96
97
98
99
0
1
2
3
4
5
6
7
Update event (UPE)
Update interrupt flag (UPIF)
Auto-reload register
120
99
change CAR Vaule
CNT_REG
113
114 115 116 117 118 119 120
0
1
2
98
99
0
Update event (UPE)
Update interrupt flag (UPIF)
Auto-reload register
120
99
change CAR Vaule
120
99
Auto-reload shadow register
...
Hardware set
Hardware set
Software clear
Hardware set
ARSE = 0
ARSE = 1
Single pulse mode
Single pulse mode is opposite to the repetitive mode, which can be enabled by setting SPM
in TIMERx_CTL0. When you set SPM, the counter will be clear and stop when the next update
event.
Once the timer is set to operate in the single pulse mode, it is necessary to set the timer
enable bit CEN in the TIMERx_CTL0 register to 1 to enable the counter, then the CEN bit
keeps at a high state until the update event occurs or the CEN bit is written to 0 by software.
If the CEN bit is cleared to 0 using software, the counter will be stopped and its value held.
Timer debug mode
When the Cortex
®
-M33 is halted, and the TIMERx_HOLD configuration bit in DBG_CTL
register set to 1, the TIMERx counter stops.