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

Thread: WM8731 Board Ideas

  1. #1

    WM8731 Board Ideas

    I was trying to evaluate a WM8731 codec and became aware that the Teensy audio library supported this. One thing led to another, and rather than running a board designed for a different system with proto wires, I ended up starting a Kicad board with the same layout as the current SGTL5000 adaptor. This would minimize lead lengths and make a module possible.

    This is at the point of putting down traces for the PCB, and I thought I would post this for "design review" comments. It might save a board cycle and also make something more useful to others. The plan is to share this on OSH Park if it works out.

    A couple of goals:
    * Compatibility with the physical/electrical characteristics of the Adaptor.
    * Able to be "Master" or "Slave " for the audio sampling.
    * Support an external master clock, like a Si5351.
    * Support experimentation in keeping the analog 3.3Volts quiet

    The schematic:Click image for larger version. 

Name:	WM8731_Teensy_Sch.gif 
Views:	46 
Size:	26.9 KB 
ID:	16692

    The layout is at the part placement point and it looks like it will fit the board space on a 4-layer. There is no room for a headphone jack, so that would come from the J1 header. The headphone jack board would include the blocking capacitors and anti-pop resistors. The part layout:Click image for larger version. 

Name:	WM8731_Teensy_PCB.gif 
Views:	21 
Size:	73.1 KB 
ID:	16693

    Does anybody see problems/additions/subtractions, etc.? Thanks Bob W7PUA

  2. #2
    I should have mentioned that I started the KiCad layout with the board from #skiselev for the Raspberry Pi,
    https://github.com/skiselev/i2s_audio_phat, but quite a few differences have evolved. But, thanks for the start. Bob
    Last edited by Bob Larkin; 05-26-2019 at 09:29 PM. Reason: Correct URL

  3. #3
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    203
    I also did a WM8731 audio board for the Teensy. Mine is significantly larger because I added a lot more functionality including a preamp (to support instrument/mic level inputs), MIDI and connectors. Regarding noise, it all depends on how good a quality you want. My board was specifically with guitar in mind which is very sensitive to noise and sound quality. For lowest noise, you need the analog 3.3V to be supplied by a dedicated LDO. You also need to do a fair bit of careful PCB design to keep digital noise from coupling into the analog ground.

    You can see the schematics for my board in the datasheet found here.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,169
    Looks like you have 2 jumpers meant to select MCLK (Teensy runs as I2S master) and the crystal (Teensy runs as I2S slave).

    But I don't quite understand how the "ext" one works. Looks like it would just short the signal to ground. Is that really what you intended?

  5. #5
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    203
    Quote Originally Posted by PaulStoffregen View Post
    Looks like you have 2 jumpers meant to select MCLK (Teensy runs as I2S master) and the crystal (Teensy runs as I2S slave).

    But I don't quite understand how the "ext" one works. Looks like it would just short the signal to ground. Is that really what you intended?
    Hi Paul, I'm not quite sure exactly which "ext" in the schematic you're referring to? Here's a summary of a couple items for Bob's benefit, but let me know if I'm stilling missing the "ext" you were asking about.

    Main board:
    - *Master mode on the CODEC can be used by installing R4 resistor and removing R13. You would also populate X1 and C10,C13 for the crytsal.
    - External power (instead of USB) which can be supplied to the mainboard at J2 if and only if you've modified your Teensy to use it's VIN pin as a power input and not the USB 5V. The four-pin J2 is not meant to be jumpered, it's meant for you to connect your own +5V source.
    - the EXT signals (EXT0 to EXT7) are GPIO for connecting things like pots and switches to control your audio effects.

    Expansion board: (provides some buttons, pots and LEDs)
    - **The expansion board gets 3.3V from the Mainboard, but can also supply external power (+5V) at it's own J1, which connects to J2 on the mainboard. Here you can supply say, typical guitar 9V at the 2.1mm power plug, it's regulated down to +5 by U1. The PWR_SEL jumper J7 lets you either connect the 2-pin jumper between pins 3-2, which connects the onboard regulator to VIN, or the jumper connects 2-1 which leaves VIN unconnected (note J7-1 is a no-connect symbol, not a ground). This 2-pin jumper on a 3-pin header ensures you can't accidentally damage your Teensy by having it supply VIN from USB as well as the onboard regularor U1.
    - EXT0/EXT1 are connected to big push-button switches (SW1/SW2) for turning effects on and off.

    Notes:
    * if you buy a mainboard board from me, it's always shipped with WM8731 as slave, you have to solder some parts for master mode.
    **if you buy an expansion board from me, the power selection circuit is not populated to keep the cost down. You need to install the parts yourself.

    The purpose of the Expansion board is to give you a working hardware circuit to develop your software controls with, then use the schematic as a guide on customizing your own circuit for the needs of your particular project. Most guitarists want to power their enclosure solely from a standard +9V 2.1mm plug rather than the USB. The schematic shows you a safe way to do that.

  6. #6
    Thanks Blackaddr for sharing the schematic and other info. I checked my I2C and I2S against yours and I think they agree---this is very useful. And, of course, your goal with the boards is much broader than the one I am doing. It is interesting to see your implementation.

    Paul, I think your "Ext" question was relative to my MCLK option. J5 is not a jumper but rather a 2-pin header to take an external clock signal replacing the internal crystal oscillator. This serves 2 (or more) purposes. It allows changing the sample rate without changing a crystal, and for radio applications, it allows a precision clock, as the sample rate affects the radio tuning. Notes 3 and 4 are cryptic descriptions of the 3 MCLK options: Slave Codec, Master Codec with the xtal and Master Codec with external clock.

    I will revise the schematic to have a different symbol for jumpers than for headers! Sorry for the confusion. Right now the only clue is JPx for Jumpers and Jx for headers.

  7. #7
    Here is a better schematic. There are no intentional changes to the content, but the jumper symbol has been improved. The scale is a bit easier to read, as well.

    Click image for larger version. 

