Introduction: 8 Bit Serial Digital to Analog (5v Range) Converter for Microcontrollers (when TTL and Resistors Is All You've Got)
So I needed a DAC (digital to analog converter) to use with my pic12F675 , and for those of you who have never heard of this little fella, it's an 8 pin microcontroller from Microchip that has only 6 I/O pins...
This is a very simple circuit that converts Digital data (serial input) to Analog values ranging from 0v to 5v (I used it to generate audio (adding an output capacitor to filter DC) with the 12f675 (requires amplification) )
It can also be used as a serial->parallel output multiplexer (see digital outputs)
Materials:
+(1) 74164 8bit Shift Register
+(1) 74373 8bit Latch
+(9) 10K resistors
+(7) 4.7K resistors
+'Generic' perfboard (the pcb...)
Step 1: The Schematics
Inputs :
tri_state :
'1' will put the digital outputs to tri-state (while in tri-state the digital "outputs" can be used as parallel input to the DAC)
'0' Normal Usage
Latch_Enable :
'0' Maintains the current Register state (Maintains the current analog output)
'1' Copies the inputs from the shift register and stores it
Not_Shift_clear:
'0' Clears the Shift register
'1' Normal Usage
Shift_Clock:'
__/ clocks the result of the expression (Serial_In and Serial_In2) into the shift registerOutputs:
Analog_Out: after all It is a digital to ANALOG converter...
Parallel_Out 0-7: but it's also a output multiplexer =D
Step 2: The Assembly As a Breadboard 'Plugin'
By using this cheap perfboard and adding some "(Jumpers)-1" My DAC is now a single (unusually LARGE) component ...
My assembly isn't particularly elegant...but it does the trick...
8 Comments
11 years ago on Introduction
you should add an opAmp to buffer it all.
16 years ago
nice one. u said its an digital-analog converter right.so can i use it for parallel port too? my batch is working on a machine which shld get analog voltage output from the PC with respect to the pulses given. in one word circuit shld be able to convert parallel port signal in to relative analog voltage. so is this possible with ur circuit?
Reply 16 years ago
In the days after the original Sound Blaster came out, most of us couldn't afford them. Some of us bought the cheap Media Vision clone for home but wanted audio output on the school's computers. Enter the Covox Speech Thing.
The Covox was just a resistor DAC like this, driven straight from the parallel port. Search on "covox parallel resistor" to find schematics. We used a capacitor on the output to block DC, but it sounds like you'll need an op-amp or something if you're looking for a voltage output.
The serial-to-parallel-to-Covox thing has been done before, to add audio output to a WRT54G. Is there anything that poor little box hasn't been hacked up to do? Check here: http://www.duff.dk/wrt54gs/
Reply 16 years ago
well.. serial DACs are sold as IC nowadays... but this was more to show the "how improvise a DAC"... And since I couldn't find any discreet DAC Instructables... I posted this one I used in one of my projects...
Reply 16 years ago
What the shift reg does is turning serial data into parallel so...
If you remove the shift register and feed the 8 bits from the parallel port straight to the latch (so that it acts like a buffer("just in case") ) it will work nicely (just be careful with the impedance of what your gonna hookup to the output, as EUR said if your driving something that has low impedance (speaker,motor) you need to be careful and add some sort of a voltage follower that can handle the current drain (an op amp for exemple(look for voltage followers online))
Actually tomorrow(GMT -3) i'll try to add a new instructable using this circuit to generate audio signals with a pic (and using a low impedance load)...
But hey, tell me what you need, maybe I can help =]
Reply 16 years ago
sigh... It turns out that I won't be able to generate some sound and Ultra sound frequencies with this microcontroller... max I could get was 10Khz... so I'm switching to some other design (serial is too much for the poor pic...)
16 years ago
Hi Depending on the output impedance of your D/A converter, you could have used only a resistor and a capacitor. For lower output impedance, you could add an emitter follower.
Reply 16 years ago
yeah, I know... I was planning on adding a 741 as a voltage follower to the output, but there was no room on this half-pcb I used =D and since it worked to my application...I left it that way