Waveshield / DAC bitrate etc..
Moderators: adafruit_support_bill, adafruit

Waveshield / DAC bitrate etc..

by cartesia on Sun Aug 23, 2009 10:30 am

Hey, just wanted to get thoughts on the possibility / feasibility of using a 16 bit DAC with arduino instead of 12 bit..

Not necessarily using the waveshield, just in general wondering about 16 bit DAC for arduino..

Is it possible performance-wise? And if so, what kind of samplerate could be expected?

I'd love to be able to do 32khz @ 16 bit.. but then again, 22khz at 12 bit would still be useable for me so I dont want to go to enormous lengths/strains to get it running 16 bit.

Was there any reason 12 bit was chosen for the waveshield? (according to the webstore there is.. but there is no explanation)

:)
cartesia
 
Posts: 2
Joined: Sun Aug 23, 2009 10:24 am

Re: Waveshield / DAC bitrate etc..

by adafruit on Sun Aug 23, 2009 4:43 pm

its the only thru-hole DAC we could find at a good price :) 16 bit would be trivial since it processes that much data already
User avatar
adafruit
 
Posts: 11718
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Waveshield / DAC bitrate etc..

by cartesia on Mon Aug 24, 2009 12:00 pm

thankyou!

and now.. time to hatch some evil schemes :twisted:
cartesia
 
Posts: 2
Joined: Sun Aug 23, 2009 10:24 am

Re: Waveshield / DAC bitrate etc..

by B26354 on Tue Mar 09, 2010 4:26 pm

I am interested in swapping out the Waveshield 12 bit DAC for a compatible chip that is a 16 bit DAC. Has anyone figured this out? I realize
pinouts will probably be different and the chip will cost half the price of the entire kit. The Waveshield seems perfect in that it is
self contained and plays uncompressed, 16 bit, WAV files from a FAT16 SD card. Thanks for making it available-- now lets change it. :)
B26354
 
Posts: 1
Joined: Tue Mar 09, 2010 4:08 pm

Re: Waveshield / DAC bitrate etc..

by zachtos on Wed Dec 05, 2012 4:18 pm

Is there an easy way to modify the WaveHC library to playback 16 bit files if I install a 16 bit DAC? or would the audio playback not even be a noticable change?

/////////////
"WaveHC is an Arduino library for the Adafruit Wave Shield. It can play
uncompressed mono Wave(.WAV) files at sample rate up to 44.1 K samples per
second. Only the high 12 bits of 16-bit files are used. Audio files are read
from an SD flash memory card."
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 8:18 pm

Re: Waveshield / DAC bitrate etc..

by zachtos on Wed Dec 05, 2012 4:56 pm

My guesses on how to go from 12 bit to 16 bit if you have a 16bit DAC instead of the 12bit that comes w/ the waveshield 1.1.

Code: Select all | TOGGLE FULL SIZE
 
* From the WaveHC.cpp file)

  uint8_t dh, dl;
  if (playing->BitsPerSample == 16) {
 
    // 16-bit is signed
    dh = 0X80 ^ playpos[1]; //unsure what this does?
    dl = playpos[0];
    playpos += 2;
  }

 // send high 8 bits
  mcpDacSendBit(dh,  7);
  mcpDacSendBit(dh,  6);
  mcpDacSendBit(dh,  5);
  mcpDacSendBit(dh,  4);
  mcpDacSendBit(dh,  3);
  mcpDacSendBit(dh,  2);
  mcpDacSendBit(dh,  1);
  mcpDacSendBit(dh,  0);
 
  // send low 4 bits
  mcpDacSendBit(dl,  7);
  mcpDacSendBit(dl,  6);
  mcpDacSendBit(dl,  5);
  mcpDacSendBit(dl,  4);
  mcpDacSendBit(dl,  3); //add this line
  mcpDacSendBit(dl,  2);//add this line
  mcpDacSendBit(dl,  1);//add this line
  mcpDacSendBit(dl,  0);//add this line


Code: Select all | TOGGLE FULL SIZE
*from the mcpDAC.h file
// send 12 bits to dac
// trusted compiler to optimize and it does
// csLow to csHigh takes 8 - 9 usec on a 16 MHz Arduino
inline void mcpDacSend(uint16_t data) {
  mcpDacCsLow();
  // send DAC config bits
  mcpDacSdiLow();
  mcpDacSckPulse();  // DAC A
  mcpDacSckPulse();  // unbuffered
  mcpDacSdiHigh();
  mcpDacSckPulse();  // 1X gain
  mcpDacSckPulse();  // no SHDN
  // send 12 data bits
  mcpDacSendBit(data, 15); //*add this line
  mcpDacSendBit(data, 14);//*add this line
  mcpDacSendBit(data,  13);//*add this line
  mcpDacSendBit(data,  12);//*add this line
  mcpDacSendBit(data, 11);
  mcpDacSendBit(data, 10);
  mcpDacSendBit(data,  9);
  mcpDacSendBit(data,  8);
  mcpDacSendBit(data,  7);
  mcpDacSendBit(data,  6);
  mcpDacSendBit(data,  5);
  mcpDacSendBit(data,  4);
  mcpDacSendBit(data,  3);
  mcpDacSendBit(data,  2);
  mcpDacSendBit(data,  1);
  mcpDacSendBit(data,  0);
  mcpDacCsHigh();
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 8:18 pm

Re: Waveshield / DAC bitrate etc..

by zachtos on Mon Dec 10, 2012 12:27 pm

No one have a clue on this one? I was hoping to find out before I prototype up my SMD board. I have about 14 wavesheilds but now I'm looking for a smaller package w/ higher quality wave output while still using an SDcard.
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 8:18 pm

Re: Waveshield / DAC bitrate etc..

by adafruit_support_bill on Mon Dec 10, 2012 12:36 pm

I think you have identified the areas of code that need to be changed. But the exact nature of the change depends on what kind of interface your new DAC has.
User avatar
adafruit_support_bill
 
Posts: 31061
Joined: Sat Feb 07, 2009 10:11 am

Re: Waveshield / DAC bitrate etc..

by zachtos on Mon Dec 10, 2012 1:05 pm

Thanks! I'm hoping to find a 16 bit DAC that is similar. I'm looking at this one so far http://www.ti.com/lit/ds/slas429b/slas429b.pdf
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 8:18 pm