CH32L103 Reference Manual
15.2.2 Difference between General-purpose Timer and Advanced-control Timer
Compared with the advanced-control timer, the general-purpose timer is lack of the following functions:
1) The general-purpose timer lacks a repeated counting register that counts the count cycle of core counter.
2) The compare/capture of general-purpose timer lacks deadband generation and has no complementary output.
3) The general-purpose timer has no break signal mechanism.
4) The default clock CK_INT of the general-purpose timer comes from PB1, while the CK_INT of the advanced-
control timer comes from PB2.
15.2.3 Clock Input
This section describes the source of CK_PSC. The clock source part of the general structure block diagram of the
general-purpose timer is abstracted here.
TI2
TIMx_CCMR1
ETR pin
The available input clocks can be divided into 4 categories:
1) External clock pin (ETR) input: ETR→ETRP→ETRF;
2) Internal PB clock input: CK_INT;
3) From the compare/capture pin (TIMx_CHx): TIMx_CHx→TIx→TIxFPx; it is also used in encoder mode;
4) Input from other internal timers: ITRx.
The actual operation can be divided into 3 categories by determining the input pulse selection of the SMS from the
CK_PSC source:
1) Select the internal clock source (CK_INT);
2) External clock source mode 1;
3) External clock source mode 2;
4) Encoder code.
The 4 clock sources mentioned above can be selected by these 4 operations.
15.2.3.1 Internal Clock Source (CK_INT)
If the general-purpose timer is started when the SMS domain is kept at 000b, then the internal clock source (CK_INT)
is selected as the clock. At this moment, CK_INT is CK_PSC.
V1.9
Figure 15-2 Block diagram of general-purpose timer source
TI2F_Rising
Edge
Filter
detector
TI2F_Falling
ICF[3:0]
TIMx_CCER
ETR
0
Divider
/1,/2,/4,/8
1
ETPS[1:0]
ETP
TIMx_SMCR
TIMx_SMCR
TIMx_SMCR
TS[2:0]
ITRx
0xx
TI1_ED
100
or
TI1FP1
101
0
TI2FP2
110
1
ETRF
111
CC2P
ETRP
Filter
downcounter
f
DTS
(internal clock)
ETF[3:0]
TIMx_SMCR
191
or
TI2F
or
TI1F
Encoder
mode
TRGI
External clock
mode 1
ETRF
External clock
mode 2
CK_INT
Internal clock
mode
SMS[2:0]
ECE
TIMx_SMCR
https://wch-ic.com
CK_PSC
Need help?
Do you have a question about the CH32L103 and is the answer not in the manual?