Shop OBEX P1 Docs P2 Docs Learn Events
16 Bit DAC — Parallax Forums

16 Bit DAC

KenLemKenLem Posts: 94
edited 2006-05-05 21:28 in General Discussion
I have·built a·16 Bit DAC for audio output and I want to test it to see if it is actually accurate to all 16 bits.· Is that something I could measure with the Parallax USB Oscope?· The vertical resolution of the Oscope is 8 bits.

Would it be possible using a·velleman personal scope?
http://froogle.google.com/froogle_cluster?q=velleman+personal+scope&pid=4904516265914691095&oid=8310061479171595746&btnG=Search+Froogle&scoring=mrd&hl=en

Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.speechchips.com

Speech & Video IC's for BasicStamps

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-05-05 00:30
    All you need is a run a counter program to go from 0 to 65535 to 0...· The output should be a "staircase" and you should be able to see any lack of monotinicity monotonicity (missing steps or longer steps).· If you really slow it down, then you should be able to, depending on the full-scale output, note each step with a digital voltmeter (5V would be about 75mV/step., 2V would be about 20mV each.)


    Edit #2 --

    freaked.gif·

    Dang!, pjv is onto something.· Regarding the above -- those aren't 75mV steps, they are 76 uV steps.· Shame on me.

    Post Edited (PJ Allen) : 5/5/2006 4:20:08 PM GMT
  • BeanBean Posts: 8,129
    edited 2006-05-05 02:40
    When you say you "built" a DAC, did you actually build one or are you using a DAC chip ?
    It is very difficult to build a 16 bit dac that is monotonic. I'd like to see a schematic if that is what you have done.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • KenLemKenLem Posts: 94
    edited 2006-05-05 13:22
    PJ - Thanks for the response. Would I be able to use my little Radio Shack digital voltmeter or would I need something with a little more accuracy?

    Bean - I'm not using a DAC chip. When I say built, I mean I layed it out on a cheap programmable device. I also built 8 bit DAC with built-in low pass filter so no external componets are required to play audio. Give you two guesses what I plan to use them for...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.speechchips.com

    Speech & Video IC's for BasicStamps
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-05-05 13:50
    KenLem -- I can't say for certain, because I don't know how many digits in your DMM.· It will probably do, provided the scale you use has resolution to 1mV.· My Fluke73's 3V scale will show "3.190V", but on the the 32V (next higher) scale, that would show as "3.19V", losing a decimal place.· I suppose that I wouldn't chose that last milli-volt accuracy as a hill to fight on, but I could determine with confidence the DAC's basic efficacy nonetheless.· Given 20mV steps this can be done.
  • pjvpjv Posts: 1,903
    edited 2006-05-05 15:55
    Hi KenLem;

    There is no way you can test it without some expensive test equipment or possibly another "certified" commercial DAC of exreme quality.

    A 16 bit DAC has 65535 non-zero steps, and if you were to use a 5 volt source, that means about 76.2 microvolts per step. Accuracy for that kind of resolution is not easy to come by "on the cheap". I'm pretty sure your DMM won't cut it.

    Cheers,

    Peter (pjv)

    Post Edited (pjv) : 5/5/2006 3:58:56 PM GMT
  • BeanBean Posts: 8,129
    edited 2006-05-05 16:18
    KenLem,
    Could you not use a 20 or 24 bit ADC to measure the output at each step ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-05-05 16:21
    I have edited my first post/reply.· 7.5 e-5 = 75microvolts, not millivolts.· Doggone it, anyway.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-05-05 16:37
    Microvolts is pretty difficult to measure with reliability, especially with a DMM. It may be nessesary to use a instrumentation amplifier as a front end.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • SteveWSteveW Posts: 246
    edited 2006-05-05 16:52
    >Could you not use a 20 or 24 bit ADC to measure the output at each step ?

    Building a system that can deliver (a worthwhile) 24 bits is exceptionally tricky. If you're not comfortable building 16-bit DACs, it's right out...
    (The noise requirements for such a system are (obviously) exceedingly tight - it's not just a case of sticking down a 24-bit ADC. Sure, you'll get a 24-bit number out, but the bottom 8 (or 10, or 16...) bits will be garbage.
    Have a rummage round analog.com for some useful hints & papers.

    If I really had to do this, I'd probably get a Tektronix 7000-series 'scope off ebay and a comparator plugin. Equipment cost shouldn't be more than a couple of hundred dollars. It'll take a while to check the whole range of the ADC, and you'd only get confirmation that it was monotonic, not accurate or glitchfree. Without more information about the originial poster's 'homebuilt' DAC, it's hard to be more helpful.

    (Note also that silicon vendors generally stick words like 'meets linearity and monotonicity by design, not tested' in their datasheets. It's not because they're lazy, it's because you don't generally need (them) to spend all that cash, tying up horribly expensive test machines for hours per chip...)


    Steve
  • SteveWSteveW Posts: 246
    edited 2006-05-05 16:59
    >It is very difficult to build a 16 bit dac that is monotonic. I'd like to see a schematic if that is what you have done.

    It's easier if you're prepared to play PWM games. Building an R-2R DAC from output pins would be futile (and dull [noparse]:)[/noparse]

    Steve
  • KenLemKenLem Posts: 94
    edited 2006-05-05 17:44
    OK. So measuring the quality of my 16 bit DAC doesn't seem that straight forward. I'll be sure to avoid claims of any kind of accuracy except "It sounds pretty good to me".

    Steve - Agreed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.speechchips.com

    Speech & Video IC's for BasicStamps
  • SteveWSteveW Posts: 246
    edited 2006-05-05 17:56
    If you've got access to a (relatively decent) spectrum analyser that works at Audio frequencies (and I really don't know if any PC-based ones will be good enough), if you can get your DAC to generate sine waves, even from simple lookup tables, then the spectrum analyser will show up (and let you see if you've fixed) most problems.
    Again, it's a bunch of work and money, but it's all possible. If you can get away with "sounds fine, sine waves look fine on a 'scope", then that's definitely got my vote. Getting audio signoff on stuff I do for work is no fun at all, even with the proper gear.

    Steve
  • KenLemKenLem Posts: 94
    edited 2006-05-05 18:01
    It does sound fine to me and the sine wave looks like a proper sine wave on a scope. I don't have access to a good spectrum analyser.

    I'm going to show my prototype around a bit to see what I get for a response. I went deaf in one ear a few years back and I'm not the best judge of audio quality.

    Thanks everyone for the comments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.speechchips.com

    Speech & Video IC's for BasicStamps
  • pjvpjv Posts: 1,903
    edited 2006-05-05 18:03
    Hi KenLem;

    My suspicion is, that without going to extreemes, about the best you can home-brew is 9 or 10 bits. If you are making it with resistor dividers, then the latter already takes 0.1 % resistors.

    I have not done the calculations, so this is a bit "off the cuff", but if you got a 0.01% accurate/stable reference, you might be able to make a PWM DAC of 12 bit accuracy..... maybe even 13 bits . Sixteen bits however is out of the question.

    Cheers,

    Peter (pjv)
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-05 18:43
    Just thinking out loud here....


    I wonder if KenLem could wiggle the output between two adjacent DAC steps at a specific frequency?


    Pass the 76.2uV through an Inductor and Coil tuned to the same frequency as a means to
    amplify the signal to something a little more detectable.


    I haven't built this, but the simulator shows that for an input of 76.2uV, the output will be
    approximately 55mV pk-pk ....an input of 152.4uV produces approximately 110mV pk-pk.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1379 x 505 - 75K
  • SteveWSteveW Posts: 246
    edited 2006-05-05 18:53
    Won't the LC be kicked much harder by any glitches than the signal you want to see?

    Steve
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-05 19:08
    SteveW,

    I tried this with both a Sine wave and a Square wave at the input in the simulator. The square
    wave took several uS to settle, while the sine wave settled relatively quickly. I placed a 1M
    load on the output which keeps the output relatively low. Connected to a scope with at least 10M
    input impedance, this should be ok. On the input there is a .1uF cap. This serves to block any DC
    offset and allow only AC to pass, so you can actually take the DAC to any level, providing you toggle
    between 2 adjacent steps of interest to create a 76.2uV delta. The L and C could be virtually any
    value, just make sure that the resonate frequency is the same frequency that you are "wiggling" the
    DAC position.

    ....I don't know? This was just an idea.... try it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 5/5/2006 7:26:52 PM GMT
  • SteveWSteveW Posts: 246
    edited 2006-05-05 20:38
    >...I don't know? This was just an idea.... try it.

    Like a red rag to a bull [noparse]:)[/noparse]

    Just fired it up in ltspice. It will, as you'd expect, resonate and produce a decent voltage if (and only if) there are no parasitics anywhere, and you can measure the output voltage without loading it...
    Even your 1M output resistor drags it down to nearly nothing using LTSpice's pretty credible parasitics modelling.

    However, worse than that, it really is sensitive to glitch energy at least as much as it is to real DAC level steps. If you're running, say, an 8-bit R-2R DAC, and your drive pins slew low a couple of nanoseconds faster than they slew high, if you're switching between binary 0111_1111 and 1000_0000 , you'll get a massive glitch, far bigger than the step you're trying to generate. Well-behaved DACs disable the output during this glitch-prone period, and re-enable it once all is stable again.

    Because of this, I'm not sure that your resonant circuit gives any useful information about step size, even if you can convince it to behave...
    Convince me otherwise [noparse]:)[/noparse]

    Steve
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-05-05 20:58
    Why couldn't you just PWM the least significant bit of the resistor ladder, if its contribution to the voltage level is relativley small, shouldn't the parasitics average the value (ie using the parasitics as the low pass capacitor)? You wont achieve a huge amount of extra precision, but it might get you a couple extra bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-05 21:28
    Steve,

    "Because of this, I'm not sure that your resonant circuit gives any useful information about step size"

    Ok, fare enough. Might have been a cool way to do it though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.