Chapter 9 – Digital Meets Analog – ADC and DAC
illoscope
rom 0 to +3v in 255 steps. We will
wave forms: sine, square, triangle, and sawtooth. Since this is
educational enterprise we will reuse the software with the millisecond interrupt
e’ frequencies pretty slow.
d
reusing the ADC project software to read the data from our Function Generator.
n e e l n a
onably accurate DAC for very little cost. Usually you’ll see two resistor
case we would use a single 4.4k Ohm resistor in
JAMECO list, Let’s just use two of each for the 4.4k resistors. The 2.2k and 4.4k
e
a
h
e
ing HyperTerminal and have a really slow crappy
in Figure 34.
DAC and ADC - Function Generator / Digital Oscilloscope
In this project we will use a Digital to Analog Converter, DAC, made with a R-2R
resistor ladder circuit that will output voltages f
use voltage values stored in look-up tables to generate ‘functions’ which in this
case are repeating
an
making our ‘wav
We will also develop a Digital Oscilloscope, using the Butterfly’s ADC an
Since Digital Oscilloscopes normally cost tens of thousands of dollars, you ca
expect some compromises. This thing is very very very ... very slow. (And th
‘screen’ is rotated 90 degrees.) If you set the ‘ctc’ to 250 you can see the wav
output on HyperTerminal. If you set ‘ctc’ to 1, you can see the signal on a rea
oscilloscope.
We will output the look-up table data on port D and attach the pins as shown i
Figure 27. An R-2R resistor ladder looks a little magical, and the circuit analysis,
though simple in concept, turns out to be fairly complex, but it makes
reas
values in this type circuit, in our
place of the two 2.2k resistors, but since we got 100 2.2k resistors from our
are not magical numbers; you can use any value for R as long as the other is 2R
and not be so low as to drain the battery or so high as to block the current.
Using the 2.2k resistors from the JAMECO list construct your DAC using th
schematic in Figure 27, which is illustrated by the close-up photo in Figure 28,
medium distant photo in Figure 29, and the full setup in Figure 30 complete wit
a sine wave on an oscilloscope.
If you don’t have an oscilloscope, just connect the output of the DAC to t
C on J407, just like with the potentiometer as shown in Figure 29.
h
Butterfly AD
Now you can read the output us
sideways oscilloscope as shown