AN1740 Freescale Semiconductor / Motorola, AN1740 Datasheet - Page 68

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
General A/D Techniques
Channel Selection
Techniques
Sample and Hold
Techniques
68
The following sections cover some considerations in using channel
selection, sample and hold, and other A/D-related topics.
Normally, there is a need to select more than one channel in performing
an A/D conversion. This is needed to select between reference and
unknown signals as well as to have more than one external voltage to
monitor. In the case of modes 0 or 1, it is quite easy to schedule the
sequence of events needed to change channels and then execute a
conversion since all the steps are under direct software control and
timing. But, in the case of modes 2 or 3, the A/D conversion is driven
automatically by the 16-bit timer with little interface to the software. In
modes 2 or 3, the timing of the channel selection needs additional
consideration.
This can be solved easily if we make the channel selection occur at the
end of the prior conversion cycle. In both modes 2 and 3, the change in
channel would then occur in the service routine for the ICF. If the
channel selection is a recurring sequence, then the ICF service routine
can merely step to the next channel in the sequence. If, however, there
is a need to select the next channel based on changing criteria, then the
next channel to be selected can be done with a pointer location in RAM
and a pair of software flag bits to handshake between the interrupt-
driven ICF service routine and the asynchronously running background
software that determines which channel to convert next.
A sample and hold method can be applied to all A/D conversions. As
with making channel selections, sample and hold in modes 0 and 1 can
be done easily, while in modes 2 or 3 the timing of the sample needs
additional consideration. This can be solved easily, if we consider that
the sample can actually last into the start of the conversion cycle.
In mode 2, the triggering event is the TOF. If the OCF is not being used
for some other task, it can be used to trigger the start of the sample just
before the next TOF occurs. Then in the TOF service routine, the sample
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
AN1740

Related parts for AN1740