Go Down

Topic: R2R Ladder DAC Help (Read 2 times) previous topic - next topic

pppleasenotme

Hello,

Just started getting into Arduino programming in the hope of doing a bit of audio experimentation.

I've lashed up an 8 bit R2R DAC (20/10k) and I'm using PORTD to write to it. I can get audio out of it but it looks on the scope like it's just a single bit in action (it also sounds like it).

I've played around disconnecting the various output pins from the R2R ladder to try and work out what's going on and I can disconnect the 7 least significant bits without the audio changing at all which seems to confirm my one bit theory.

Thinking that maybe I'm not writing all the bits of the port correctly I hooked up LEDs to each bit and a button which stepped through the sample data so I could see the sample represented in binary on the LEDs. This worked fine so the data is getting to the port ok.

So now I'm confused! It would seem the software is doing its job and the data is reaching the output pins ok which leaves the R2R circuit. I've triple-checked this and it looks good (not sure how I could screw it up?!) so I really don't know what's going on!

Any ideas would be most gratefully received!

Many thanks,

Justyn

RuggedCircuits

You've done most of the standard debugging work so now I would suggest posting schematics and your sketch to see if we can find that "a-ha" thing you may have overlooked.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

D4p0up

Hi, strange enough if it fails whereas the bit stream seems to work. I've done this R2R DAC tutorial if it helps : http://fullmaj.rd-h.fr/wiki/doku.php?id=diy_spi_dac

Simple question : did you plug the resistor in the right way? (R in parallel, and 2xR in serial of the outputs ?) Plugin it the opposite shall lead to a result close to the one you're mentionning.
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

harderm

  I haven't seen your schematics posted, so I have some (hopefully) probing questions and (hopefully useful) suggestions:
  Did you use discretes to implement your design, or off-the-shelf arrays?  The latter chips from MuRata are SIP, are low wattage (1/32 W per resistor for the MuRata chips) and absolute R tolerance is 2%.  Which doesn't sound that great, but overall tolerance is not as important in R/2R as agreement of R values among the individual resistors in an array.  Usually, this particular tolerance figure is much better than overall resistance; but the MuRata specs don't include these figures.  I don't know why, so caveat emptor.  IRC and Bourne also make arrays, and relative R tolerances are available.  Mouser ships the Bourne arrays also - in smt packages.  The MuRata SIPs have been discontinued, so order now if you want these.  Arrays of discretes with higher power specs can be made, of course, but you might have to select these by hand to get good matches.
   What was the reference voltage for the array?  There are maximum absolute voltages, depending on power ratings for the individual resistors.According to MuRata, Vmax = Sqrt( watts * "nominal" resistance value).  I'm not sure I know what they mean by "nominal".  Perhaps the Vmax is calculated separately for both R and 2R, in which I would use the Vref of the whole circuit to be safe.  There are model schematics out there that include op amp outputs.  Probably better to use these to output higher voltages.
   I haven't tried this yet, but from the schematics, it looks like you could cascade multiple network chips to get higher resolutions.  But if you do so, you need to parallel the 2R resistor between the chips with an external resistor of equal value.  Since this resistor becomes part of the network, it needs to agree with the others within the rest of it.  Same goes for the agreement between overall R of both chips.

Go Up