English
Language : 

K60P100M100SF2RM Datasheet, PDF (838/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
Functional description
After the selected input is sampled and converted, the result is placed in an accumulator
from which an average is calculated once the selected number of conversions has been
completed. When hardware averaging is selected, the completion of a single conversion
will not set the COCO bit.
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 the COCO bit is set. An ADC interrupt is generated upon the
setting of COCO if the respective ADC interrupt is enabled (AIEN=1).
Note
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] bit was set.
34.4.6 Automatic compare function
The compare function can be configured to check if 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 ACFGT,
ACREN, and the values in the compare value registers (CV1 and CV2). After the input is
sampled and converted, the compare values (CV1 and CV2) are used as described in the
following table.There are six compare modes as shown in the following table.
ACFGT
0
1
0
0
1
1
ACREN
0
0
1
1
1
1
Table 34-115. Compare modes
ADCCV1
relative to
ADCCV2
—
Function
Less than threshold
—
Greater than or equal to threshold
Less than or
equal
Greater than
Outside range, not inclusive
Inside range, not inclusive
Less than or Inside range, inclusive
equal
Greater than Outside range, inclusive
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.
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
838
Freescale Semiconductor, Inc.