Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9881 Discussions

I2C and WM8731 Codec Board (MIKROE-506)

Community Manager

i2cdetect cannot detect codec board with i2cdetect on either I2C-1 or 6 via:

a) mini-breakout board + usb cables for power/console + bi-directional/i2c friendly level shifters (tried both Sparkfun and Adafruit) = empty i2cdetect table


b) Sparkfun I2C block (includes level shifters) + Sparkfun Base block (for power/console via usb cables) = "lost arbitration" messages which I haven't spent much time looking into

I am trying to dust off all of Sergey's audio related work ( blog, /thread/75433 forum post) and get Edison working with a MikroeElektronika's Audio Codec Proto board ( MIKROE-506) that is based off of the WM8731 ( datasheet). Edison should be communicating to the Codec board via I2C for control and SPI for data.

I have verified the codec board works by hooking it up to an Arduino Uno like this project here, which uses both I2C and SPI. I can hear the sine tone from the example with the headphones. Using the Arduino Wire library, I scan the Arduino I2C bus and it always find the codec board.

Other things I've tried to rule out anything:

- I2C on Edison w/mini-breakout with and without level shifters can i2cdetect other I2C sensors (e.g. MCP4725 DAC)

- Edison + Sparkfun Base Block + Sparkfun ADC block can i2cdetect

- Sparkfun Bus Pirate can always find the codec board with it's I2C 7bit address brute force search in any setup I've tried above in this post (found using both 100khz and 400khz I2C speed)


Searching I2C address space. Found devices at:

0x34(0x1A W)

- Bus Pirate I2C Sniifer when I run i2cdetect looks ok but there is nothing found by i2cdetect back on Edison:



Any key to exit


- Pull up resistors - I've tried combinations of 1k external pullups and/or modifying the internal ones (/thread/59604 here) in the /sys/kernel/debug/gpio_debug/gpio*

- Also have tried various gpio export/etc as mentioned in the I2C section of the Edison Arduino Board guide (even though I do no have that board)

- Tried/thread/56148 configuring Edison I2C speeds (default was 'fast', but tried 'std' with no luck, WM8731 should support up to fast/400khz)

- Wrote test C programs using the MRAA library to try to 'talk' to this codec board with no luck

I feel like the only things I haven't tried is to either get the Arduino breakout board and/or power the mini-breakout board via external power supply. My I2C SDL/SCL lines at their longest are 40cm (2x20cm, connecting thru level shifter).

I reached out to Sergey (SergeyK) directly and he never did connect up Edison to this codec board. He re-used his own custom audio board (which I am shopping around from different PCB/A places). In the post, he mentions hooking up multiple power supplies to the codec board, which is only necessary if you're not using level shifters. He was a great help and gave fast, detailed replies to my emails but troubleshooting something funky like this wasn't going to get done over email.

Thanks for any help,


Using default firmware

root@edison:~# uname -a

Linux edison 3.10.98-poky-edison+ # 1 SMP PREEMPT Mon Jun 6 14:32:08 PDT 2016 i686 GNU/Linux

0 Kudos
11 Replies
New Contributor I

Hi joe_nasti,

The WM8731 doesn't respond to i2cdetect commands. I think its mentioned in the datasheet that the device is write only. I had the same issue before.



Community Manager

Well now things are making some sense. I knew it had to be something obvious! I had tried i2cget commands also, but that'd be doing the same thing (trying to READ)...Thanks vinu_gk!

The datasheet does say:

The WM8731/L is a write only device and will only respond to the R/W bit indicating a write.

If WM8731 only supports write requests, I did try the i2cdetect -q option but Edison i2c does not support SMBus Quick Write. I'm not sure there is anything else to try there with that command. I guess i2cset commands will tell me if the codec is connected and powered correctly.

When I try to run Sergey's i2cset commands to initialize, it's a bit flaky where some work and some don't. I believe this has something to do with the high voltage levels that are coming from my level shifters. The WM8731 can only handle 3.6V and my scope is telling me I can peak that pretty easily. That being said, I still cannot hear audio playback with my headphones - no matter turning the volume all the way up (0x7f).

