DAC's - Analog DAC's Which Ones To Use?

Started by WLS, September 24, 2009, 09:31:40 PM

Previous topic - Next topic

WLS

Hi everyone,

I am just getting started into the realm of DSP so please bare with me, but do you have to use a Audio DAC for converting your signal from digital to analog?

Or can you use other much less expensive DACs to perform this function? And if so which type i.e. voltage, current, open drain etc...?

I know that the pics and avrs that I am planning to use contain PWMs, but what would be the best alternative if they where not used in this capacity?

Is their a schematic of a simple circuit that just uses just a pic and a dac->to output? I guess what I am saying is what would be the most economical way to setup a pic or avr for a stomp box design.

Thanks,

Bill
Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

JKowalski

I am just barely into programming (I don't know anything yet)

But I do know there are many PICs with a built in DAC converter. That sounds like exactly what you want.

WLS

I would be very interested in knowing what pic family has built in DAC's.

All the pics and avrs I have looked at. Most of them do have ADC's built into them but leaving the conversion back to analog open ended.

For instance a Attiny26 has 11 single ended ADC channels with 2 high frequency PWMs, 2 timers one with a counter and an Analog Comparator. But no DAC's

I could be wrong but I believe that the chip can run at 16mhz and the PWM at 64mhz full cycle.

Just one method you can use the PWM in conjunction with the compator and timers and external low pass filterring to create a DAC. But the AVR does not have prebuilt DAC's built into it like it has ADC's.

Thus leaving me with the for said mentioned question.

Just for clarity though I am only looking at a couple of pics but primarily looking at the ATmega48's and ATmega168's to work with.

Any help would be appriciated in choosing an affordable DAC that I can put into a prototype board that I can use for circuit development.

Thanks for your reply!

Bill



Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

WLS

Ok guy's I noticed a misstake in my posting. The title should read " DAC's - Audio DAC's Which Ones To Use?"

Sorry for the typo!

But if someone could at least look at this DAC http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1119 and tell me if this would be a good choice for the type of micro-processors I'm planning to use?

It's not an Audio DAC which by the way are quite expensive. But from what I've been reading the Audio DACs are all 16 bit and up, and wouldn't be compatible to the pic and avr families I'm currently wanting to work with.

Any insight would be helpful.

Thanks,

Bill

Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

JKowalski

Ah, my mistake. I thought for sure that I remembered them having DACs, not ADCs, but now that I think about it that wouldn't make much sense  :icon_rolleyes:

WLS

Chris,

I know it's pretty easy to get a little mixed up on features of a microcontroller since the datasheets can be quite lengthy. And the learning curve is pretty steep. I come from a programming background, but still for programming the microcontroller you have to get to know their functions and how to apply them. Then their is the hardware end to deal with, which is my weakest point as you can tell that leads me to ask what seems to others as a stupid question not even worth answering.

At first I was thinking of going the tonecore route, where tonecore provides the hardware end with a programable modual. But I don't like the limits to the platform. It would be different if you could sellect from different programable moduals based off the number of pots to program. But that's not the case and not every project would require 5 pots.

So try to sell someone something that only half the componets are used and the rest simply don't work. Doesn't make too much sense to me thus leaving me to where I'm at. Looking for a good starting point where I can add external componets as needed to the basic curcit.

Thanks for your reply,

Bill

Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

pjwhite

Some microcontrollers have PWM circuitry built in, which can be used as a low frequency DAC by filtering the output properly, though for audio purposes, this  probably wouldn't really be suitable.

If you have a parallel port available on your DSP or micro, you can use an R2R ladder to make a DAC.
http://en.wikipedia.org/wiki/Resistor_ladder

You can get an 8-bit parallel DAC from Digi-Key: {url]http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-1868-5-ND[/url] for a little over $3.

You can also get serial DACs (using two or three port pins, you send a code serially to the DAC to set the output voltage or current).

Here's 16-bit serial interface DAC from Digi-Key for about $3: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=PCM1725U-ND

There are thousands fo DACs to choose from, and many are available at low cost.  Almost any low cost DAC will be suitable for audio use.

WLS

Paul,

Yes the microcontrollers I am interested in working with all have PWM's in them, but as you said that would not be the best option for audio. That is what led me to the realization that a DAC was going to be necessary to produce a decent signal.

The microcontrollers have built in 10 bit ADCs. So, my thoughts are that I should use 10 bit DACs for the reverse conversion keeping the same resolution.

I am not sure if this is necessary since I've seen an example of using a PWM that puts out a 8 bit resolution off of the 10 bit ADCs. But that just lessens the quality of signal.

I just put in a request for samples off maxim for some MAX5250 10-bit digital-to-analog converters (DACs).

It's features are:

Four 10-Bit DACs with Configurable
Output Amplifiers

+5V Single-Supply Operation

Low Supply Current: 0.85mA Normal Operation

10µA Shutdown Mode

Available in 20-Pin SSOP and DIP Packages

Power-On Reset Clears all Registers and
DACs to Zero

SPI/QSPI and MICROWIRE Compatible

Simultaneous or Independent Control of DACs through 3-Wire Serial Interface

User-Programmable Digital Output

Schmitt-Trigger Inputs for Direct Optocoupler Interface

I think I will give these a try to start. I thank you for giving me a push in the right direction.

One quick question though is it still going to be necessary to put a low pass filter in place to get the sound out?

Thanks,

Bill



Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

cloudscapes

you can make a DAC easily with a resistor ladder and a bank or two off a microcontroller. I've done it, it works great and is super easy to code, but will use up a lot of pins obviously.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

WLS

Quote from: cloudscapes on October 02, 2009, 09:31:42 PM
you can make a DAC easily with a resistor ladder and a bank or two off a microcontroller...

Definitely, an interesting concept of creating your own DACs by using an R-2-R Ladder. The major concern wouldn't necessarily be how many pins that the microcontroller would have to supply, but would be how accurate can a DIY DAC be?

Don't get me wrong, it would be interesting to create such a device even if it was just to compare it to a manufactured one. I am sure you're already aware of where I am going with this though, but I am just going to throw this out their for others reading the thread.

First off to build the DAC requires the R-2-R Ladder. To do this all the resistors would have to be matched as closely as possible for accuracy. The higher the resolution the more accurate the matching of resistors would have to be.

For instance a Bit4 MSB resistors must be insignificant compared to R/32 the matching of resistors would have to be much better than 3%.

Do able ??? pending what resistors are being used, but as you know that as you increase the resolution the required accuracy doubles with each additional bit (i.e. 8 bits the accuracy required will be better than 1/256 = 0.4%) a much tighter tolerance.

Using your microcontroller for setting up the logic gates is an excellent idea to make the conversion.

So, not to drag this out, but pending on the resolution required by your application would determine which route to go.

But if I may suggest, this would make a great beginner's project kind of thing; like the "Hello World" for microcontrollers but instead of lightning LED's you would be giving something more practical to the community to learn from.

Thank you for your suggestion. I am quite interested in pursuing this from a learning stand point, but I do hope that you would consider creating a project to give to the DYI community so that those of us that truly desire to get into DSP could benefit from your skills and build something useful for a change.


Bill

Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

flo

I would not go the "resistor DAC" route. Save yourself the trouble and just take a cheap readily available DAC chip.

WLS

Quote from: flo on October 04, 2009, 07:49:01 AM
I would not go the "resistor DAC" route. Save yourself the trouble and just take a cheap readily available DAC chip.

Yes, I agree 100% with what you're saying and have already ordered some samples from Maxim (just waiting) :). A few 10bit and a couple 8bit; all serial interface. I was just suggesting that the DYI R-2-R Ladder that cloudscapes mentioned would be a great learning project for those like myself that are just getting started. Their are not many projects of any value in relation to stompbox design that I can find on the internet. As I mentioned earlier their are significant reasons why one probable should not use it in an application, but I just think that it would be quite interesting to compare the results of a DIY converter to a manufactured one.


Bill



Since I've breadboarded it I can only blame myself.

But It's Just A Chip!

pjwhite

Quote from: WLS on September 30, 2009, 10:42:18 PM

One quick question though is it still going to be necessary to put a low pass filter in place to get the sound out?


You can certainly get sound out without a filter, the problem is that you will get harmonics from the sampling frequency as well as the sound you want.  A simple RC filter would be advisable, an active filter would be better.  You should be able to find lots of example circuits for active multi-pole filters out there.  Here is a six-pole filter that is used on the Oberheim DMX:
http://www.electrongate.com/obfiles/dmx_bass.jpg

WLS

Paul,

Thank you, for answering my question on the filterring of DAC's. I am presently using my PDA so I haven't been able to look at the schematic for thr DXM, but I am sure it will be quite useful. :)

I have recently aquired a schematic for the Aduino Diecimila Board http://www.arduino.cc/en/Main/arduinoBoardDiecimila. I was thinking of building one, but after sourcing the parts I've come to the conclusion that it would be cheaper to just buy one off ebay. But the schematic will be quiet useful in designing a stomp box.

If I was to put a usb bridge in a stomp box. In the schematic the usb connection uses a surface mount chip the FT232RL. I don't work with surface mounts, but I was thinking of using the FlexiPanel's http://www.mouser.com/ProductDetail/FlexiPanel/USB-232-DIL/?qs=sGAEpiMZZMtv%252bwxsgy%2fhiMnTjcRA6IPrITFT8ZWTv8Q%3d and redesigning the circuit.

Anyways, thanks again!

Bill



Since I've breadboarded it I can only blame myself.

But It's Just A Chip!