32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52220/HT32F52230
Channel Controller
The SCTM channel can be used as the capture input or compare match output. The capture input or
compare match output channel is composed of a preload register and a shadow register. The Data
access of the APB bus is always through the read/write preload register.
In the input capture mode, the counter value is captured into the CHCCR shadow register first and
then transferred into the CHCCR preload register when the capture event occurs.
In the compare match output mode, the contents of the CHCCR preload register is copied into the
associated shadow register and the counter value is then compared with the register value.
CHPSC
Read CHCCR
Figure 71. Capture/Compare Block Diagram
Capture Counter Value Transferred to CHCCR
When the channel is used as a capture input, the counter value is captured into the Channel
Capture/Compare Register (CHCCR) when an effective input signal transition occurs. Once the
capture event occurs, the CHCCIF flag in the INTSR register is set accordingly. If the CHCCIF bit
is already set, i.e., the flag has not yet been cleared by software and another capture event on this
channel occurs, the corresponding channel Over-Capture flag, named CHOCF, will be set.
f
CLKIN
SCTM_CH
25
CNTR
CHCCR
CHCCIF
CHOCF
Figure 72. Input Capture Mode
Rev. 1.10
APB Bus Interface
(Preload Register)
Cpature
Capture Transfer
Controller
(Shadow Register)
CHCCS
Capture
CHCCG
CHE
26
27
28
0
248 of 366
CHCCR
Compare Transfer
CHxCCR
CHCCR
TM_CNT
29
30
31
32
26
Write CHCCR
Compare
Controller
Update Event
CHCCS
CHPRE
33
34
35
32
November 09, 2018
Need help?
Do you have a question about the HT32F52220 and is the answer not in the manual?