Solution
a. Va__(0/256) Vref _ 0 V
b. Va__(128/256) Vref__(1/2) Vref__5 V
c. Va__(64/256) Vref__(1/4) Vref__2.5 V
d. Va__(192/256) Vref__(3/4) Vref__7.5 V
In general, a DAC input code consisting of 1 followed by all 0s generates an output
value of 1⁄2 full scale. A code of 01 followed by all 0s yields an output of 1⁄4 full scale. An
output of 11 followed by all 0s generates an output of 3⁄4 full scale.
❘❙❚
❘❙❚ SECTION 12.2C REVIEW PROBLEM
12.4 Calculate Va for an 8-bit R-2R ladder DAC when the input code is 10100001. Assume
that Vref is 10 V.
MC1408 Integrated Circuit D/A Converter
Multiplying DAC A DAC whose output changes linearly with a change in DAC
reference voltage.
K E Y T E R M
12.2 • Digital-to-Analog Conversion 579
A common and inexpensive DAC is the MC1408 8-bit multiplying digital-to-analog converter.
This device also goes by the designation DAC0808. A logic symbol for this DAC is
shown in Figure 12.11.
FIGURE 12.11
MC1408 DAC
The output current, Io, flows into pin 4. Io is a binary fraction of the current flowing
into pin 14, as specified by the states of the digital inputs. Other inputs select the range of
output voltage and allow for phase compensation.
Figure 12.12 shows the MC1408 in a simple D/A configuration. R14 and R15 are approximately
equal. Pin 14 is approximately at ground potential. This implies:
1. That the DAC reference current can be calculated using only Vref (_) and R14 (Iref _
Vref (_)/R14)
2. That R15 is not strictly necessary in the circuit. (It is used primarily to stabilize the circuit
against temperature drift.)
The reference voltage must be set up so that current flows into pin 14 and out of pin 15.
Thus, Vref (_) must be positive with respect to Vref (_). (It is permissible to ground pin 14
if pin 15 is at a negative voltage.)
Io is given by:
Since the output is proportional to Vref (_), we refer to the MC1408 as a multiplying
DAC.
Io should not exceed 2 mA. We calculate the output voltage by Ohm’s law: Vo _
_Io RL. The output voltage is negative because current flows from ground into pin 4.
The open pin on the Range input allows the output voltage dropped across RL to
range from _0.4 V to _5.0 V without damaging the output circuit of the DAC. If the
Range input is grounded, the output can range from _0.4 to _0.55 V. The lower voltage
range allows the output to switch about four times faster than it can in the higher
range.
I
b b b b b b b b V
oR
7 6 5 4 3 2 1 0
2 4 8 16 32 64 128 256 14
ref ( )
580 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits
❘❙❚ EXAMPLE 12.5 The DAC circuit in Figure 12.12 has the following component values: R14 _ R15 _
5.6 k_; RL _ 3.3 k_. Vref (_) is _8 V, and Vref (_) is grounded.
Calculate the value of Vo for each of the following input codes: b7b6b5b4b3b2b1b0 _
00000000, 00000001, 10000000, 10100000, 11111111.
What is the resolution of this DAC?
Solution First, calculate the value of Iref.
Iref _ Vref (_)/R14
_ _8 V/5.6 k_ _ 1.43 mA
Calculate the output current by using the binary fraction for each code. Multiply _Io
by RL to get the output voltage.
b7b6b5b4b3b2b1b0 _ 00000000
Io _ 0, Vo _ 0
b7b6b5b4b3b2b1b0 _ 00000001
Io _ (1/256) (1.43 mA) _ 5.58 _A
Vo__(5.58 _A)(3.3 k_) __18.4 mV
b7b6b5b4b3b2b1b0 _ 10000000
Io _ (1/2) (1.43 mA) _ 714 _A
Vo__(714 _A)(3.3 k_) __2.36 V
FIGURE 12.12
MC1408 Configured for
Unbuffered Analog Output
12.2 • Digital-to-Analog Conversion 581
b7b6b5b4b3b2b1b0 _ 10100000
Io__(1/2 _ 1/8)(1.43 mA) _ (5/8)(1.43 mA) _ 893 _A
Vo__(893 _A)(3.3 k_) __2.95 V
b7b6b5b4b3b2b1b0 _ 11111111
Io _ (255/256) (1.43 mA) _ 1.42 mA
Vo__(1.42 mA)(3.3 k_) __4.70 V
Resolution is the same as the output resulting from the LSB: 18.4 mV/step
❘❙❚
❘❙❚ SECTION 12.2D REVIEW PROBLEM
12.5 The output voltage range of an MC1408 DAC can be limited by grounding the Range
pin. Why would we choose to do this?
Op Amp Buffering of MC1408
The MC1408 DAC will not drive much of a load on its own, particularly when the Range
input is grounded. We can use an operational amplifier to increase the output voltage and
current. This allows us to select the lower voltage range for faster switching while retaining
the ability to drive a reasonable load. The output voltage is limited only by the op amp
supply voltages. We use a 34071 high slew rate op amp for fast switching.
Figure 12.13 shows such a circuit. The 0.1-_F capacitor decouples the _5-V supply.
(The manufacturer actually recommends that the _5-V logic supply not be used as a reference
voltage. It doesn’t matter for a demonstration circuit, but may introduce noise that is
unacceptable in a commercial design.) The 75-pF capacitor is for phase compensation.
Vref(_)
Range
Ground
Comp
b3
b6
b7
(5)
R15
b5
b4
b2
b1
b0
VCC VEE
_12 V
_12 V
_12 V
75 pF
_5 V
Vref(_)
0.1 _F
R14B
5 k_
RFB
10 k_
RFA
4.7 k_
R14A
2.7 k_
1 k_
Vref _ _ 5 V
I0
I0
I0
Va
MC1408
MSB
LSB
_
_
_
_
(6)
(8)
(7)
(9)
(10)
(11)
(12)
(15)
(2)
(1)
(14) (4)
(13)
(16)
(3)
Va
_
_
FIGURE 12.13
DAC With Op Amp Buffering
582 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits
Va is positive because the voltage drop across RF is positive with respect to the virtual
ground at the op amp (_) input. This feedback voltage is in parallel with (i.e., the same as)
the output voltage, since both are measured from output to ground.
We can develop the formula for the analog voltage, Va, in three stages:
1. Calculate the reference current:
Iref _ Vref(_)/R14
2. Determine the binary-weighted fraction of reference current to get DAC output current:
3. Use Ohm’s law to calculate the op amp output voltage:
The resistor values in the above formulae are the total resistances for the corresponding
part of the circuit. That is, R14 _ R14A _ R14B and RF _ RFA _ RFB. These both consist
of a fixed and a variable resistor, which has two advantages: (a) The reference current
and output voltage can be independently adjusted within a specified range by the variable
resistors. (b) The resistances defining the reference and feedback currents cannot go below
a specified minimum value, determined by the fixed resistance, ensuring that excessive
current does not flow into the reference input or the DAC output terminal.
Va can, in theory, be any positive value less than the op amp positive supply (_12 V in
this case). Any attempt to exceed this voltage makes the op amp saturate. The actual maximum
value, if not the same as the op amp’s saturation voltage, depends on the values of RF
and R14.
❘❙❚ EXAMPLE 12.6 Describe a step-by-step procedure that calibrates the DAC circuit in Figure 12.13 so that it
has a reference current of 1 mA and a full-scale analog output voltage of 10 V, using only
a series of measurements of the analog output voltage. When the procedure is complete,
what are the resistance values in the circuit? What is the range of the DAC?
Solution Since the maximum output of the DAC is 1 LSB less than full scale, we must
indirectly measure the full scale value. We can do so by setting the digital input code to
10000000, which exactly represents the half-scale value of output current, and making appropriate
adjustments.
Set the variable feedback resistor to zero so that the output voltage is due only to the
fixed feedback resistor and the feedback current. Measure the output voltage of the circuit
and adjust R14B so that Va _ 2.35 volts. Ohm’s law tells us that this sets the feedback current
to IF _ 2.35 V/4.7 k_ _ 0.5 mA. Since the digital code is set for half scale, Iref _ 2 IF
_ 1 mA.
Adjust RFB so that the half-scale output voltage is 5.00 V.
After adjustment, R14 _ 2.7 k_ _ 2.3 k_ _ 5 k_ and RF _ 4.7 k_ _ 4.3 k_ _ 10
k_. In both cases the variable resistors were selected so that their final values are about
half-way through their respective ranges.
The range of the DAC is 0 V to 9.961 V.
(FS _ 1 LSB _ 10 V _ (10 V/256) _ 9.961 V)
V IR
R
R
o F V
F
a ref
digital code
256
14
I
b b b b b b b b
I
b b b b b b b b V
R
V
R
o
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
14
2 4 8 16 32 64 128 256
2 4 8 16 32 64 128 256
ref
ref
14
digital code ref
256
12.2 • Digital-to-Analog Conversion 583
❘❙❚ EXAMPLE 12.7 Figure 12.14 shows the circuit of an analog ramp (sawtooth) generator built from an
MC1408 DAC, an op amp, and an 8-bit synchronous counter. (A ramp generator has numerous
analog applications, such as sweep generation in an oscilloscope and frequency
sweep in a spectrum analyzer.)
CTR DIV 256
Q3
Q6
Q7
Q5
Q4
Q2
Q1
Q0
CLK
Vref(_)
Range
Ground
b3
b6
b7
b5
b4
b2
b1
b0
VCC VEE
_5 V _12 V
Vref(_)
0.1 _F
5 k_
10 k_ 4.7 k_
2.7 k_
Vref _ _ 5 V
I0
Va
MC1408
_
_
_
_
75 pF
FIGURE 12.14
Example 16.5
DAC Ramp Generator
Briefly explain the operation of the circuit and sketch the output waveform. Calculate
the step size between analog outputs resulting from adjacent codes. Assume that the DAC
is set for _6-V output when the input code is 10000000.
Calculate the output sawtooth frequency when the clock is running at 1 MHz.
Solution The 8-bit counter cycles from 00000000 to 11111111 and repeats continuously.
This is a total of 256 states.
The DAC output is 0 V for an input code of 00000000 and (12 V _ 1 LSB) for a
code of 11111111. We know this because a code of 10000000 always gives an output
voltage of half the full-scale value (6 V _ 12 V/2), and the maximum code gives an
output that is one step less than the full-scale voltage. The step size is 12 V/256 steps _
46.9 mV/step. The DAC output advances linearly from 0 to (12 V _ 1 LSB) in 256
clock cycles.
Figure 12.15 shows the analog output plotted against the number of input clock cycles.
The ramp looks smooth at the scale shown. A section enlarged 32 times shows the analog
steps resulting from eight clock pulses.
One complete cycle of the sawtooth waveform requires 256 clock pulses. Thus, if
fCLK _ 1 MHz, fo _ 1 MHz/256 _ 3.9 kHz.
(Note that if we do not use a high slew rate op amp, the sawtooth waveform will not
have vertical sides.)
584 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits
❘❙❚
Bipolar Operation of MC1408
Many analog signals are bipolar, that is, they have both positive and negative values. We
can configure the MC1408 to produce a bipolar output voltage. Such a circuit is shown in
Figure 12.16.
We can model the bipolar DAC as shown in Figure 12.16b. The amplitude of the
constant-current sink, Io, is set by Vref (_), R14, and the binary value of the digital inputs.
Is is determined by Ohm’s law: Is _ Vref (_)/R4.
The output voltage is set by the value of IF:
Va _ IF RF _ IF (RFA _ RFB)
By Kirchhoff’s current law:
Is _ IF _ Io _ 0
or
IF _ Io _ Is
Thus, output voltage is given by:
Va _ (Io _ Is)RF _ Io RF _ Is RF
_ __
b
2
7_
_ _
b
4
6_
_ _
b
8
5_
_ _
1
b
6
4_
_ _
3
b
2
3_
_ _
6
b
4
2_
_ _
1
b
2
1
8
_ _ _
2
b
5
0
6 _
_ _
R
R
1
F
4
_ Vref _ _
R
R
F
4
_ Vref
_ __
digit
2
a
5
l
6
code
____
R
R
1
F
4
__ Vref _ _
R
R
F
4
_ Vref
How do we understand the circuit operation from this mathematical analysis?
FIGURE 12.15
Example 12.7
Sawtooth Waveform Output of Circuit in Figure 12.14
12.2 • Digital-to-Analog Conversion 585
The current sink, Io, is a variable element. The voltage source, Vref (_), remains constant.
To satisfy Kirchhoff’s current law, the feedback current, IF, must vary to the same degree
as Io. Depending on the value of Io with respect to Is, IF can be positive or negative.
We can get some intuitive understanding of the circuit operation by examining several
cases of the equation Va.
FIGURE 12.16
MC1408 as a Bipolar D/A Converter
586 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits
Case 1: Io _ 0. This corresponds to the digital input b7b6b5b4b3b2b1b0 _ 00000000. The
output voltage is:
This is the maximum negative output voltage.
Case 2: 0 _ Io _ Is. The term (Io _ Is) is negative, so output voltage is also a negative
value.
Case 3: Io _ Is. The output is given by:
Va _ (Io _ Is)RF _ 0
The digital code for this case could be any value, depending on the setting of R14. To set the
zero-crossing to half-scale, set the digital input to 10000000 and adjust R14 for 0 V.
Case 4: Io Is. Since the term (Io _ Is) is positive, output voltage is positive. The largest
value of Io (and thus the maximum positive output voltage) corresponds to the input code
b7b6b5b4b3b2b1b0 _ 11111111.
The magnitude of the maximum positive output voltage of this particular circuit is 2
LSB less than the magnitude of the maximum negative voltage. Specifically, Va _
(127/128)(RF/R4)(Vref) if R4 _ 2R14.
To summarize:
Input Code Output Voltage
00000000 Maximum negative*
10000000 0 V**
11111111 Maximum positive
*As adjusted by RFB
**As adjusted by R14B
Negative Range:
00000000 to 01111111 (128 codes)
Positive Range:
10000001 to 11111111 (127 codes)
Zero:
00000000 (001 code)
256 codes
❘❙❚ EXAMPLE 12.8 Calculate the values to which R14 and RF must be set to make the output of the bipolar
DAC in Figure 12.16 range from _12 V to (_12 V _ 2 LSB). Describe the procedure you
would use to set the circuit output as specified.
Confirm that the calculated resistor settings generate the correct values of maximum
and minimum output.
Solution Set R14 so that the DAC circuit has an output of 0 V when input code is
b7b6b5b4b3b2b1b0 _ 10000000. We can calculate the value of R14 as follows:
R
R
V
R
R
F FV
2
0
14 4
ref−ref
V I I R I R
R
R
a o s F s F V
( −) −−F ref
4
12.2 • Digital-to-Analog Conversion 587
The first term is set by the value of the input code. Solving for R14, we get:
To set the maximum negative value, set the input code to 00000000 and adjust RFB for
_12 V. RFB _ RF _ RFA. Solve the following equation for RF:
_ _
R
R
F
4
_ Vref _ _12 V
__
10
R
k
F
_
(5 V) _ _12 V
RF _ (12 V)(10 k)/5 V _ 24 k
RFB _ 24 k _ 18 k _ 6 k
Settings
R14 _ R4/2 _ 5 k_ for zero-crossing at half-scale.
RF _ 24 k_ for output of _12 V.
Check Output Range
For b7b6b5b4b3b2b1b0 _ 00000000:
Va _ __
R
0
14
_ _ _
R
1
4
__ RF Vref _ __
(24
1
k
0
k
)
(5 V)
__ _12 V
For b7b6b5b4b3b2b1b0 _ 11111111:
Va _ __
25
2
6
5
R
5
14
__ _
R
1
4
__ RF Vref
_ __
(256
2
)(
5
5
5
k)
_ __
10
1
k
__ (24 k)(5 V) _ 11.906 V
(Note: 12 V _ 2 LSB _ 12 V _ (12 V/128) _ 12 V _ 94 mV _ 11.906 V.)
❘❙❚ SECTION 12.2E REVIEW PROBLEM
12.6 Why is the actual maximum value of an 8-bit DAC less than its reference (i.e., its apparent
maximum) voltage?
DAC Performance Specifications
A number of factors affect the performance of a digital-to-analog converter. The major factors
are briefly described below.
1
2
1
0
1
2
1
0
1
2
1
2
2 10
14 4
14 4
14 4
14 4
14 4
R R
R V
R R
R R
R R
R R
−F
−
k /2 = 5 k
ref
/
588 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits
Monotonicity. The output of a DAC is monotonic if the magnitude of the output voltage
increases every time the input code increases. Figure 12.17 shows the output of a DAC that
increases monotonically and the output of a DAC that does not.
We show the output response of a DAC as a series of data points joined by a straightline
approximation. One input code produces one voltage, so there is no value that corresponds
to anything in between codes, but the straight-line approximation allows us to see a
trend over the whole range of input codes.
Absolute accuracy. This is a measure of DAC output voltage with respect to its expected
value.
Share with your friends: |