So I found a DAC in an old CD player that I'd like to use with my arduino, I've found a data sheet as can be seen here http://www.datasheetcatalog.com/datasheets_pdf/K/D/A/0/KDA0316LN.shtml but I don't know how I'd interface this with the arduino, an SD card and if the Arduino would be fast enough to process Wav files. I'm really clueless here, and could do with some help. Also, I have no idea how I'd code something like this either. Thanks in advanced.
16MHz Arduino is fast enought to do 1 channel reading from SD card and sending to a 16-bit ADC. Too much data to process for 2 channels.
I have a topic from last summer (?) with a lot of input from fat16lib where I was using external ADC and DAC to sample sounds at 44.1KHz and store to SD card, then later play back from SD card and send to DAC. I haven't finished my hardware yet, he had the code all done for it tho.
So I'd need two arduinos to process wav files then? damn, I was hoping I'd be able to do it all on the one. Any chance you could throw a link my way to that post of yours? I'd like to have a look, even so, I could always get a more powerful atmega chip to do both? Thanks.
Search the forum for "drum sample" and it will bring up the topics from August 2013.
CrossRoads: 16MHz Arduino is fast enought to do 1 channel reading from SD card and sending to a 16-bit ADC. Too much data to process for 2 channels.
Are you sure?
I bet you can do it if you work both SPI interfaces in parallel.
I don't know, I think I had convinced myself that where just about enough microseconds available at 44100 Hz to read ints from SD and write to SPI. My thinking was along these lines: 44100 samples/sec * 16 bits/sample * .000000125 (125nS) = 88.2mS to pull 1 second of data from SD card at 8 MHz with 0 overhead. 2 channels = 176.4mS.
Send it out to two ADCs, 352.8mS. Double that for moving ints thru byte wide bus = 705.6mS.
Leaves you with 30% processor availability for executing the code. Is that enough? Perhaps.
Factors: Writing to SPI registers is a byte wide operation, so that part could be faster. fat16lib has shown the cards work best with 512 byte chunks.
fat16lib's code to read buffered chunks from SD into 1284 memory may have overcome that. I have been distracted with other projects and haven't gotten back to my drum project yet.
That's an I2S chip, you'll need the Due to interface to that (*), it needs several stable clocks in fixed ratios to run too, typically derived from a 12.228MHz or 6.144MHz quartz crystal...
(*) This chip is 5V only. The Due is 3.3V only, so level shifters needed.
I'd forget it, if you want I2S DACs and ADCs get some of the Wolfson Micro chips, they do many variants and all are cheap and most run at 3.3V.
Well I was kinda hoping I could use this with my UNO, because that'd save me a lot of money (Shipping to Australia is majorly overpriced) I'm only wanting to ship out to the DAC, no reading from an ADC, basically, I just want to reproduce high quality audio, I have no need in recording it. Another option, the CD player that I got this DAC off has a microcontroller and a few other digital controllers for the spindle motor and such (That's not needed obviously) but I figured I might be able to just use the arduino to tell it what to do, or to send it nothing but the data from the SD card. It's clearly capable of handling such operations at the above specified (Not by me) specs, and it's only 4-bit. but I figure if I can interface it as a slave to the arduino I could probably make it work, I'll have to do more reading on it. I'll link some Data sheets soon. Thanks.
There's the link to the Micro controller datasheet, it should be noted that it's made to run an LCD output and all, which I actually have.
This is my hope anyway.
Thanks for the help everyone.
So a thought I just had, If I were to get two IC's, either two unos or otherwise, and set it up so that one Uno or even an ATtiny on a shift register was connected to the SD card and decoded all it's data, would that open up enough bandwidth to be able to drive that DAC in stereo at 16 or even 12-bit at 44.1Khz? Just thoughts, also, I've been reading that people have gotten Atmega32's to directly output audio waveforms at 22Khz stereo in 8-bit form, but they're only using MP3 files, I'm kind of shooting for the stars here and hoping to acheive the highest possible sample/bit rates.
These guys carry a ton of stuff http://www.freetronics.com/pages/about but no chips!
Have you tried these guys? http://www.jaycar.com.au/
maddog2201: So a thought I just had, If I were to get two IC's, either two unos or otherwise, and set it up so that one Uno or even an ATtiny on a shift register was connected to the SD card and decoded all it's data, would that open up enough bandwidth to be able to drive that DAC in stereo at 16 or even 12-bit at 44.1Khz? Just thoughts, also, I've been reading that people have gotten Atmega32's to directly output audio waveforms at 22Khz stereo in 8-bit form, but they're only using MP3 files, I'm kind of shooting for the stars here and hoping to acheive the highest possible sample/bit rates.
You can get sound player modules with decoder chip, stereo amplifier, SD card slot, etc. on eBay for under $4. (Shipping included, even to Australia...)
You talk to them over a serial connection. Just tell them what track to play and they do all the rest.
The "audio" forum has plenty of info.
You can even get them with full mp3 decoders but they cost a couple of bucks more.
Get one of these: http://tronixlabs.com/breakout-boards/mp3-etc/dfplayer-mini-mp3-player-board/ Serial control at one end, speaker output (max 3W) at the other, microSD socket for MP3 files on card.