AN1740 Freescale Semiconductor / Motorola, AN1740 Datasheet - Page 58

no-image

AN1740

Manufacturer Part Number
AN1740
Description
Applications Using the Analog Subsystem on MC68HC05JJ/JP Series Microcontrollers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
Conversion
Masking A/D Fault
58
It may appear that a single software flag is needed to determine if the
conversion is running or complete. But the two flags also allow for an
initialization case (both clear) or a faulty sequence (both set). With the
use of the CIP and EOC flags, the conversion overlap fault can be
detected when the next TOC or OCF occurs. If the EOC flag is clear and
the CIP flag is still set, then there is an overlap and the next ICF is used
for the conversion or ignored. If used, the time should account for any
timer roll over that may have occurred. If not used, the integration ramp
should be terminated (by manually clearing the CHG bit) and any ICF
ignored (by reading the LSB of the input capture registers). In either
case, there will be one conversion cycle dropped to use or clear out the
overlapping ICF.
In mode 0 or mode 1, the software handles all the events of the
conversion in an established subsequence such that simultaneous
events do not happen. In mode 2 or mode 3, there exists the possibility
that an unwanted conversion fault may make an ICF occur near the
same time as the TOF or OCF, which is trying to start another conversion
as shown in
software latency getting into the timer interrupt service routine and any
software processing before the actual test of the ICF bit. The problem is
that such an unwanted ICF just before the TOF cannot be discerned
from a true ICF that would occur if the input voltage were near V
fault is only associated with mode 2 or mode 3.
This fault can be detected by looking at the captured time for the ICF. If
it is before the TOF or OCF event (a negative number), then it was a fault
and should be ignored, the CPF2 flag cleared, and the input capture
released by reading the LSB. If the time difference is a small positive
number, then the ICF is assumed to be a valid conversion of a small
voltage near V
Freescale Semiconductor, Inc.
For More Information On This Product,
EOC — End of conversion
– Set when ICF detected at end of conversion
– Clear when TOF or OCF occurs starting charge cycle
Go to: www.freescale.com
Figure
SS
.
26. This ICF cannot be evaluated until after the
MOTOROLA
SS
AN1740
. This

Related parts for AN1740