![Geehy SEMICONDUCTOR APM32F030x4x6x8xC Скачать руководство пользователя страница 116](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f030x4x6x8xc/apm32f030x4x6x8xc_user-manual_573629116.webp)
www.geehy.com Page 115
Field
Name
R/W
Description
4
CNTDIR R/W
Counter Direction
This bit is read-only when the counter is configured as center-aligned mode
or encoder mode.
0: Count up
1: Count down
6:5
CAMSEL R/W
Center Aligned Mode Select)
In the center-aligned mode, the counter counts up and down alternately;
otherwise, it will only count up or down. Different center-aligned modes affect
the timing of setting the output compare interrupt flag bit of the output
channel to 1; when the counter is disabled (CNTEN=0), select the
center-aligned mode.
00: Edge alignment mode
01: Center-aligned mode 1 (the output compare interrupt flag bit of output
channel is set to 1 when counting down)
10: Center-aligned mode 2 (the output compare interrupt flag bit of output
channel is set to 1 when counting up)
11: Center-aligned mode 3 (the output compare interrupt flag bit of output
channel is set to 1 when counting up/down)
7
ARPEN
R/W
Auto-reload Preload Enable
When the buffer is disabled, the program modification TMRx_AUTORLD will
immediately modify the values loaded to the counter; when the buffer is
enabled, the program modification TMRx_AUTORLD will modify the values
loaded to the counter in the next update event.
0: Disable
1: Enable
9:8
CLKDIV
R/W
Clock Divide Factor
For the configuration of dead time and digital filter, CK_INT provides the
clock, and the dead time and the clock of the digital filter can be adjusted by
setting this bit.
00
:
t
DTS
=t
CK_INT
01
:
t
DTS
=2×t
CK_INT
10
:
t
DTS=
4×t
CK_INT
11: Reserved
15:10
Reserved
Control register 2 (TMRx_CTRL2)
Offset address: 0x04
Reset value: 0x0000
Field
Name
R/W
Description
0
CCPEN
R/W
Capture/Compare Preloaded Enable
This bit affects the change of CCxEN, CCxNEN and OCxMOD values.
When preloading is disabled, the program modification will immediately
affect the timer setting; When preloading is enabled, it is only updated after
COMG is set, so as to affect the setting of timer; this bit only works on
channels with complementary output.
0: Disable
1: Enable
1
Reserved
2
CCUSEL
R/W
Capture/compare Control Update Select
Only when the capture/compare preload is enabled (CCPEN=1), it works
only for complementary output channel.
0: It can only be updated by setting COMG bit
1: It can be updated by setting COMG bit or rising edge on TRGI