
QSM
REFERENCE MANUAL
USING THE QSPI FOR ANALOG DATA AQUISITION
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
A-11
unknown voltage is measured, scaled into millivolts, then displayed on an LED read-
out. Again, note that the CPU just reads the latest conversion results.
The total time to complete the entire queue is calculated as follows:
time per entry
=
=
=
=
=
=
(no. of bits
SCK period) + DSCKL period + DTL period
(10
500 ns) + 1.4375 ms + 22 ms
28.4375 ms
(no. of entries)
time per entry
3
28.4 ms
85.3 ms
The age of the oldest result is calculated as follows:
time per wrap
maximum age
sample time
maximum age
The maximum-age equation accounts for the fact that the analog level may change
while sampling, conversion, and transfer occurs. If the sample time is not considered,
the oldest data is simply the sum of the time per wrap and the time per entry because
the A/D result data always emerges on the transfer following the transfer requesting
the conversion.
=
=
=
[time per entry
(no. of entries + 1)] + sample time
6
SCK period = 6
500 ns = 3 ms
[28.4 ms
(3 + 1)] + 3 ms = 116.75 ms
A.7 Other Useful Concepts
If the QSPI is to be used to control another peripheral in addition to an A/D converter,
it may be advisable to interleave the transfers to the two peripherals. Interleaving can
improve the overall serial transfer rate (queue entries per second) by constructively uti-
lizing the time ordinarily wasted waiting for a conversion.
If faster data acquisition is necessary, this concept can also apply to a second A/D
converter. The conversion workload must be split between the two A/D converters so
that one is sampling while the other is converting, reducing the average time between
conversions from 28.4 ms to 14.2 ms. If three A/D converters are employed, the time
drops to 9.5 ms. If a fourth A/D converter is used, the total acquisition time is reduced
to the theoretical minimum value, 7.5 ms. The theoretical minimum is the sum of the
transfer time (5 ms), the minimum DSCK time (1.4375 ms), and the minimum delay
after transfer (1.0625 ms).
Another useful feature of the QSPI is the ability to support subqueues. Subqueues are
formed when the normal queue execution sequence is altered to perform a special
task. Often, the special task needs attention as soon as possible. Afterward, it is usu-
ally desirable to resume execution of the previously defined queue.
An example would be the continuous scanning of three A/D converter channels (as
previously described), but upon detection of an interrupt, quickly setting an output port
to a given value. After the output data is transferred, the QSPI should continue scan-
ning the three A/D channels. This operation is easy due to the branching capability of
F
Freescale Semiconductor, Inc.
n
.