Name:	WM8731_Teensy_Sch2.gif 
Views:	27 
Size:	71.4 KB 
ID:	16701

  8. #8
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    203
    Quote Originally Posted by Bob Larkin View Post
    Here is a better schematic. There are no intentional changes to the content, but the jumper symbol has been improved. The scale is a bit easier to read, as well.

    Click image for larger version. 

Name:	WM8731_Teensy_Sch2.gif 
Views:	27 
Size:	71.4 KB 
ID:	16701
    What types of sources to you plan to connect as audio inputs, and what you want to connect the output to?

  9. #9
    My interest is in radio and instrumentation related projects. For instance the SDR Control box that works with a variety of radio projects, like Frank DD4WH's:
    http://www.janbob.com/electron/SDR_Ctrl1/SDR_Ctrl1.html
    And the Vector Network Analyzer:
    http://www.janbob.com/electron/AVNA1/AVNA1.htm

    Currently, I am working with Farhan VU2ESE on a redo of an old SDR radio project, the DSP-10 using modern parts:
    http://www.janbob.com/electron/dsp10/dsp10.htm

    All of these tend to put emphasis on low noise and spurs.

  10. #10
    X1 looks pretty far away from U1.
    On J2 connector it would be nice to have separate ground pins for LOUT and ROUT (pins 6 & 10?)

  11. #11
    QUOTE=bicycleguy;207247]X1 looks pretty far away from U1.
    On J2 connector it would be nice to have separate ground pins for LOUT and ROUT (pins 6 & 10?)[/QUOTE]
    On the X1 location, the scale is a bit deceiving. It is about 15mm or 0.6 inch away. At 12 MHz this I think is just a capacity issue that can be dealt with by changing C15, C16 if needed. It ended up over on the left because the audio stuff was given top priority for the right side by J2. The ground plane on layer 2 is split between analog and digital and X1 as well as the end of U1 by pins 25 and 26 are all over thedigital ground. The two grounds connect together at a single point in the middle of U1 on the bottom of the board.

    On the connections to J2 you make an excellent point. It is as you see, because this is the way Paul set up the Audio Adaptor board. This board tries to mimic the Adaptor to allow experimentation without to much change. So, question: Does anybody see a reason to not connect the two unconnected pins on J2 (line in/out) to AGND??

    Thanks for looking this over. Bob

Posting Permissions

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