Audio Codec Shield vs MikroE WM8731 Board?

Audio Codec Shield vs MikroE WM8731 Board?

Postby yamanoorsai » Fri Aug 08, 2014 2:12 am

Hi,

I bought both the Codec Shield from Music Labs and the MikroE WM8731 board. I got started with the Codec Shield working with the Arduino using the examples. I tried porting the code to a Parallax microcontroller and I was able to enable sidetone on the Parallax (no luck yet beyond enabling sidetone).

I repeated the same with the MikroE board. The audio that is looped from the microphone to the headphone seems to be poor when compared to the Open Codec Shield. I tried comparing the schematics of both the boards and I am not able to point out the reason for the low volume of the microphone loop in the MikroE board. I also made sure that the register settings were the same when I conducted the experiment on the Codec shield. Any thoughts?
yamanoorsai
 
Posts: 6
Joined: Thu Aug 07, 2014 11:15 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby guest » Fri Aug 08, 2014 5:14 am

so, the biggest differences between the 2 boards are as follows:

1. codecshield has line in/(out), (micrphone in), and headphone out [() = only on headers], whereas the mikroe has headphone out and microphone in.
2. the codechshield has an 11MHz crystal (44.1ksps), whereas the mikroe has a 12MHz crystal (48ksps).
3. the codecshield pins out the master clock and uses a level shifter on the spi lines. the mikroe does not.

so, in regards to volume differences between the 2 using the microphone in, check that the circuitry you added to the codecshield to activate the microphone in is identical to that on the mikroe.

point 3 is probably the cause of the codecshield not working on another platform. the mikroe is setup (im assuming) for the codec to be in master mode. the codecshield is not designed to work in master mode, as the levelshifter only goes in one direction. the LRC and BCLK are backwards. if you are adventurous, you can either remove the levelshifter or disable it by shorting the EN pin to ground. then solder jumper wires off the appropriate pins. the only risk here, is that the LRC pins (ADC and DAC) are shorted together on the codecshield under the IC. so if they are not doing the exact same thing, they will fight with each other and possibly harm the chip. in theory they should always do the same thing, but its a bit risky. you could lift one of the legs on the IC to prevent this, but that is getting a little more complicated.

in retrospect, it would probably have been better to design the codecshield to use master mode, or at least made those pins more flexible. it runs just fine in slave mode, but you need a timer watching the master clock to trigger an interrupt. you can use an external timer for this (just a single logic ic) if the microcontroller doesnt have one built in. i cant remember exactly why i did it that way, but i suspect it was due to tight timing constraints that i didnt think i could meet in master mode.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby yamanoorsai » Fri Aug 08, 2014 7:36 am

Thanks. The Codec shield works on both the microcontroller platforms. The Codec shield uses a 220uF on the headphone output whereas the MikroE uses 330uF. Could this also affect the volume?

Sai
yamanoorsai
 
Posts: 6
Joined: Thu Aug 07, 2014 11:15 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby guest » Fri Aug 08, 2014 11:29 am

no, if anything that would make the codecshield more quiet into headphones. what circuitry did you add to the codecshield to use the mic_in pins? the mikroe has a 1nF and 330ohm at its input, which probably is attenuating the signal.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby yamanoorsai » Fri Aug 08, 2014 12:37 pm

With the Open Codec shield, I had to just connect the Left Line in to the Mic Input. I wish I could use the shield as it is but I have to mount it on top of 2 breadboards and it makes it a bit unwieldy.

My goal is to use the Parallax (an 8 core microcontroller running @ 80 MHz) and the WM8731 to record audio into an SD card. I got the SD card writes to a wav file working. I am trying to port the AudioCodec.h to the Parallax now to record audio. No luck in getting the SPI code right. I have been referring to the datasheet and the Open Codec shield code.
yamanoorsai
 
Posts: 6
Joined: Thu Aug 07, 2014 11:15 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby guest » Fri Aug 08, 2014 4:00 pm

what sort of microphone are you using? most electret mics need a bias resistor, which is what the 680ohm resistor is for. but, this resistor also attenuates, so without it maybe its louder, as long as it can get some bias signal from the input.

the timing is very finicky. the LRC pulse needs to be at just the right time, this was the most difficult thing to figure out.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby yamanoorsai » Fri Aug 08, 2014 5:53 pm

I am using this microphone from Radioshack.

If I actually succeed in porting the code, I plan on building 2 more units. Can I simply solder an electret microphone across the LINE_IN pads? I am not sure if I should amplify the electret microphone signal using this Sparkfun board.

the timing is very finicky. the LRC pulse needs to be at just the right time, this was the most difficult thing to figure out.


I found some I2S drivers for the Parallax platform used for the WM5824 DAC. I plan to implement an equivalent since WM8731 supports the I2S mode. I am a bit confused about the timing diagrams found in the datasheet. Can I set ADCLRC pin and receive data from LEFT_LINE_IN and RIGHT_LINE_IN followed by enabling DACLRC to send the data to the headphones?

Does the data have to be received and transmitted simultaneously like it does in the function call AudioCodec_Data of the Open Codec Shield Library(I am trying to implement an equivalent of microphone.pde). I will let you know how it goes.
yamanoorsai
 
Posts: 6
Joined: Thu Aug 07, 2014 11:15 pm

Re: Audio Codec Shield vs MikroE WM8731 Board?

Postby guest » Fri Aug 08, 2014 9:48 pm

the microphone you are using has its own battery to supply the bias, so it can go straight to the line_in or mic_in.

if you can implement I2S that would be great, as it will have a better chance of working. the SPI thing was quite a hack.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm


Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 1 guest


cron