BAT32G1x9 user manual | Chapter 17 Comparator
553 / 1149
Rev.1.02
17.4.10
The digital filter of comparator i (i=0, 1).
The comparator i has a built-in digital filter that selects the sample clock by the CiFCK1 to CiFCK0 bits of
the COMFIR register. The output signal of comparator i is sampled by each sample clock, and the next
sample clock after the level is the same 3 times, the digital filter outputs this sample value.
Fig. 17-12 is the result of the digital filter of comparator i, and FIG. 17-13 is an example of the digital filter and
interrupt operation of the digital comparator i (i=0, 1).
Figure 17-12 Comparator i (i=0, 1) of the digital filter and along the detection structure
digitial filter (3
times
identical)
sample clock
double
edge
detection
single
edge
detection
CiFCK
,
CiEPO
,
CiEDG: COMPFIR registers bits
CiIE: CIMPOCR register bits
selector
selector
fCL
K
fCLK/8
fCLK/32
CiMPI+
CiMPI-
CiFCK=00b
CiFCK
>00b
CiFCK
=01b
=11b
=10b
CiEPO=1
CiEPO=0
CiEDG=1
CiEDG=
0
CiIE
INTCMPi
EVENTC event
Figure 17-13 Comparator i (i=0, 1) digital filter and interrupt operation example
sample timing
sequence
CiMON
CMPIFi bit of
interrupt control
register
set to 0 via program
as long as 1 out of 3 times the
signal is not identical, the signnal
will be discarded as noise,
CMPIFi bit remain unchanged.
if 3 times signals are
identical, then it is
considered as signal change
and CMPIFi bit change to 1.
Note that the CiFCK1~CiFCK0
bits of the
COMFIR
register above
are
"01B",
"10B"
,
or
"11B" Example of operation
when there is a digital filter.
17.4.11
Comparator i interrupt (i=0, 1).
The comparator generates a total of 2 interrupt requests for comparator 0 and comparer 1. Comparator i
interrupts each have 1 priority specified flag, interrupt mask flag, interrupt request flag, and interrupt vector.
To use the comparator i interrupt, the CiIE position of the COMCCR register must be "1" (the output of
the interrupt request allowed). The COMFIR registers set the conditions under which interrupt requests are
generated, and a digital filter can be attached to the comparator's output. The digital filter can be selected
from three sample clocks. For register settings and corresponding requests to generate interrupts, refer
to "17.3.3 Comparator Filter Control Registers (COMPFIR)" and " 17.3.4 Comparator Output Control Register
(COMPOCR)".