English
Language : 

K60P100M100SF2RM Datasheet, PDF (868/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
CMP Functional Description
35.8.1 CMP Functional Modes
There are three main sub-blocks to the comparator module: the comparator itself, the
window function and the filter function. The filter, CR0[FILTER_CNT] can be clocked
from an internally or external clock source. Additionally, the filter is programmable with
respect to how many samples must agree before a change on the output is registered. In
the simplest case, only 1 sample must agree. In this case, the filter acts as a simple
sampler.
The external sample input is enabled using CR1[SE]. When set, the output of the
comparator is sampled only on rising edges of the sample input.
The "windowing mode" is enabled by setting CR1[WE]. When set, the comparator output
is sampled only when the WINDOW input signal is equal to one. This feature can be
used to ignore the comparator output during time periods in which the input voltages are
not valid. This is especially useful when implementing zero-crossing-detection for certain
PWM applications.
The comparator filter and sampling features can be combined as shown in the following
table. Individual modes are discussed below.
Mode #
1
2A
2B
3A
3B
4A
4B
5A
5B
CR1[EN]
0
1
1
1
1
1
1
1
1
Table 35-29. Comparator Sample/Filter Controls
CR1[WE]
X
0
0
CR1[SE]
X
0
0
CR0[FILTER_C
NT]
X
0x00
X
FPR[FILT_PER]
X
X
0x00
Operation
Disabled
Refer to the Disabled Mode (# 1).
Continuous Mode
Refer to the Continuous Mode (#s
2A & 2B).
0
1
0
0
0
1
0
0
1
0
1
0
0x01
0x01
> 0x01
> 0x01
0x00
X
X
> 0x00
X
> 0x00
X
0x00
Sampled, Non-Filtered mode
Refer to the Sampled, Non-Filtered
Mode (#s 3A & 3B).
Sampled, Filtered mode
Refer to the Sampled, Filtered
Mode (#s 4A & 4B).
Windowed mode
Comparator output is sampled on
every rising bus clock edge when
SAMPLE=1 to generate COUTA
Refer to the Windowed Mode (#s
5A & 5B).
Table continues on the next page...
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
868
Freescale Semiconductor, Inc.