- Support for 4x20 LCD Display and large number display
- Brightness and contrast adjustment with remote
- (OPUS/Wolfson WM8741) DAC volume control: remote and rotary encoder
- (OPUS/Wolfson WM8741) DAC random filter selection 1 to 5 with remote
- (OPUS/Wolfson WM8741) DAC upsampling selection (L, M, H -this is the OSR setting)
- I2C level shifting (5V to 3.3V)
- Optimized power-up sequence

Sunday, April 5, 2009


Was able to control the DAC with ARDUINO. Here are the switch settings for S/W control (and the switch settings for H/W control on the right).

Spent hours debugging the code and programming most of the registers. It turned out that I was trying to be too smart and added the write bit to the DAC 7-bit DAC address. Only after re-reading the Arduino Wire Library did I realize that wire.begingTransmission() only needs the 7-bit address.

Note: the I2S switch sets the address of the DAC (for I2C communication purposes). The WM8741 can have one of two addresses:

0011010 (or 0x1A) I2S switch=0
0011011 (or 0x1B) I2S switch=1

In my case I set the switch=1 because that is the address I use in my code (0x1B)

Here is some info from the WM8741 datasheet (page 5):

  • I2S: in 2-wire s/w mode (using I2C protocol), this sets the address of the device. I would assume setting it low gives one address and setting it high gives the other address
  • DIFFHW: 0= normal; 1= MONO. IMPORTANT: for s/w operation this has to be set to zero. If set to one it assumes h/w mode
  • With DIFFHW=0, then MODE=Z for 2-wire control (I2C protocol); MODE=1 is for 3-wire protocol. When in s/w mode, register 8 is used to set the chip in stereo or mono mode
  • OSR is unused
  • IWO is an output, so set to Z
  • DSD and DEEMPH must be set to Z because these become the control wires to the controller in s/w mode
  • MUTE: 0= Mute active; 1= Normal operation
  • FSEL: Unused.

So in summary:

I2S: try 0 or 1 to determine the address of the chip
MODE: Z (for I2C mode)
DIFFHW: 0 (for s/w mode)
MUTE: try 1 for "Normal operation"

So the only switches to adjust/try in S/W mode are I2S and MUTE


Chris Thompson said...

Congratulations! And thanks for the blog. I've been thinking of doing exactly the same thing with a WM8741 and Arduino.

Anonymous said...

Thank you very much. It was a very enjoyable project. I'll add more detail in the next few days.