GD32F10x User Manual
331
Figure 15-37. Timing chart of down counting mode, change TIMERx_CAR ongoing
TIMER_CK
CEN
PSC_CLK
CNT_REG
5
4
3
2
1
0
99
98
97
96
95
94
93
92
Update event (UPE)
Update interrupt flag (UPIF)
Auto-reload register
120
99
change CAR Vaule
CNT_REG
5
4
3
2
1
0
99
1
0
120
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
98
97
120
change CAR Vaule
119 118
120
Counter center-aligned counting
In this mode, the counter counts up from 0 to the counter-reload value and then counts down
to 0 alternatively. The Timer module generates an overflow event when the counter counts to
the counter-reload value subtract 1 in the up-counting mode and generates an underflow
event when the counter counts to 1 in the down-counting mode. The counting direction bit
DIR in the TIMERx_CTL0 register is read-only and indicates the counting direction when in
the center-aligned mode.
Setting the UPG bit in the TIMERx_SWEVG register will initialize the counter value to 0
irrespective of whether the counter is counting up or down in the center-align counting mode
and generates an update event.
The UPIF bit in the TIMERx_INTF register can be set to 1 either when an underflow event or
an overflow event occurs. While the CHxIF bit is associated with the value of CAM in
TIMERx_CTL0. The details refer to
Figure 15-38. Timing chart of center-aligned counting
If the UPDIS bit in the TIMERx_CTL0 register is set, the update event is disabled.
When an update event occurs, all the shadow registers (counter autoreload register, prescaler
register) are updated.
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...