![GigaDevice Semiconductor GD32F20 Series User Manual Download Page 391](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801391.webp)
GD32F20x User Manual
391
Figure 18-36. Up-counter timechart, change TIMERx_CAR on the go.
TIMER_CK
CEN
CNT_CLK(PSC_CLK)
CNT_REG
5E
5F
60
61
62
63
00
01
02
03
04
05
06
07
Update event (UPE)
Update interrupt flag (UPIF)
Auto-reload register
65
63
change CAR Vaule
CNT_REG
5E
5F
60
61
62
63
64
65
00
01
02
62
63
00
Update event (UPE)
Update interrupt flag (UPIF)
Auto-reload register
65
63
change CAR Vaule
65
63
Auto-reload shadow regist er
...
Hardware set
Hardware set
Software clear
Hardware set
ARSE = 0
ARSE = 1
Down counting mode
In this mode, the counter counts down continuously from the counter-reload value, which is
defined in the TIMERx_CAR register, to 0 in a count-down direction. Once the counter
reaches to 0, the counter restarts to count again from the counter-reload value. If the repetition
counter is set, the update event was generated after the number (TIME1) of
underflow. Else the update event is generated at each counter underflow. The counting
direction bit DIR in the TIMERx_CTL0 register should be set to 1 for the down-counting mode.
When the update event is set by the UPG bit in the TIMERx_SWEVG register, the counter
value will be initialized to the counter-reload value and generates an update event.
If the UPDIS bit in TIMERx_CTL0 register is set, the update event is disabled.
When an update event occurs, all the registers (repetition counter, auto reload register,
prescaler register) are updated.
The following figures show some examples of the counter behavior for different clock
frequencies when TIMERx_CAR=0x63.
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 ...