WM8731 Slave on Arduino

WM8731 Slave on Arduino

Postby r4d10n » Thu May 14, 2015 8:21 am

Hello folks,

I'm experimenting with WM8731 and Arduino and would like to use MCLK connected to the Arduino for generating the master clock (like typically done with FPGA and ARM controllers), even if running at lower sampling rates.

Could any one suggest the modifications to be made on the Open Music Labs WM8731 Arduino code to make it support the slave mode ? I'm willing to experiment with code, if I could know the feasibility and direction of doing the same.


Posts: 1
Joined: Thu May 14, 2015 8:14 am

Re: WM8731 Slave on Arduino

Postby guest » Thu May 14, 2015 12:31 pm

there are 2 slave/master relationships with the codec. 1. who generates MCLK, and 2. who generates BCLK. the codecshield is hard-wired for the arduino to generate BCLK. this could be changed, but would require cutting traces on the PCB and running some small jumper wires. MCLK is more flexible, as all you need to do is remove the crystal, and solder a new wire to your MCLK generating pin on the arduino. it might be good to use a 100ohm resistor in series with this wire, to keep ringing on the line down.

you will want to drive it with one of the PWM pins on the arduino. i would reccomend pin3 for this (OC2B), as timer1 is being used for timing BCLK, and timer0 is being used by the arduino itself (this can be over-ridden if neccessary). in theory, you dont need timer1 if youre generating MCLK yourself, but it will be less code changing to keep things the way they are. the fastest frequency it will be able to produce is 8MHz, so the sample rate will scale accordingly.
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 2 guests