Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Quad Channel with WM8731

  1. #1

    Quad Channel with WM8731

    Hi All..

    I've been trying to design a quad channel audio codec board using SGTL5000 chips.. I made a prototype board, but I just don't seem able to solder those pesky QFN32 packages without a pick and place machine..

    I was wondering if the same I2S_quad audio objects would work 'out of the box' with two WM8731 chips wired in the same way? They're much easier to solder.. I'd be very happy to share my eagle files with the community too.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,303
    Theoretically this should work. With quad I2S, each codec chip operates independently (its own data lines) without any way of knowing another chip is also getting the same clock signals.

    But there are a couple minor issues to consider.

    1: As far as I know, WM8731 doesn't offer configuration for its I2C address, so you'll need to do something special to communicate with more than 1 of those chips on the I2C bus. Probably the simplest would be the connect one WM8731 to the normal SDA & SCL (pins 18 & 19) and connect the other chip to alternate SDA & SCL pins. Then use Wire.setSDA() and Wire.setSCL() to change to the alt pins when you want to control the other chip. This problem isn't unique to WM8731 - there are lots of ways to deal with using 2 I2C chips with the same address. Just know, like any fixed-address I2C chip, simply connecting two of them to the same SDA & SCL lines won't work.

    2: Even with just one chip, the WM8731 is highly sensitive to the wire length of MCLK, especially if you use Teensy 3.6 (which has a higher bandwidth MCLK pin than Teensy 3.2 or 3.5). Two chips is likely to be much worse. Best to use a 4 layer PCB with a solid ground plane underneath the MCLK and other I2S signals. Or if using a 2 layer PCB, route GND close to MCLK. You should add a resistor in series with MCLK, placed close to Teensy. Plan on 330 ohms to 1K.

  3. #3
    I believe that pin 21 of the WM8731 allows two I2C addresses, that should make two of them possible while sharing wires.

    An update on the WM8731 project I posted at the end of May
    http://https://forum.pjrc.com/threads/56331-WM8731-Board-Ideas
    is that I finished the layout, somewhat as shown, and have obtained 4-layer boards from OSH Park. These boards are Teensy Audio Adapter in size and pins, I have one board populated and ready for test. I ran into a minor snag in getting the comparison SGTL5000 sketches running properly. That is close to being resolved and then I can test the WM8731. As soon as I get good measurements on the WM8731, I will release the board through OSH Park sharing, as well as the KiCad files.

    That board has pin 21 grounded through a cut-able trace.

    By the way, there was not enough room for the headphone capacitors and jack, so those is on a separate board that is also done. It actually has additional value as it allows mechanically separating the headphone jack from the codec board. A 3-pin header arrangement supports direct wire or headers with cables.

    This may be of value, IF it works properly! I also have some non-hobby activities that are limiting the time available for this stuff, but it is getting some attention.

    Bob

  4. #4
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    209
    Quote Originally Posted by Bob Larkin View Post
    I believe that pin 21 of the WM8731 allows two I2C addresses, that should make two of them possible while sharing wires.
    Assuming the SSOP part, Pin 22 (CSB) of the WM8731 controls the I2C address. Pin 21 (MODE) controls whether it is I2C or SPI control interface. For two WM8731s, pull or tie the MODE pin low on both chips to select I2C, then pull or tied the CSB pin low on one, high on the other.

  5. #5
    Quote Originally Posted by Blackaddr View Post
    Assuming the SSOP part, Pin 22 (CSB) of the WM8731 controls the I2C address. Pin 21 (MODE) controls whether it is I2C or SPI control interface. For two WM8731s, pull or tie the MODE pin low on both chips to select I2C, then pull or tied the CSB pin low on one, high on the other.
    Yes, yes. That is correct. My comment on pin 21 was wrong. Thanks for catching this.

    Good news is that the schematic and board I referenced above in this thread are correct.

    Bob

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •