22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

262 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

until the comparator switches from high to low, indicating that the unknown<br />

input voltage has just been crossed. Of course, this is not likely to be<br />

any faster than the voltage-to-time methods described earlier. However, if<br />

the unknown voltage has not changed much since the last reading, the search<br />

could be started at the last value rather than zero.<br />

A refinement <strong>of</strong> the linear search is the tracking ADC. In operation, the<br />

comparator output is constantly monitored. If the comparator output is<br />

high, the DAC output is increased one step. If it is low, the DAC is backed<br />

<strong>of</strong>f one step. The result is that the DAC always contains the digital equivalent<br />

<strong>of</strong> the input voltage within one step, provided the unknown voltage<br />

changes slowly. The inherent one-step oscillation around the correct value<br />

may be suppressed by use <strong>of</strong> a window comparator, which has an "equals"<br />

output as well as a greater-than and less-than output. If the equals window is<br />

set to be a little over one step wide, the oscillation is stopped. A window<br />

comparator is simply two ordinary comparators with different reference<br />

voltages-the difference being the window width.<br />

The control circuit for a tracking ADC is exceptionally simple, just a<br />

high-frequency oscillator and an up--down counter. The comparator output is<br />

connected to the direction control input <strong>of</strong> the counter and the clock makes<br />

the counter count in the indicated direction. The clock period must be longer<br />

than the settling time <strong>of</strong> the DAC. Usually in a microcomputer system, the<br />

clock can be a microprocessor clock phase chosen such that the counter never<br />

changes when it might be read by the microprocessor. As long as the rate <strong>of</strong><br />

input voltage change does not exceed the counting speed, the tracking ADC<br />

has a "zero" conversion time. The slew rate limitation can be very real,<br />

however. For example, a 12-bit tracking ADC with I-MHz clock would<br />

require over 4 msec to slew from one end <strong>of</strong> the range to the other. Ifused for<br />

direct digitizing <strong>of</strong> audio, such a converter could not handle full-scale sine<br />

waves higher than 77 Hz without serious errors.<br />

Successive Approximation Search<br />

The most efficient search algorithm and the one used by all high-speed<br />

ADCs is termed successive approximation. The same algorithm is called a binary<br />

search by computer scientists. It works by progressively narrowing in on the<br />

unknown voltage level by testing a series <strong>of</strong> carefully chosen "trial" voltages<br />

and looking at the comparator output for a high-low indication. (This same<br />

problem is the basis <strong>of</strong> a popular computer game in which the computer<br />

"thinks" <strong>of</strong> a random number and responds to the player's guesses with a "too<br />

high" or "too low" verdict.) It is easily proven that no more efficient search<br />

algorithm exists when only a high-low comparison decision is available for<br />

each trial.<br />

Referring to Fig. 7-30, it is easy to see how the algorithm works. The<br />

example is one <strong>of</strong> homing in on an unknown voltage <strong>of</strong> + 3.253 V using a

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!