Difference between Audio DAC and general-purpose DAC - Page 1
Forum section: electronics / beginners

author: michaeliv
author_rank: Frequent Contributor
timestamp: August 04, 2015, 08:14:57 am
content: Hi,I was looking on DIgiKey for a precision 16bit+ DAC to use with the Arduino.I'm not very familiar with DAC's (first time i'dd be using one) but noticed that audio DAC's are significantly cheaper than general-purpose DAC's given apparently similar / better performance.Ex:24bit, 2ch Audio DAC: $1 -http://www.digikey.com/product-detail/en/AK4430ET/974-1017-1-ND/233340316bit, 1ch, General DAC: $7.5 -http://www.digikey.com/product-detail/en/AD5061BRJZ-2REEL7/AD5061BRJZ-2REEL7CT-ND/1217633Most general-purpose DAC's are in the $15-$20 range whereas most audio DAC's are in the $2-$5 range.Can someone explain why that is ? Is there a catch? Can you use a audio DAC with an arduino to just output a constant stable voltage? I'm wondering if I'm missing something, is there something else I should consider when looking at a DAC other than bits, accuracy & settling time / bandwidth ?Thanks!

author: janekm
author_rank: Unknown
timestamp: August 04, 2015, 08:38:42 am
content: The basic difference is that for audio applications you are primarily interested in AC performance rather than DC (that is, changes in output rather than absolute output). If you're using a DAC to for example servo a DC bias in a power supply, you want something like the AD5061.The DAC architecture is completely different between the two parts, the AK4430 uses a delta-sigma converter (very cheap to build, can be designed to handle any "bit resolution" but hard to guarantee good static linearity), the AD5061 is using a combination of matched resistors for the top 4 MSB and R-2R ladder for the remaining bits (much more expensive as the process has to be controlled carefully to ensure the resistors stay in spec).In terms of stable output, the AD5061 is better (according to the datasheet), most critically the performance across temperature changes is much better (1ppm / 1C rise vs 100ppm / 1C rise for the AK4430). The gain error on the AD5061 is very good but not specified on the AK4430 datasheet. Conversely, the AK4430 has great specifications for dynamic performance and the AD5061 doesn't specify any (well other than output slew rate and dynamic range). Whether or not either one is suitable for your application obviously depends on what exactly you need. But you wouldn't get close to the 24bit in static performance obviously. Not even 16 bits.The difference in price is basically down to volume, audio DACs tend to be used in products with much larger production volumes and high price sensitivity (consumer electronics).TL/DR, if you want to write a number to the DAC and get as close to the exact same voltage on the output each time, use the AD5061 (or similar, there are cheaper ones around).

author: fcb
author_rank: Super Contributor
timestamp: August 04, 2015, 08:42:07 am
content: I've used audio DAC's in applications where I need high-resolution and low cost - but they need slightly different care and feeding. I made it work by running the cheap DAC off a voltage reference and then feeding the L/R channels (R was an inverted version of L) into a differential amplifier and relocating the output w.r.t. 0V.The biggest difference (as you point out) tends to be the REFerence input (or lack of). Audio DAC's tend to create the reference from half the PS rail, and swing around that. Conventional DAC's tend scale the output from 0V to VREF.Audio DAC's mainly use I2S, which is straightforward and can be fudged with SPI. They also don't like shutting off clocks.There are other issues with guaranteed performances (no missing steps, INL etc...) - audio DAC's probably aren't tested to the same degree. Audio DAC's will wander slightly if you use them for generating a fixed DC voltage, mainly as a function of temperature - this is not a problem obviously in audio where they tend to be AC coupled (and hence the reason I used them differentially).The bandwidth of the audio DAC's is limited by filtering, so you'll tend to get a sharp cut-off just below Nyquist - this can be good or bad - again depending on your application. And you'll struggle to find anything faster than 192/384KHz.So they might be eminently suitable of your application OR not..

author: retrolefty
author_rank: Super Contributor
timestamp: August 04, 2015, 03:27:32 pm
content: Great subject and posts. This is the kind of stuff that's hard to find elsewhere.

author: michaeliv
author_rank: Frequent Contributor
timestamp: August 04, 2015, 03:48:44 pm
content: Thanks for the great replies!I'm mostly interested in resolution / ability to increment by a small amount rather than absolute accuracy.Quote from: janekm on August 04, 2015, 08:38:42 amIndeed, I found that Mouser has separate categories for audio / general DAC's - using that I found that the cheapest 16 bit DAC is the MAX5217 ($3).Quote from: fcb on August 04, 2015, 08:42:07 amAbout how many bits of accuracy did you manage to obtain ? So if you tried to output 1.0000v, to what bit position was it accurate ( excluding the voltage reference inaccuracy )? Were there any missing steps ? About how non-linear did they turn out to be ?Quote from: fcb on August 04, 2015, 08:42:07 amWhat happens if you stop sending them any input ? Do they become unstable or default to 0v ?Also, out of curiosity, what happens if you try to sum the voltage (using something likehttp://media.wiley.com/Lux/48/309548.image2.jpg) of a 16bit DAC + the voltage of another 16bit DAC divided by 2^16 ? Do you get a 32 bit DAC or will weird things happen? I realize that you will probably get missing steps when the 16th bit changes, what other things may happen ?

author: mikerj
author_rank: Super Contributor
timestamp: August 04, 2015, 04:50:42 pm
content: Quote from: michaeliv on August 04, 2015, 03:48:44 pmThis technique of cascading low resolution DACs to get a higher resolution is often done within standard "string" DACs to reduce the number of resistors required. They use a Kelvin Varely divider rather than a summing junction, but the effect is the same.However, cascading two 16 bits DACs like this would give you an unusable mess of missing codes and non-monotonic behaviour. It's hard enough to make a system capable of a genuine 16 bits, but at 32 bits the performance of the system would be utterly dominated by the noise and thermal performance of the op-amp, voltage reference and even the passive components.

author: dentaku
author_rank: Frequent Contributor
timestamp: August 04, 2015, 06:13:28 pm
content: I've been looking into exactly the same thing lately because there's only so much you can do with PWM outputs on a regular Arduino so using a DAC seems like the better solution.The Teensy is more useful because it has a DAC but I wonder why they just stick with a 12bit DAC even when a Teensy is quite powerful compared to a regular slow Arduino.Do they use 12bit because it much cheaper or because of some technical limitation that means that using a 16bit DAC won't work well for hobbyists with breadboarded circuits?Even Adafruit and Sparkfun sell little I2C DAC breakout boards that are only 12bit but I don't see a 16 bit one.https://www.adafruit.com/products/935

author: Kleinstein
author_rank: Super Contributor
timestamp: August 04, 2015, 08:04:01 pm
content: 12 Bits ADC can be rather cheap, even if they work static. You can get them for less than $1. Cheap 16 Bit DACs like the audio ones tend to be dynamic and need a constant clock and often a stream of data.For many experiments / regulationg loops 12 Bits are well enough as the ADCs inside the µC are also only 10 or 12 Bits. It also needs a good layout to really see a better than 12 Bit performance.Stacking two DACs works to get find adjustment if you have the divider smaller, so the fine DAC can adjust at least as much as the larges LSB step. So you don't get ranges you can't reach, but overlaping ranges. So doulbe covered values instead of missing ones. So two 12 Bit DACs might give 1 ppm resolution adjustment, though not as easy as a real 20 Bit DAC would.

author: fcb
author_rank: Super Contributor
timestamp: August 05, 2015, 09:13:21 am
content: Quote from: michaeliv on August 04, 2015, 03:48:44 pmI've found that they freeze if you shutdown the clocks (mainly Wolfson), but others will enter powerdown modes etc.. also many DAC's work out the sample rate from looking at the ratio of MCLK to BCK.I didn't bother making absolute measurements as I can't measure better than 4.5digits at the moment - my implemenation was stable to 4.5digits after it had soaked for a bit. A fun experiment for you to do and report back.BTW I constantly feed it with static data at 48KHz from a dsPIC33FJ128GP202. Also, I didn't need 24bit resolution, probably could have made do with 14bits - but I did need very fast shifting and low cost.

author: amyk
author_rank: Super Contributor
timestamp: August 05, 2015, 09:57:01 am
content: Quote from: michaeliv on August 04, 2015, 03:48:44 pmThe lower 12 bits or so would be completely useless because of noise. Consider that 8.5 digit multimeters only have ~28 bit resolution, and they require very special design techniques to achieve that.I'm not sure what's worse, the fact that "32-bit" audio DACs actually exist (with closer to 20 bits of real resolution) or that "audiophiles" genuinely think they can tell the difference between them and 24-bit DACs

author: linux-works
author_rank: Super Contributor
timestamp: August 05, 2015, 07:01:07 pm
content: alternative idea is to use a digital pot and cascade them. the first pot in the ladder is the coarse one, then you fine tune its output with another pot divider, etc.have not tried it but the theory should work.its very software based, though; as you have to know the best way to set each of the pots to get the desired output and there are many ways to generate it from a series of cacaded pots.could also start with a dac and then fine tune that with an output e-pot.

author: apis
author_rank: Super Contributor
timestamp: August 06, 2015, 04:48:30 pm
content: I've been thinking about cascading cheap DACs or digital pots as well. The result would likely be a non-linear mess but for things like software PID controllers where you just want to set a voltage and only make small adjustments based on feedback, it could work I believe; as long as you can make sure the ranges overlap so you don't get "blind spots".

author: linux-works
author_rank: Super Contributor
timestamp: August 06, 2015, 05:15:28 pm
content: its all a software task, then. there are many combos where the parent pot and the child pot would yield the right target value. its part lookup-table based and maybe some smart algorithm added in, but it does not sound all that difficult. tuning it might take some work but does not seem hard to do. find the sweet spots where things are more linear and stable and try to stay in those zones.

author: michaeliv
author_rank: Frequent Contributor
timestamp: August 06, 2015, 07:11:13 pm
content: Quote from: fcb on August 05, 2015, 09:13:21 amWhat clock rate did you use for the PIC ?I'm assuming that that's the only thing that the PIC was doing since I2S says that 48KHz of data requires a frequency of 12MHz for the master clock. Or am I missing something ?

author: coppice
author_rank: Super Contributor
timestamp: August 07, 2015, 01:58:27 am
content: If ENOB is really important to you -AND- you've really thought about what ENOB means - AND- ENOB is still really important to you, then forget about using audio DACs.If linearity and low noise are important to you, but you don't care about DC offsets or absolute gain levels. audio DACs are a bargain. In volume they are <20 cents.

author: linux-works
author_rank: Super Contributor
timestamp: August 07, 2015, 02:07:07 am
content: bullshit audio dacs are less than a buck.good wolfson ones are still $10. ESS higher end ones are more than that.

author: JoeN
author_rank: Frequent Contributor
timestamp: August 07, 2015, 02:15:02 am
content: Quote from: retrolefty on August 04, 2015, 03:27:32 pmI agree. This is a question I have asked myself for a while, not knowing the exact answer, and now it is all crystal clear.

author: fcb
author_rank: Super Contributor
timestamp: August 07, 2015, 10:41:09 am
content: Quote from: michaeliv on August 06, 2015, 07:11:13 pm12.288MHz xtal for the dsPIC (using 33pF caps), and then another 33pF cap on the OSCO (dsPIC) to the DAC.

author: LEDAero
author_rank: Regular Contributor
timestamp: August 07, 2015, 01:04:16 pm
content: Quote from: michaeliv on August 04, 2015, 08:14:57 amOr... buy an $8 Arduino DUE which has a 12-bit DAC built in...?

author: michaeliv
author_rank: Frequent Contributor
timestamp: August 07, 2015, 04:38:05 pm
content: Quote from: LEDAero on August 07, 2015, 01:04:16 pmI'm using / looking to use a small arduino (Micro/Mini) but would be interested where I could get a due for $8 - The cheapest Due I can find is $13-$17.Quote from: fcb on August 07, 2015, 10:41:09 amSo the PIC was running at the same frequency that the DAC was receiving data ? Is there a trick that can be used to feed data to something at the same rate as the clock rate ? Even if you managed to change the pin value once per cycle, wouldn't you have to jump back to loop ... and maybe even receive the value that you're outputting from something else ?

author: fcb
author_rank: Super Contributor
timestamp: August 07, 2015, 06:44:29 pm
content: Quote from: michaeliv on August 07, 2015, 04:38:05 pmDoesn't work like that:The DAC requires the following:MCLK (128fs to 784fs typically) -fs is your sample rate BTWBCLK (64fs typically)LRCK (fs)DATAThe MCLK keeps the DAC running and allows it to do it's magic. (12.288MHz)The BCLK is the bit clock, runs at 64fs and typically your data is sampled on the rising edge of this clock. (3.072MHz)The LRCK is used by the DAC to frame the data. (48KHz)DATA, 32 bits L and 32 bits R typically,in 2's complement (signed) format.In my typically implementation (12.288MHz xtal), the dsPIC PLL is configured to run at 24.576MIPs or 36.864MIPs, and I use the SPI module to generate the BCLK/LRCK and DATA. In that case I only have to service the DAC at 48KHz, which gives me 768 instructions to do my thing.

author: linux-works
author_rank: Super Contributor
timestamp: August 07, 2015, 07:01:53 pm
content: which clock is used to sample depends on the chip.I believe that wordclock being used to sample is also very common.and some dac chips can even supply their own master clock, so you just give it wordclock, data and bit clock (or maybe I mised up bit and master clock).