
Rev. 1.00
550 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
28 T
ouch Key
mode. When any key C/F counter value is less than the lower threshold if MnKmTHS = 0, or larger
than the upper threshold if MnKmTHS = 1, this indicates that the touch key state changes, then the
MnKmTHF flag will be set high by the hardware, and an interrupt signal will be generated. Note
that if the touch key module TKTH interrupt occurs, 1-byte data will be written to the TKMnROL
register because the TKMnROH/TKMnROL register pair will be loaded with the corresponding
next time slot capacitor value from the dedicated touch key data memory and the 16-bit C/F counter
content, TKMn16DH/TKMn16DL, and the TKMnTH16H/TKMnTH16L value are compared at the
same time.
It should be noted that the settings of MnKOEN and MnROEN bits are different in different modes.
The relationship among TKST, TKBUSY, MnKOEN and MnROEN is as follows.
Module n & State
MnTSS[1:0] = 0
MnTSS[1:0] = 1 ~ 3
TKST: 0 → 1
TKBUSY: 1 → 0
TKST: 0 → 1
TKBUSY: 1 → 0
MnKOEN /
MnROEN
MnKOEN /
MnROEN
MnKOEN /
MnROEN
MnKOEN /
MnROEN
n = 0
M0K4EN ~ M0K1EN ≠ b0000
Set by H/W
Clear by H/W
Set by H/W
(1)
Set by H/W
(1)
n = 1 ~ 6
MnK4EN ~ MnK1EN ≠ b0000
Set by H/W
Clear by H/W
Set by H/W
(1)
Set by H/W
(1)
n = 0 ~ 6
M0K4EN ~ M0K1EN = b0000 &
MnK4EN ~ MnK1EN ≠ b0000
Set by H/W except
M0ROEN
(2)
Clear by H/W
Set by H/W
(1)
Set by H/W
(1)
H/W: Automatically set high or cleared to zero by hardware
Notes:
1. When MnTSS[1:0] ≠ 0, the time slot clock is
selected from TKCLK/32, TKCLK/64 or TKCLK/128, the
reference oscillator clock does not need to be enabled, the MnROEN bit will not be automatically set to high.
2. When a specific module is enabled, its corresponding oscillator is automatically enabled, the MnROEN
is automatically set high by the hardware. Since the module 0 reference clock is also used as a
reference oscillator stable delay clock source of other module, the M0ROEN bit needs to be turned on
manually.
Touch Key Interrupts
The touch key has two independent interrupts, known as touch key TKRCOV interrupt and
touch key module TKTH interrupt. In the manual scan mode, when the time slot counter in all
the touch key modules overflows, an actual touch key TKRCOV interrupt will take place. In the
auto scan mode, when the touch key auto scan operation is completed, the Touch Key TKRCOV
Interrupt request flag, TKRCOVF, will be set. In the periodic auto scan mode, only after the last
scan operation in the PST time-out cycle completes the 16-bit C/F counter content is written into
the corresponding TKMnKmCNTR register, then the Touch Key TKRCOV Interrupt request
flag, TKRCOVF, will be set. The touch keys mentioned here are the keys which are enabled. The
16-bit C/F counter, 16-bit counter, 5-bit time slot unit period counter and 8-bit time slot counter in
the module will be automatically cleared. When any key C/F counter value is less than the lower
threshold if MnKmTHS = 0, or larger than the upper threshold if MnKmTHS = 1, a touch key
module TKTH interrupt will take place.