![Cmsemicon BAT32G1 9 Series Скачать руководство пользователя страница 552](http://html1.mh-extra.com/html/cmsemicon/bat32g1-9-series/bat32g1-9-series_user-manual_2627609552.webp)
BAT32G1x9 user manual | Chapter 17 Comparator
552 / 1149
Rev.1.02
An example of the operation of comparators i(i=0, 1) is shown in Figure 17-11. In basic mode, when the
analog input voltage is higher than the reference input voltage, the CiMON bit of the COMPMDR register is
"1"; When the analog input voltage is lower than the reference input voltage, the CiMON bit is "0".
To use the comparator i interrupt, the CiIE position of the COMNOCR register must be "1" (enable
interrupt requests). At this point, if the comparison result changes, an interrupt request for comparator i is
generated. For details on interrupt requests, refer to "17.4.2 Comparator i Interrupt (i=0, 1)".
Figure 17-11 Comparator i (i=0, 1) is an example of operation (basic mode).
•
basic mode operation example
reference
input voltage
(IVREFi or
BGRVRREF)
in low speed mode, reducing power consumption by
prolong the delay time of input decision result
in high speed mode, increasing power consumption by
shorten the delay time of output decision result
CiMON bit of
COMPMDR register
CMPIFi bit of interrupt
control register
set to 0 via program
a
n
a
lo
g
i
n
p
u
t
vo
lt
a
g
e
(
V
)
0
0
1
1
(A)
(B)
Note The CiFCK1~CiFCK0
bits
of the
COMFIR
register above are
"00B"
(filterless) and
the CiEDG
bits are
"1"
CMPIFi
is
limited
to the case (where
the CiEDG
bit is
"0"
and
the CiEPO
bit is
"0"
(rising edge).
(A)
changes the
CMPIFi
when the
CiEDG
bit is
"0"
and
the CiEPO
bit is
"1"
(falling edge
).
Limited to
changes in (B).)