View previous topic :: View next topic |
Author |
Message |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
I2S driver |
Posted: Thu Mar 02, 2017 4:54 pm |
|
|
Has anyone used I2S before to talk to an audio DAC? I am using a 24EP256GP206 chip. I know the larger chips have I2S built in but I am trying to keep the cost down. Let me know. Thanx guys. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Thu Mar 02, 2017 5:49 pm |
|
|
I'll play teeter-totter, plus-minus, pros vs cons,....
a) What is the 'extra' cost for a PIC with built-in I2S?
b) What is the cost (YOUR time to R&D) to cut reliable code for I2S?
I'm thinking 'a' will be a LOT cheaper AND faster. It's all in the details of course. Testing alone for your own I2S driver could take a few days depending what it has to communicate to. If this is a one-only personal project 'b' is OK, if a commercial product 'a' is the only real option. Most people don't think their time is valuable,but you should keep track of it, and even at just $50/hr....a day is $400. That will buy a LOT of PICs with I2S,remember it's only a few pennies on the PIC you chose.
Heck even the time spent here asking is costing you time and money...
Options... always think of options.
Jay |
|
|
benoitstjean
Joined: 30 Oct 2007 Posts: 566 Location: Ottawa, Ontario, Canada
|
|
Posted: Thu Mar 02, 2017 6:36 pm |
|
|
Yes, I have and I'm using the 24EP512GP806. Given you haven't provided any details on your project, there's not much more I can say.
I haven't tried the PIC with the I2S port but using an external audio CODEC will provide probably much more flexibility. Also depending on what the ultimate end-goal is, you may or may not want to use the PIC for processing the audio.
Again, this is from my experience because my PIC does a million other things at the same time.
You can get the Texas Instruments TLV320AIC3204 but it's not that easy though. This CODEC is a fairly complex device and clocking is also complex. The CODEC is about 10$.
You can interface the PIC to the CODEC using SPI or I2C.
You also need to provide clocking to the CODEC. I use a 2.4576MHz PWM 50% duty out of the PIC for the CODEC's master clock (MCLK) along with a 128KHz PWM 50% for the CODEC's bit clock (BCLK). The result is that the CODEC outputs an 8kHz 50% duty word clock (WCLK) and the DOUT pin outputs an 8kHz 8-bit PCM bitstream. But the CODEC can go as high as 192KHz stereo.
Benoit |
|
|
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Thu Mar 02, 2017 8:51 pm |
|
|
I am making a little audio device. i am using 16 bit WAV files from SD card to play on small speakers. I would like fairly high quality audio. Right now I am just using a normal single ended DAC but I know I can get some better quality with and audio DAC. I was looking at using PCM5100 or something like that device. Right now I am building my audio on the DAC I am using. It works good but I know I can get better quality with an audio DAC.
Right now I just feed the DAC with 20MHz SPI. Its fast and efficient.
Last edited by curt2go on Thu Mar 02, 2017 9:00 pm; edited 1 time in total |
|
|
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Thu Mar 02, 2017 8:59 pm |
|
|
The difference between the 24EP256GP206 and the 24EP512xx806 is about 6 bucks. I pay right now about 6 for my current DAC but the PCM5100A is around 3. Difference of about $3. But I am looking to cut cost of the device. This is a commercial product. If it was 0.50 I wouldn't even think about it I would move to the other PIC. |
|
|
benoitstjean
Joined: 30 Oct 2007 Posts: 566 Location: Ottawa, Ontario, Canada
|
|
Posted: Fri Mar 03, 2017 5:41 am |
|
|
Based on your comments, you seem more worried about pricing rather how such and such feature works with the MCU.
What you are trying to accomplish can be purchased as a development board from Sparkfun at the following address <https://www.sparkfun.com/products/13660> and they provide the schematics and all.
You could use that as a base and add your PIC MCU to it to do more stuff.
Good luck with your project.
Benoit |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Fri Mar 03, 2017 6:16 am |
|
|
I was curious to see the device Ben linked in and wow.. for $50 that's a GREAT deal. Like Ben said, you could add a small, cheap PIC to do more(HMI-LCD) as ALL the hard code is done, the PCB works.
I know I can't design/make that module in an hour. Can you? I'd buy 2 of them for R&D use, see how easy it is to add a PIC for HMI and bench test for a week.
These days someone, somewhere probably has a low cost 'module' to do anything you want unlike 20-30-40 years ago when you had to wirewrap, etc., your own PCBs and hardwire a UART from a dozen 7400 series chips.
Today there's the Internet and Google......
Jay |
|
|
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Fri Mar 03, 2017 9:45 am |
|
|
I have already designed and commercialized the first version. I am just looking for a little better sound without changing everything. If I had the I2S driver that's really all I need. I will see what I can come up with ? Thanx for the info though. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Fri Mar 03, 2017 9:55 am |
|
|
For the driver, check another 'platform' and convert to CCS C. It ain't that hard...
If this is just one master --> one slave you're just banging bits. No ISRs,no feedback, just one way data ?
Jay |
|
|
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Fri Mar 03, 2017 10:10 am |
|
|
Yeh. That was going to be my next step. Had to try the lazy route first. Lol
Thanx guys... |
|
|
|