Aud-I/O I2S audio breakout

Hardware incubation. See also our in development projects wiki.

Aud-I/O I2S audio breakout

Postby Bertho » Sun Nov 11, 2012 10:13 am

Hi all,

I am working on a project that requires some real audio and I always wanted to play with I2S (attached to an arm microcontroller). So I decided to design a breakout board with stereo audio input and output(*). It uses a Wolfson ADC WM8782 and a Wolfson DAC WM8523. All configuration pins are available on the SIL headers. The headers are at 2x10x100mil with 700mil spacing, so it should be possible to dump it into a breadboard. The breakout board can be split into a DAC and ADC part, each measuring 21.6mm by 45.1mm.

Comments?

combined-small.jpg
PCB gerberview



(*) sparkfun only has an ADC afaics and that is not in stock.
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby bearmos » Sun Nov 11, 2012 7:13 pm

I started noticing i2s on a shared SPI peripheral (part of an stm32 I'm using currently). Not having looked into it, I'm assuming it's basically SPI with a standardized protocol?

I've done the same types of breakout boards before (easily breadboardable) - it never ceases to amaze me how long I used them after the initial development. Having a few modules that can easily be thrown together on a breadboard in a few minutes makes tryng out new ideas so fast there aren't any excuses as to why something can't be done ;-).

Looks good so far - any plans on sharing the rest of the project?
bearmos
Hero Member
Hero Member
 
Posts: 741
Joined: Tue Nov 02, 2010 10:02 pm

Re: Aud-I/O I2S audio breakout

Postby Bertho » Sun Nov 11, 2012 9:01 pm

bearmos wrote:I started noticing i2s on a shared SPI peripheral (part of an stm32 I'm using currently). Not having looked into it, I'm assuming it's basically SPI with a standardized protocol?


Yes and no. It is a serial protocol, but it runs with a few extra signals like left/right clock (which is the actual sample rate), master clock (128..1024 times sample rate) and then the standard datastream and bitclock. The data format is also much more complicated running between 16 and 32 bits and modes to left/right adjust the datastream (to interleave multiple chips on a bus). Not all formats are called "I2S", though, but most microcontrollers with basic I2S support can cope with many of the formats.

bearmos wrote:I've done the same types of breakout boards before (easily breadboardable) - it never ceases to amaze me how long I used them after the initial development. Having a few modules that can easily be thrown together on a breadboard in a few minutes makes tryng out new ideas so fast there aren't any excuses as to why something can't be done ;-).


That was exactly my thought. These breakouts make it so simple to hack something together that you can get a yes/no for a project very fast.

bearmos wrote:Looks good so far - any plans on sharing the rest of the project?


Absolutely! The project is open, but not yet documented. I'll upload the schematics in a separate post. At least it will be somewhat documented this way ;-)

--
Greetings Bertho
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby bearmos » Sun Nov 11, 2012 10:50 pm

Bertho wrote: bearmos wrote:Looks good so far - any plans on sharing the rest of the project?

Absolutely! The project is open, but not yet documented. I'll upload the schematics in a separate post. At least it will be somewhat documented this way ;-)


Cool, looking forward to it. I've found that it's funny how easy it is to post progress on projects in forum threads. Probably due to the informality of the forum vs something like a web page. Of course, it also helps to have such a great community here ;-)

I just tried documenting a project for the first time as it unfolds here and it's been great - both in the questions/comments and "hey, you forgot xyz!", which is exactly what I was hoping for.

I find that, since I really like to take screenshots and "show" as I'm telling, a screen capture utility helps quite a bit. A freebie for windows is gadwin print screen, which makes taking screenshots of selections as easy hitting print screen, dragging the selection and (optionally) naming the file.
bearmos
Hero Member
Hero Member
 
Posts: 741
Joined: Tue Nov 02, 2010 10:02 pm

Re: Aud-I/O I2S audio breakout

Postby Bertho » Mon Nov 12, 2012 7:15 am

Here are the schematics of the design.

The PCB got changed a bit removing the linear regulator. There was really no point of having it because the digital io is 3.3V. The supply should already be available in the system as most of the ARM systems run on 3.3V anyway. This is a small compromise for the ADC because it can handle a higher voltage at AVdd for better audio input performance, but it is not worth the trouble imo.

aud-io_sch_1.png
Audio out

aud-io_sch_2.png
Audio in


Combined in a PDF:
aud-io_sch.pdf
Schematic pdf
(19.09 KiB) Downloaded 326 times


New PCB view:
combined-small.png
Gerber view
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby joushou » Sun Nov 18, 2012 8:48 am

Interesting - I'm curious if I could get these to work with the latest revision Raspberry Pi boards that will be shipped soon (I only ordered them half a year ago... But they got upgraded to the newer 512MB ones, so I suppose it's OK...). I'm far from satisfied by the PWM sound experience, and I don't want USB to fire any more needless interrupts... I2S sounds like a proper solution (Yay for the addition of full I2S to the GPIO on rev2 pi's <3)
joushou
Newbie
Newbie
 
Posts: 3
Joined: Tue Jan 17, 2012 10:44 am

Re: Aud-I/O I2S audio breakout

Postby Bertho » Sun Nov 18, 2012 8:56 am

joushou wrote:(Yay for the addition of full I2S to the GPIO on rev2 pi's <3)


Well, if the I2S signals are available, then there should be no problem. It is then a matter of setting it up or creating an alsa driver.

--
Greetings Bertho
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby kasbah » Thu May 30, 2013 3:26 pm

Did you ever get this made?
kasbah
Newbie
Newbie
 
Posts: 24
Joined: Fri Dec 14, 2012 1:41 am

Re: Aud-I/O I2S audio breakout

Postby Bertho » Thu May 30, 2013 4:06 pm

kasbah wrote:Did you ever get this made?

Yes, I did get it made. However, it is still not tested (properly). My colleague who was to write software for it still has not finished. He is working on it, but he can almost only use Tuesday evenings (hackerspace meetings) to get the code to run, so this is progressing at snail's pace.
pcb-top.jpg
Pcb mounted top
pcb-bottom.jpg
Pcb mounted bottom
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby lowpowermcu » Thu Jul 11, 2013 5:33 am

Hi all,
I am woring on a similar project: interfacing STM32 with WM8782 through I2S. The STM32 MCU collects data and writes in USB Key using the file system fatfs.
Now I am confused in I2S peripheral configuration.
If I am using 48KHz as sampling frequency: how much do I need to provide on MCLK ? Is it 6.144MHz, 9.216MHz, 12.288MHz....?

Thanks in advance
lowpowermcu
Newbie
Newbie
 
Posts: 6
Joined: Thu Jul 11, 2013 5:22 am

Re: Aud-I/O I2S audio breakout

Postby Bertho » Thu Jul 11, 2013 12:02 pm

lowpowermcu wrote:Now I am confused in I2S peripheral configuration. If I am using 48KHz as sampling frequency: how much do I need to provide on MCLK ? Is it 6.144MHz, 9.216MHz, 12.288MHz....?

It will work for all of them. You need to check the STM32 docu to see what it can generate with respect to the bitclock. There are often severe limitations which clock can be generated at a specific sample rate from the CPU peripheral.
These codec chips use the MCLK to run the digital filters and some will change the filter characteristic depending frequency (although the wm8782 does not seem to do so).
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby lowpowermcu » Sat Jul 13, 2013 1:31 pm

Hi Bertho,

Thanks for your reply.
In STM32, when I selected 48KHz I measured 12.288MHz on Master clock (MCLK) so the factor is x256.
One other point, in WM8782 datasheet it is mentioned that in I2S mode the MSB is availbale on the second rising edgeof BCLK following LRCLK(WS). I think I should right-shift the data read in I2S dara register. What do you think?
lowpowermcu
Newbie
Newbie
 
Posts: 6
Joined: Thu Jul 11, 2013 5:22 am

Re: Aud-I/O I2S audio breakout

Postby Bertho » Sat Jul 13, 2013 2:50 pm

lowpowermcu wrote:One other point, in WM8782 datasheet it is mentioned that in I2S mode the MSB is availbale on the second rising edgeof BCLK following LRCLK(WS). I think I should right-shift the data read in I2S dara register. What do you think?

No, by definition, Philips I2S spec has the bit one clock moved.

The stm32F10x supports many formats: left/right adjust and I2S, so does the codec chip. You need to match the two to talk the same protocol.
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Re: Aud-I/O I2S audio breakout

Postby lowpowermcu » Wed Jul 17, 2013 6:02 am

Hi,

Thank you for the hint. I got it working now. The key is the philips mode. Thank you very much.
BTW, the WM8782 is a stereo recorder, is there a headset with stereo microphone?
lowpowermcu
Newbie
Newbie
 
Posts: 6
Joined: Thu Jul 11, 2013 5:22 am

Re: Aud-I/O I2S audio breakout

Postby Bertho » Wed Jul 17, 2013 6:37 am

lowpowermcu wrote:BTW, the WM8782 is a stereo recorder, is there a headset with stereo microphone?

There probably is, somewhere (most likely overpriced). A headset has normally no need for stereo microphones. I'd suggest a search-engine. Maybe others have bought such a piece and can give some input.
User avatar
Bertho
Sr. Member
Sr. Member
 
Posts: 337
Joined: Mon Sep 19, 2011 4:34 pm
Location: Somewhere in the vicinity of Betelgeuse

Next

Return to Project development, ideas, and suggestions