What do i need for this DAC ? - Page 1
Forum section: electronics / projects

author: Jan Audio
author_rank: Frequent Contributor
timestamp: October 31, 2018, 04:28:12 pm
content: Hi, i have this DAC for I2S : WM8521The MCU i use is : PIC32MX170F256BI thought i generate some MCC,thing is MCC dont has I2S codes,anybody know what to do ?Now i read the manual :The audio interface supports I2S, Right Justified and DSP digitalaudio formats.What is the difference ?, google dont know.Dont i need more external components for this DAC ?, can i hook it direct to the MCU nothing more needed ?Ofcourse i also need some capacitors,this DAC is SOIC package, if i buy a 100n SOIC, does it fit the pins ?, maybe i can solder it on the smd-converter then, close to the DAC.I saw this PIC32MX170F256B has special audio codec I2S, so i got this one.Maybe a SPI DAC is better or simpler ?, what is the big difference ?, exept that MCC dont has I2S code,then i could buy any PIC32, all has SPI on board.This DAC is also not being made no more, newer smaller DACs are there now,you think this SOIC DAC is different with less quality then the newer ones ?, is is it only smaller package.thanks in advance

author: alex89
author_rank: Contributor
timestamp: October 31, 2018, 05:03:27 pm
content: Did you read the DAC datasheet ?

author: Jan Audio
author_rank: Frequent Contributor
timestamp: October 31, 2018, 05:11:55 pm
content: Yes, did i miss something ?

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 31, 2018, 05:32:35 pm
content: Well, they suggest a typical application schematic, so you'll see there which components you need around this DAC. Mostly a few passive components.As for more recent DACs of this kind, you may take a look at Cirrus Logic, for instance this line:https://www.cirrus.com/products/cs4334-35-38-39/Regarding using I2S DACs with a PIC32, you could start here:http://ww1.microchip.com/downloads/en/AppNotes/01422A.pdf

