Propeller interfacing with an external Audio DAC
Samgot7
Posts: 4
Is there any example code on how to interface the prop with an external DAC such as one of the Wolfson products? I have read about other people interfacing the prop to Wolfson DAC's, but I can't find anything on OBEX or any example code. I know that different DAC's would require different code, but if someone has already written the code for a certain DAC then I would just use that. I have seen where the prop can be used to play audio without an external DAC, but I am wanting more of an audiophile grade sound. I suppose that a driver for a DAC would be written in PASM, but right now I am totally lost when it comes to PASM. I have used SPIN and have a basic understanding of that, but am still at a beginner level. So far, I have enjoyed experimenting with the prop and want to learn more about it. Anyhow, if anyone could help me out, or point me in the right direction as far as what I need to learn to code my own driver, I would appreciate it.
Sam
Sam
Comments
Indeed - I feel guilty as I have interfaced to a variety of such ADCs/DACs and not put anything in the Obex - anyway here's a DAC driver for I2S - aimed at the WM8524, but any 24-bit I2S bus chip needing a full or partial set of MCLK, BCLK, LRCLK should work with this I think.
I use an MCLK of Prop clock / 8 and LRCLK of Prop clock / 2048. With a 6.144MHz xtal and pll16x, Prop clock = 98.304MHz, MCLK = 12.288MHz, LRCLK = 48kHz (sample rate).
Another cog is going to have to update the samples at 48kHz of course!
Sam
The code makes use of 2 counters, one for the MCLK and one for the BCLK (bit clock) and then the LRCLK is set (as is the data pin) in code with 8 instructions per bit, relying on the Prop's deterministic timing (though I think it has to resync to the BCLK line after accessing hub memory).
I know I've posted something like this before on the forum, just not sure where or which driver... At some point I will update my audio mixer post in the Projects forum. Promise.