Cmp Functional Modes - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

SCR[IER] and SCR[IEF] are used to select the condition which will cause the CMP
module to assert an interrupt to the processor. SCR[CFF] is set on a falling-edge and
SCR[CFR] is set on rising-edge of the comparator output. The optionally filtered CMPO
can be read directly through SCR[COUT].

24.4.1 CMP functional modes

There are the following main sub-blocks to the CMP module:
• The comparator itself
• The filter function
The filter, CR0[FILTER_CNT], can be clocked from an internal clock source only. The
filter is programmable with respect to the number of samples that must agree before a
change in the output is registered. In the simplest case, only one sample must agree. In
this case, the filter acts as a simple sampler.
The comparator filter and sampling features can be combined as shown in the following
table. Individual modes are discussed below.
Mode #
CR1[EN]
CR1[WE]
1
0
2A
1
2B
1
3B
1
4B
1
All other combinations of CR1[EN], CR1[WE], CR1[SE], CR0[FILTER_CNT], and FPR[FILT_PER] are illegal.
For cases where a comparator is used to drive a fault input, for example, for a motor-
control module such as FTM, it must be configured to operate in Continuous mode so
that an external fault can immediately pass through the comparator to the target fault
circuitry.
Freescale Semiconductor, Inc.
Table 24-2. Comparator sample/filter controls
CR0[FILTER_C
CR1[SE]
NT]
X
X
0
0
0x00
0
0
0
0
0x01
0
0
> 0x01
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
FPR[FILT_PER]
X
X
X
X
0x00
> 0x00
> 0x00
Chapter 24 Comparator (CMP)
Operation
Disabled
See the
Disabled mode (#
Continuous Mode
See the
Continuous mode (#s 2A &
2B).
Sampled, Non-Filtered mode
See the
Sampled, Non-Filtered
mode (#s
3B).
Sampled, Filtered mode
See the
Sampled, Filtered mode (#s
4B).
1).
403

Advertisement

Table of Contents
loading

Table of Contents