AN1740 Freescale Semiconductor / Motorola, AN1740 Datasheet - Page 67

no-image

AN1740

Manufacturer Part Number
AN1740
Description
Applications Using the Analog Subsystem on MC68HC05JJ/JP Series Microcontrollers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Value of the
Captured Times
Correct Mode
Initialization
AN1740
MOTOROLA
The biggest advantage of modes 2 and 3 is that the start time of the
conversion is clearly defined by the TOF of OCF timer state and the end
of conversion is captured precisely by the ICF. Therefore, the software
sequence and cycle times are not critical to the timing accuracy. The
only concern should be that the ICF is combined with the correct TOF of
OCF that started the conversion ramp. Also, the software must access
the proper values and clear the flags before the next conversion is to
begin. This allows more latitude in defining error checks than is possible
with modes 0 or 1, which are sensitive to software cycle timing.
The initialization of either mode 2 or 3 must be done at the proper time,
since the TOF or OCF flags may become set before the mode can be
established. If the TOF is already set and mode 2 is initiated, then the
charge ramp will begin immediately without regard for when the TOF
actually occurred. Similarly, the OCF could be set before mode 3 is
initialized. It is important that the TOF and ICF flags be clear before
mode 2 is established or that the OCF and ICF flags be clear before
mode 3 is established. The best way to accomplish this is to wait for the
first TOF in mode 2 or first OCF in mode 3, then clear all flags and finally
set the ATD1 and ATD2 bits as required.
Refer to application note A/D Conversion Software for the
MC68HC05JJ/JP Series Microcontrollers , Motorola document order
number AN1739/D, for detailed software examples on how to implement
a mode 2 or mode 3 A/D conversion.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Automated A/D Conversions
Application Note
67

Related parts for AN1740