For only 1 bit, you don't need to convert. Digital 0 is already analog 0V. Digital 1 is already analog 5V (3V, 1.5V, or whatever the board drain voltage is).
For more bits, say 8 bit, you need to buy a chip call a 8-bit DAC (it may have several channels, but you use only one), and write some firmware or build a logic circuit to control and to shift the digital data into it. An 8-bit DAC has 2^8 = 255 resistors connected in series to make a resistor ladder.
You also need to buy another chip called a reference voltage generator, or to buy a zener diode and a filter capacitor to make a precision known voltage, to supply a reference voltage to the DAC to power its resistor ladder.
Once you wired them all up, as the firmware or the logic circuit sends the DAC chip a value from 0 to 255, the DAC chip will tap the same-numbered point on its resistor ladder to output a voltage. This output voltage equals the reference voltage divided by 255 then times the value of the digital data input to the DAC.
The DAC outputs make a stream of square voltage steps. To smooth them out you need a low pass filter. A low pass filter lets low frequencies pass through it, but rejects high frequencies. It is made typically of a resistor driving a capacitor. To make each smoothed analog output equal, for example, about a 3-point running average of the digital outputs (i.e., every analog point is the average of three digital points bracketing it), you need to make the product of the resistor times capacitor (called the RC time constant of the 1-pole low pass filter) value equal to about the average period between your digital steps. For this example, the low pass filter time constant needs to be about 0.3 ms. That corresponds to something like the DAC step-voltage output connects to a 330 ohm resistor which, in turn, connects to a 1nF capacitor whose other terminal connects to ground. Your smoothed analog output is, finally, the non-ground terminal of the 1nF capacitor.
Hope the above is not too far off from the info you looked for.
2007-03-04 21:25:12
·
answer #1
·
answered by sciquest 4
·
0⤊
0⤋