In another thread (/thread/111754, SpiderKenny suggests I rebaseline my firmware to Sergey's old one. I will have to give that a try...but in the meantime, does anyone know what could have changed with the audio subsystem or the dummy codec or something from firmware edison-src-ww18-15.tgz to besides maybe the IoT stuff on top?

Community Manager

I've been exchanging posts with SpiderKenny in his thread that I referred to earlier ( ).

I rebuilt the firmware image off ww18-15 with Sergey's WM8731 patch and enabled it in the boot param 'audio_codec_name'. After configuring the ALSA settings, I feel like I'm closer but still not operational.

Here's my latest post there (/message/457392# 457392 457392), the whole thing is flaky. Some boots will complain of the -517 error, while sometimes it will complain of the -121 error....BUT then there are times where it DOES NOT COMPLAIN. I can actually use aplay or mpg123 to play to hw:1,0 (default:CARD=wm8731audio) - but I do not hear any audio from the codec board 3.5mm headphone jack. So software thinks it's working, but hardware doesn't seem to be.

Community Manager

Thanks to several people offline ( SergeyK, SpiderKenny, vinu_gk, squaredn) - I finally was able to play audio (still need to test recording). The bottom line is I should've 'listened' to the blogs and posts exactly before insisting I should be able to connect this another way. Level shifters DO NOT work here no matter what I tried - you HAVE to use different power supplies from Edison to power the WM8731 chip.

The solution? Use a combination of both of Sergey's posts ( one, two)


- I rebuilt the firmware image off ww18-15 with Sergey's WM8731 patch and enabled it in the boot param 'audio_codec_name'.

- Using AlexT's repo, install mpg123 and download a sample mp3 like the one from here


- Modify the codec board like this picture (thanks squaredn!). This isn't my picture, I broke off the top of the inductor trying to cut/lift the L2 leg. It's a little flaky playing the audio but it works. Sergey told me I could remove the inductor if I needed to get more reliable but this inductor is in a circuit to improve audio quality. I need to test with and without it to see what I'm going to do for my situation.

Valued Contributor II

Good work @joe_nasti

I avoided using level shifters by running the WM8731 at 1.8 V for all the I/O


Community Manager

SpiderKenny, I know the WM8731 datasheet on page 6 says DCVDD/Core typically runs at 1.5V - but it can support 3.6V MAX! I figured this is what MikroElektronika was reading too when they designed the board the way they did - only one VCC pin of 3.3V. What is this newbie missing? Level shifters should have worked??? I'll take the win here, but have to get to the bottom of why these didn't work.

Valued Contributor II

I tied pin 1 and 27 to 1.8 V and pin 14 to +3v3 (for audio)

But you are right that Level shifters should have worked.

Which ones did you use?

(I've found that the Edison uses weak pull-ups and the type of level shifters which don't need a direction pin get confused with which direction to pass the signals.

For example on an RS232 port I was using the internal pull up of the Receive line in an FTDI CMOS Cable was strong enough to make the level shifter to think that the line was input rather than output.)

Community Manager

I'm surprised you didn't also put pin 8 to +3v3 HPVDD, it also is listed as an 'Analogue Supply' in that same table I reference on page 6.

I tried two bi-directional sets from Adafruit ( and Sparkfun (

Did you even try to manipulate the Edison internal pull-ups via command line (e.g. ) like it says in the Arduino Breakout guide? (I don't have the Arduino Breakout for Edison, but it has a lot of good reference info there). The internal pull ups can be configured as 2, 20 or 50 kohm (w/I2C pins capable of 910 ohms). I only ever tried adding external resistors (only tried 2.2kohm I think) on the I2C SDA and SCL lines thru the level shifters. I never tried any other lines or stronger resistors.

There was this Arduino <-> Codec Board project on Github ( This is what I used to verify my codec board worked. Now that I got things working with Edison, I referenced back to the project. He has you hook up 220ohm series resistors between the ADC/DACLRC lines. Do you think this is the combination of pins and resistor strength to use Edison w/Codec Board as-is? I am still learning the actual math/etc behind all of this circuitry.

Valued Contributor II

joe_nastiTurns out I just forgot to mention pin 8 :-)

Here's a partial schematic of my board:

And an image of the actual board:

(Forgive the crude hand soldering - this was a prototype hand built by me, including hand soldering the 70 Pin header!)

Community Manager

Thanks for sharing, Kenny...I really need to step my soldering game up for those fine-pitched parts....any secret for getting the 70-pins connected and verified working?

Valued Contributor II

joe_nasti Yeah - I clean the pads with isopropyl alcohol, then put a small amount of solder on one corner pad. (eg, pad 1)

I then slide the part into place, and solder down the one pad. Don't worry at this stage if you short it to neighbouring pads. Then align the part and solder the diagonally opposite pad. (eg, pad 70).

Then put some good quality flux all over all the pads. Drag a small blob of molten solder along all the pads. Using flux and a clean soldering tip you can wick away any shorts. Use a microscope or magnifying glass to check the connection.

This works well for me, the magic is the flux, it helps keep the solder going only where it is mean to. The flux in multi-core solder won't do it. You can use multi-core solder, but you'll still need extra flux. I use a gel-type tacky flux rather than a liquid flux pen.