
M451
May. 4, 2018
Page
988
of
1006
Rev.2.08
M4
51
S
E
RI
E
S
T
E
CH
NICA
L RE
F
E
R
E
NC
E
M
A
NU
A
L
6.24.4 Basic Configuration
ACMP clock source is PCLK and can be enabled by setting ACMP01CKEN (CLK_APBCLK0[7]).
The ACMP pin functions are configured in SYS_GPB_MFPL, SYS_GPB_MFPH,
SYS_GPC_MFPL, SYS_GPD_MFPL and SYS_GPD_MFPH registers. It is recommended to
disable the digital input path of the analog input pins to avoid the leakage current. The digital input
path can be disabled by configuring PB_DINOFF and PD_DINOFF registers.
6.24.5 Functional Description
Interrupt Sources
6.24.5.1
The output of comparators is reflected at ACMPO0 (ACMP_STATUS[4]) and ACMPO1
(ACMP_STATUS[5]) . If ACMPIE of ACMP_CTLn (n: 0 ~ 1) register is set to 1, the comparator
interrupt will be enabled. If the output state of comparator is changed as the setting of change
condition, the comparator interrupt will be asserted and the corresponding flag, ACMPIF0
(ACMP_STATUS[0]) and ACMPIF1 (ACMP_STATUS[1]), will be set to 1. The change condition of
comparator output for interrupt flag can be selected by INTPOL (ACMP_CTL0[9:8],
ACMP_CTL1[9:8]). If FILTSEL (ACMP_CTL0[15:13], ACMP_CTL1[15:13]) is not set to 0, the
interrupt generation is according to the filtered output. The interrupt flag can be cleared to 0 by
writing 1.
ACMPIF0
(ACMP_STATUS[0])
ACMPIE
(ACMP_CTL0[1])
ACMPIF1
(ACMP_STATUS[1])
ACMPIE
(ACMP_CTL1[1])
ACMP01_INT
WKIF0
(ACMP_STATUS[8])
WKIF1
(ACMP_STATUS[9])
Figure 6.24-2 Comparator Controller Interrupt Sources
Hysteresis Function
6.24.5.2
The analog comparator provides the hysteresis function to make the comparator to have a stable
output transition. If comparator output is 0, it will not be changed to 1 until the positive input
voltage exceeds the negative input voltage by a high threshold voltage. Similarly, if comparator
output is 1, it will not be changed to 0 until the positive input voltage drops lower than the negative
input voltage by a low threshold voltage.