Dac Interfacing
Dac Interfacing
Dac Interfacing
1 of 5
http://what-when-how.com/8051-microcontroller/dac-interfacing/
Subscribe
what-when-how
In Depth Tutorials and Information
DAC INTERFACING
such as the DAC0808 provides 256 discrete voltage (or current) levels of output.
Similarly, the 12-bit DAC provides 4096 discrete voltage levels. There are also
16-bit DACs, but they are more expensive.
MC1408 DAC (or DAC0808)
In the MC1408 (DAC0808), the digital inputs are converted to current (I out), and by
connecting a resistor to the Iout pin, we convert the result to voltage.
The total current provided by the Iout pin is a function of the binary numbers at the DO D7
inputs of the DAC0808 and the reference current (I ref), and is as follows:
where DO is the LSB, D7 is the MSB for the inputs, and I ref is the input current that must be applied to
14-03-15 5:47 PM
DAC INTERFACING
2 of 5
http://what-when-how.com/8051-microcontroller/dac-interfacing/
pin 14. The Iref current is generally set to 2.0 mA. Figure 13-18 shows the generation of current reference
(setting Iref = 2 mA) by using the
standard 5-V power supply and IK and 1.5K-ohm standard resistors. Some DACs also use the zener diode
(LM336), which overcomes any fluctuation associated
with the power supply voltage. Now assuming that Iref = 2 mA, if all the inputs to the DAC are high, the
maximum output current is 1.99 mA (verify this for yourself).
Converting lout to voltage in DAC0808
Ideally we connect the output pin Iout to a resistor, convert this current to
voltage, and monitor the output on the scope. In real life, however, this can cause inaccuracy since the input
resistance of the load where it is connected will also affect the output voltage. For this reason, the I ref current
output is isolated by connecting it to an op-amp such as the 741 with R f = 5K ohms for the feedback resistor.
Assuming that R = 5K ohms, by changing the binary input, the output voltage changes as shown in Example
13-4.
Example 13-4
In order to generate a stair-step ramp, set up the circuit in Figure 13-18 and connect the output to an
oscilloscope. Then write a program to send data to the DAC to generate a stair-step ramp.
14-03-15 5:47 PM
DAC INTERFACING
3 of 5
http://what-when-how.com/8051-microcontroller/dac-interfacing/
Solution:
Vout of DAC for various angles is calculated and shown in Table 13-7. See Example 13-5 for verification of the
calculations.
Table 13-7: Angle vs. Voltage Magnitude for Sine Wave
Angle 9 (degrees)
Sin 0
00
30 0.5
60 0.866
90 1.0
120 0.866
150 0.5
180 0
210 -0.5
240 -0.866
270 -1.0
300 -0.866
330 -0.5
360 0
128
192
238
255
238
192
128
64
17
0
17
64
128
Example 13-5
14-03-15 5:47 PM
DAC INTERFACING
4 of 5
http://what-when-how.com/8051-microcontroller/dac-interfacing/
To find the value sent to the DAC for various angles, we simply multiply the Vout voltage by
25.60 because there are 256 steps and full-scale Vout is 10 volts. Therefore, 256 steps /10 V =
25.6 steps per volt. To further clarify this, look at the following code. This program sends the
values to the DAC continuously (in an infinite loop) to produce a crude sine wave. See Figure
13-19.
14-03-15 5:47 PM
DAC INTERFACING
5 of 5
http://what-when-how.com/8051-microcontroller/dac-interfacing/
ADC DAC
Converter DAC
Datasheet PDF
Circuit Diagram
Analog DAC
Interfacing
Next post: PARALLEL AND SERIAL ADC
Previous post: SENSOR INTERFACING AND SIGNAL CONDITIONING
1
Related Links
8051 Microcontroller
8051 MICROCONTROLLERS
MICROCONTROLLERS AND EMBEDDED PROCESSORS
OVERVIEW OF THE 8051 FAMILY
8051 ASSEMBLY LANGUAGE PROGRAMMING
INSIDE THE 8051
:: Search WWH ::
Custom Search
14-03-15 5:47 PM