19.4.5 Automatic compare function
The compare function can be configured to check for an upper or lower limit. After the
input is sampled and converted, the result is added to the two's complement of the
compare value (ADC_CVH and ADC_CVL). When comparing to an upper limit
(ADC_SC2[ACFGT] = 1), if the result is greater-than or equal-to the compare value,
ADC_SC1[COCO] is set. When comparing to a lower limit (ADC_SC2[ACFGT] = 0), if
the result is less than the compare value, ADC_SC1[COCO] is set. The value generated
by the addition of the conversion result and the two's complement of the compare value is
transferred to ADC_RH and ADC_RL.
On completion of a conversion while the compare function is enabled, if the compare
condition is not true, ADC_SC1[COCO] is not set and no data is transferred to the result
registers. An ADC interrupt is generated on the setting of ADC_SC1[COCO] if the ADC
interrupt is enabled (ADC_SC1[AIEN] = 1).
On completion of all conversions while the compare function is enabled and FIFO
enabled, if none of the compare conditions are not true when ADC_SC4[ACFSEL] is low
or if not all of compare conditions are true when ADC_SC4[ACFSEL] is high,
ADC_SC1[COCO] is not set. The compare data are transferred to the result registers
regardless of compare condition true or false when FIFO enabled.
Note
The compare function can monitor the voltage on a channel
while the MCU is in Wait or Stop3 mode. The ADC interrupt
wakes the MCU when the compare condition is met.
Note
The compare function can not work in continuous conversion
mode when FIFO enabled.
19.4.6 FIFO operation
The ADC module supports FIFO operation to minimize the interrupts to CPU in order to
reduce CPU loading in ADC interrupt service routines. This module contains two FIFOs
to buffer analog input channels and analog results respectively.
The FIFO function is enabled when the ADC_SC4[AFDEP] bits are set non-zero. The
FIFO depth is indicated by these bits. The FIFO supports up to eight level buffer.
The analog input channel FIFO is accessed by ADC_SC1[ADCH] bits, when FIFO
function is enabled. The analog channel must be written to this FIFO in order. The ADC
will not start the conversion if the channel FIFO is fulfilled below the level indicated by
Functional description
MC9S08PT60 Reference Manual, Rev. 4, 08/2014
556
Freescale Semiconductor, Inc.
Содержание MC9S08PT60
Страница 2: ...MC9S08PT60 Reference Manual Rev 4 08 2014 2 Freescale Semiconductor Inc...
Страница 34: ...MC9S08PT60 Reference Manual Rev 4 08 2014 34 Freescale Semiconductor Inc...
Страница 40: ...System clock distribution MC9S08PT60 Reference Manual Rev 4 08 2014 40 Freescale Semiconductor Inc...
Страница 120: ...Flash and EEPROM registers descriptions MC9S08PT60 Reference Manual Rev 4 08 2014 120 Freescale Semiconductor Inc...
Страница 200: ...Port data registers MC9S08PT60 Reference Manual Rev 4 08 2014 200 Freescale Semiconductor Inc...
Страница 228: ...System clock gating control registers MC9S08PT60 Reference Manual Rev 4 08 2014 228 Freescale Semiconductor Inc...
Страница 262: ...Human machine interfaces HMI MC9S08PT60 Reference Manual Rev 4 08 2014 262 Freescale Semiconductor Inc...
Страница 298: ...Functional Description MC9S08PT60 Reference Manual Rev 4 08 2014 298 Freescale Semiconductor Inc...
Страница 396: ...FTM Interrupts MC9S08PT60 Reference Manual Rev 4 08 2014 396 Freescale Semiconductor Inc...
Страница 440: ...Functional description MC9S08PT60 Reference Manual Rev 4 08 2014 440 Freescale Semiconductor Inc...
Страница 468: ...Initialization Application Information MC9S08PT60 Reference Manual Rev 4 08 2014 468 Freescale Semiconductor Inc...
Страница 570: ...Application information MC9S08PT60 Reference Manual Rev 4 08 2014 570 Freescale Semiconductor Inc...
Страница 648: ...Memory map and register description MC9S08PT60 Reference Manual Rev 4 08 2014 648 Freescale Semiconductor Inc...
Страница 676: ...Resets MC9S08PT60 Reference Manual Rev 4 08 2014 676 Freescale Semiconductor Inc...