Академический Документы
Профессиональный Документы
Культура Документы
Analog/Digital Converters
Objectives: To introduce the basics of digital-to-analog and analog-to-digital
conversion and the sampling theorem.
Topics covered:
Op-Amps
Sampling Theorem
Problem 1 - DAC
Problem 2 - Tracking ADC
Problem 3 - Successive Approximation ADC
Problem 4 - Internal ADC
infinite gain
infinite bandwidth
infinite input impedance
zero output impedance
will accept the smallest input signal and amplify it to an infinite voltage
over all frequency ranges
That's quite a tall order and real op-amps come very close to the ideal. Observe that
you cannot generate an infinite voltage. There is no such thing as a "free lunch". The
voltage output from the op-amp will be limited to the supply voltages (called the
supply rail). Similarly, the current output will be restricted by the output impedances
of the op-amp and the power supply.
Here are typical specifications for the popular "741" operational amplifier.
A741 op-amp Data Sheet 11 pages, 162KB pdf
Voltage Gain
Bandwidth
Input Impedance
Output Impedance
Ideal op-amp
infinite
infinite
infinite
0
741 op-amp
200,000
1MHz
2M ohms
75 ohms
What this means is that quite often we can design an analog circuit using idealized
circuits and not worry about the limitations of the op-amp. The circuits below are
some basic ways of using op-amps.
The slew rate is another measure of the bandwidth of an amplifier. It is a measure of
how quickly the output can change and is recorded in units of voltage/time (usually
V/s).
Negative Feed-back
We think of positive feed-back as having pleasant connotations. In control systems,
positive feed-back causes unfettered growth, run-away behaviour and sometimes
oscillations. In electronics, negative feed-back is a desirable thing. With lots of
excess gain, the op-amp can use negative feed-back to limit the overall voltage gain of
the circuit. With negative feed-back come many benefits such as reduced non-linearity
and lower output impedance. Negative feed-back is the control mechanism to keep
things in check.
Differential Amplifier
This is the basic circuit from which all others can be derived. All op-amps are
designed to amplify the voltage difference between the non-inverting (+) and
inverting (-) inputs while ignoring any common-mode signal that may be common
to both. The ability to reject the common signal while amplifying the differential input
is called the common-mode rejection ratio (CMRR).
Summing Amplifier
Recall the simple DAC circuit in Chapter 7, Problem 8. By adding an op-amp to the
circuit any loading effect on the resistor network is virtually eliminated.
Voltage Comparator
An analog or voltage comparator compares two input voltages and determines which
is higher or lower. Since the voltage gain is infinite the output voltage could have only
one of two values, equal to the negative or positive supply rail. Thus an input signal
with a continuous analog range is converted to a digital signal. This is a 1-bit ADC.
What is the output of the comparator when the input voltage Vin is equal to the
reference voltage Vref?
Sampling Theorem
When an analog waveform is sampled, the voltage signal which is continuous in both
amplitude and time is digitized. This digitization process results in quantization
effects in both domains which lead to important consequences. In the amplitude
domain, the resolution is determined by the number of bits of the ADC. Thus an 8-bit
ADC can digitize the input signal into 255 voltage steps, equivalent to a precision of
0.4%. The following table shows the effects of various number of ADC bits.
No. of ADC
bits
8
10
12
14
16
No. of Steps
Precision
255
1023
4095
16383
65535
0.4 %
0.01 %
0.02 %
0.006 %
0.0015 %
The resolution in the time domain is determined by the sampling rate, that is, how
many samples per second are recorded. The sampling or Nyquist theorem states that
the sampling frequency must be at least twice the highest frequency being recorded.
The corollary to this is that there must be no frequency component in the signal that is
greater than one-half of the sampling frequency.
When fs is greater than twice the input frequency, the reconstructed waveform has a
frequency component that represents the input waveform.
The Nyquist limit is the highest frequency component which can be recorded for a
given sampling frequency. This limit is equal to one-half of the sampling frequency.
For example, it is generally accepted that the range of human hearing (and highfidelity musical recordings) is 20Hz to 20KHz. The standard sampling frequency for
digital recordings (CD) is 44.1KHz. It is interesting to note that increasing the
sampling frequency does not improve on the quality of the recorded signal. Only the
Nyquist limit is raised to a higher level.
A time-varying signal can be represented graphically in a voltage vs time display in
the time domain. The same information can be transformed into amplitude vs
frequency in the frequency domain. This conversion from the time domain to the
frequency domain is performed by the process called Fourier transformation. It is
useful to consider the sampling theorem in frequency space.
If the sampling frequency is fs, then the Nyquist limit is fN = fs. The input frequency
fi must be less than the Nyquist limit fN.
More importantly, the corollary of the Nyquist theorem is that there must be no
frequency component in the input signal which is greater than the Nyquist limit.
Construct the LM311 comparator circuit as shown and interface the output to an input
pin of the MCU. This signal is to be interrogated by the computer in order to
determine the direction of the required step.
As an alternative, use the internal analog comparator of the MCU.
software. Use the sine-wave output of a function generator for your external
input signal to be digitized. Adjust the amplitude and offset of the sine-wave
output so that the signal is between 0 and 2.56 volts.
2. Calculate the highest frequency sine-wave of 2.56 volts peak-to-peak that can
be faithfully followed by your tracking ADC design. In order to do this you
need to determine the clock frequency of your ADC algorithm. What is the
slew rate of your system?
3. Verify your answer by comparing the input signal with the reconstructed
signal as generated by the DAC. Observe the two analog signals on the
oscilloscope and record the frequency at which the reconstructed signal
deviates from the input signal.
4. The UP/DOWN output of the comparator is a serial bit-stream from which the
analog signal can be reconstructed. What is this scheme called? Where are you
most likely to find this data stream employed?
Use the internal ADC of the MCU and test using a simple program. Use the internal
timer to record samples every 500s. Digitize an external sine-wave input and
generate the reconstructed waveform using the AD558 DAC. Compare the input wave
with the reconstructed wave on the oscilloscope. Playback the reconstructed wave
through an audio amplifier and loud-speaker. You may need a low-pass filter to
remove clock frequencies.