author: Buriedcode
author_rank: Super Contributor
timestamp: October 31, 2018, 07:35:23 pm
content: Setting up the SPI module for I2S on the PIC32 (or PIC24) is pretty straight forward, with only a handful of config registers. Master is much easier than slave for timing reasons. It also has a "clock reference module" for generating a wide range of clocks for I2S (so you dont' have to use specific crystal frequencies for standard sampling rates, like 12.288MHz for 48ksps, you can use 16MHz).As for DAC's, some of the older ones are just as good as modern ones - at least in terms of "audio quality" and even if the DAC you have doesn't satisfy you, you can just use that to get the system working, then upgrade to a newer one because almost all DACs support I2S, and only require a few caps. The IC package has little to do with it except for the practical problems of populating the PCB.It sounds like you're not even sure about how to use the PIC32 and DAC given you are asking how to hook it all up. How many projects have you done on the PIC32?

author: Jan Audio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 01:44:37 pm
content: Thanks Burried.This is my first project for PIC32.I made 3 synths with DSPIC internal DAC, i,m new to PIC32, i,m starting to like it ( less power consumption ).I still have this problem : how to disable cashing and wait states ?Cant find much in the manual, if i search for "cach" it find nothing about it.I did find one wait state : BMXblabla, sets RAM waitstate from 1 to 0 cycles.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 01:52:53 pm
content: Quote from: SiliconWizard on October 31, 2018, 05:32:35 pmThanks SiliconWizard, a few passives sound good.I was afraid i needed more things for the PLL.This DAC is indeed Cirrus logic, Wolfson.Next time i also take a look at Texas instruments.That DAC you recommend is a 1 bit, not multibit.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 02:01:27 pm
content: I dont know what mode to go for.I2S or DSP mode, what is better ?

author: Buriedcode
author_rank: Super Contributor
timestamp: November 01, 2018, 02:36:38 pm
content: Quote from: Jan Audio on November 01, 2018, 01:52:53 pmIt is a sigma delta DAC, like almost all modern Audio DAC's. These are, at least in basic terms 1-bit DAC's but with interpolation and oversampling making them 16-24-bit. This relaxes the constraints on the output filter, meaning you only really need a simple RC filter ( = less components). The DAC he linked will do just fine!Quote from: Jan Audio on November 01, 2018, 01:52:53 pmWhat PLL? The only PLL required for this would be the clock reference module in the PIC32 to generate the required master clock and LRCLK for the correct sample rate. The DAC itself has no PLL, and you do not need an external one.Quote from: Jan Audio on November 01, 2018, 01:44:37 pmA synth is quite a big project, so I guess you're mostly there then.Quote from: Jan Audio on November 01, 2018, 02:01:27 pmI2S would be more "compatable" with different devices as it is a more widely used standard. The PIC32 SPI module also supports this mode well. DSP mode I *think* is used when there are more than 2 channels, and it can be used with plain SPI but the timing has to be precise for the sample rate. In terms of "sound quality" no difference. Both send the same data to the DAC. long story short - stick with I2S just because its easier to implement with a PIC32.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 02:53:08 pm
content: Thanks, i will stick with the I2S.Later on i will try the texas instruments with 8 outputs, and it only cost 1 SPI module in DSP mode for all 8 outputs ?, very nice.I am going to generate some SPI code in MCC now, hope i get the correct interrupt for audio.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 01, 2018, 04:56:24 pm
content: Quote from: Jan Audio on November 01, 2018, 01:52:53 pmWolfson was acquired by Cirrus a few years ago, but recent CS DACs are not Wolfson products. Not sure they even share any silicon IP.Recent CS audio DACs are cheap and pretty decent.Quote from: Jan Audio on November 01, 2018, 01:52:53 pmIf you're looking for higher-end audio DACs from TI, I would recommend the PCM1794 which is excellent. A whole different ballpark. It's not as straightforward to integrate though - it has current outputs and will need a proper output stage to get the most out of them. You'll get the same with most high-end DACs.Quote from: Jan Audio on November 01, 2018, 01:52:53 pmNot sure what you're on about here. The WM8521 and CS433x DACs are both sigma-delta DACs with voltage outputs. The internal details of the respective sigma-delta modulators are not disclosed anyway and the rest is just marketing. The CS43xx have better THD figure and only slightly lower SNR - overall, I think they perform better, that's all that really matters IMO. You can find even better performing DACs from Cirrus - for instance the CS434x series, and even the CS43198 - I just gave an example of what was close enough to the obsolete WM8521.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 05:23:34 pm
content: I readed all these manuals and they say multibit is less noisey, but you are right its about the specs.Hoping i have some sound tomorrow, MCC dont generates interrupt for me, dont know what to do.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 01, 2018, 05:49:41 pm
content: Quote from: Jan Audio on November 01, 2018, 05:23:34 pmOK. There's much debate about this. Multi-bit (or segmented) sigma-delta modulators are hard to design right. A simple sigma-delta modulator running at a high enough frequency will be much simpler to design and much easier to get right.Again, for the kind of performance you were targetting, I would stick to the simple sigma-deltas. If you're willing to use simple-to-integrate, voltage-output DACs, it won't matter.I would only begin to bother if aiming at SNRs > 100 dB and THD+N < -100 dB, really. In which case, the output stage must be designed carefully as I said above.

author: diyaudio
author_rank: Frequent Contributor
timestamp: November 01, 2018, 06:26:33 pm
content: Quote from: Jan Audio on October 31, 2018, 04:28:12 pmYou need to make sure the PIC supplies all the necessary clocks required. BCLK (Bit clock input) , LRCLK (Sample rate clock input) and MCLK (Master clock input)Operation using master clocks of 256fs, 384fs, 512fs or 768fs is provided, selection between clockrates being automatically controlled. Sample rates (fs) from 8kHz to 192kHz are allowed provided theappropriate system clock is input