Automatic Compare Function - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

Functional description
If the compare function is either disabled or evaluates true, after the selected number of
conversions are completed, the average conversion result is transferred into the data
result registers, Rn, and SC1n[COCO] is set. An ADC interrupt is generated upon the
setting of SC1n[COCO] if the respective ADC interrupt is enabled, that is,
SC1n[AIEN]=1.
The hardware average function can perform conversions on a
channel while the MCU is in Wait or Normal Stop modes. The
ADC interrupt wakes the MCU when the hardware average is
completed if SC1n[AIEN] is set.

23.5.5 Automatic compare function

The compare function can be configured to check whether the result is less than or
greater-than-or-equal-to a single compare value, or, if the result falls within or outside a
range determined by two compare values.
The compare mode is determined by SC2[ACFGT], SC2[ACREN], and the values in the
compare value registers, CV1 and CV2. After the input is sampled and converted, the
compare values in CV1 and CV2 are used as described in the following table. There are
six Compare modes as shown in the following table.
ADCCV1
SC2[AC
SC2[AC
relative to
FGT]
REN]
ADCCV2
0
0
1
0
0
1
Less than or
0
1
Greater than
1
1
Less than or
1
1
Greater than
374
Table 23-13. Compare modes
Function
Less than threshold
Greater than or equal to threshold
Outside range, not inclusive
equal
Inside range, not inclusive
Inside range, inclusive
equal
Outside range, inclusive
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Note
Compare mode description
Compare true if the result is less than the
CV1 registers.
Compare true if the result is greater than or
equal to CV1 registers.
Compare true if the result is less than CV1
Or the result is greater than CV2.
Compare true if the result is less than CV1
And the result is greater than CV2.
Compare true if the result is greater than or
equal to CV1 And the result is less than or
equal to CV2.
Compare true if the result is greater than or
equal to CV1 Or the result is less than or
equal to CV2.
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents