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

Thread: Schematic review needed for Teensy4.1 + WM8731 audio codec

  1. #1
    Junior Member
    Join Date
    Feb 2021
    Posts
    15

    Schematic review needed for Teensy4.1 + WM8731 audio codec

    Hi !

    I’m designing a synth and I need some help for reviewing my schematic before starting the layout.

    The things I’m not really sure about are :

    Is the CODEC compatible ?

    I’m not using any inputs (neither MIC nor LINEIN), only line out and headphone out, but the “AudioOutputI2S” object does not shows the WM8731 as a compatible CODEC chip, but it does with the “AudioInputI2S”. I think there is no problem but... I ask anyway.

    Are my I2S connections OK ?

    Pin 1 (MCLK) CODEC > PIN 23 (MLCLK1) Teensy
    Pin 7 (BCLK) CODEC > PIN 21 (BCLK1) Teensy
    PIN 9 (DACLRC) & 11 (ADCLRC) CODEC > PIN 20 (LRCLK1) Teensy
    PIN 8 (DACDAT) CODEC > PIN 7 (RX2) Teensy
    Pin 10 (ADCDAT) CODEC >PIN 8 (TX2) Teensy

    I’m not using any audio inputs, so do I need to connect ADCLRC and ADCDAT ?

    Do I have to connect the analog inputs I’m not using to ground as I did ?

    About the 33R resistors

    I based my design on the “TGA Pro” from Blackaddr who is using 33R resistors on several lines, but I don’t really know why he did this. I know this codec is really sensitive to ringing so I thought it is to prevent this but I don’t really know. MIKROE did the same with 27R resistors, but the datasheet does not mention this at all.

    Last question, this one related to the layout

    For the first time I want to layout a 4 layers board, with ground plane and power plans as inner layers. But I don’t understand one thing : a rule is to place decoupling capacitors close from IC’s power pin, but if there is no trace between them but a power plan (with the cap connected to the plan through a via), will the current goes straight from the cap to the IC's power pin ? When I try to figure it out I don’t understand, physically, why the current will go straight from pin to pin and why it will not find another path through the power plane as soon as there is no concrete trace connecting the two pins. I know that current always find the shortest path but I don’t know… it is like all the power signals will be mixed in a kind of “clusterfuck”. Same question goes with other power lines, not only decoupling caps and IC’s power pin.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,791
    At the high frequencies involved in logic decoupling currents will find the shortest (more specifically lowest inductance) path very reliably - stray inductance will dominate the behaviour. You just need to ensure every IC power rail pin has a low inductance connection to its decoupling cap.

    This application note is perhaps useful: https://www.maximintegrated.com/en/d...ls/5/5450.html

  3. #3
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    249
    Quote Originally Posted by jowell88 View Post

    Is the CODEC compatible ?

    I’m not using any inputs (neither MIC nor LINEIN), only line out and headphone out, but the “AudioOutputI2S” object does not shows the WM8731 as a compatible CODEC chip, but it does with the “AudioInputI2S”. I think there is no problem but... I ask anyway.
    Yes, it is compatible with the AudioOutputI2S object

    Quote Originally Posted by jowell88 View Post

    Are my I2S connections OK ?

    Pin 1 (MCLK) CODEC > PIN 23 (MLCLK1) Teensy
    Pin 7 (BCLK) CODEC > PIN 21 (BCLK1) Teensy
    PIN 9 (DACLRC) & 11 (ADCLRC) CODEC > PIN 20 (LRCLK1) Teensy
    PIN 8 (DACDAT) CODEC > PIN 7 (RX2) Teensy
    Pin 10 (ADCDAT) CODEC >PIN 8 (TX2) Teensy
    They look fine

    Quote Originally Posted by jowell88 View Post
    I’m not using any audio inputs, so do I need to connect ADCLRC and ADCDAT ?
    I've alway connected them, can't imagine not connecting will be a problem but I've not tried that, perhaps someone with more experience and knowledge of I2S will answer or just connect them up.

    Quote Originally Posted by jowell88 View Post

    Do I have to connect the analog inputs I’m not using to ground as I did ?
    That is fine.

    Quote Originally Posted by jowell88 View Post

    About the 33R resistors
    I've always used R33s on these connections, not certain of purpose

    Cheers, Paul

  4. #4
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,791
    Small value series resistors damp ringing on high speed logic signals - a logic trace has inductance, a logic input
    has capacitance, which forms a resonant circuit unless some resistance damps this it tends to ring on every edge
    47 or 68 ohms is more commonly seen in my experience. These series resistances can also reduce EMI generation
    by slew-limiting the logic waveforms, and this in turn can mean less risk of cross-talk between neighbouring signal
    traces.

    Accurately diagnosing this on a board requires a high bandwidth 'scope and the correct probe tips (very low inductance).

    I've always used R33s on these connections
    R33 means 0.33 ohms, its 33R for 33 ohms. The use of k, R, M etc in this context is as a replacement for the decimal
    point.

    This convention is often used in printing on components as a silk-screened decimal point can easily get scratched off components
    as they are processed on the production line, whereas a whole letter is more likely to survive either intact or sufficiently
    present to disambiguate the value.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,694
    Quote Originally Posted by MarkT View Post
    R33 means 0.33 ohms, its 33R for 33 ohms. The use of k, R, M etc in this context is as a replacement for the decimal
    point.

    This convention is often used in printing on components as a silk-screened decimal point can easily get scratched off components
    as they are processed on the production line, whereas a whole letter is more likely to survive either intact or sufficiently
    present to disambiguate the value.
    This is indeed an old convention, but not everyone follows it, especially people casually writing comments on the internet.

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,791
    Indeed but they might like to get the right value resistors when they order them, and not realizing R33 != 33R puts them at
    risk of that

  7. #7
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    249
    Quote Originally Posted by MarkT View Post
    Indeed but they might like to get the right value resistors when they order them, and not realizing R33 != 33R puts them at
    risk of that
    my bad, 33R is the what i meant. cheers Paul

  8. #8
    Junior Member
    Join Date
    Feb 2021
    Posts
    15
    Quote Originally Posted by MarkT View Post
    Accurately diagnosing this on a board requires a high bandwidth 'scope and the correct probe tips (very low inductance).
    So my 30MHz Digilent Analog Discovery 2 USB oscilloscope is totally useless for this ? I wanted to try different resistor values by soldering and desoldering until I get a good trace (no ringing, no overshoot, no undershoot).

    Another question : I didn't connect CLKOUT as I will use the codec in slave mode. Is it OK ?

    Last question : Do I place the serie resistor near the CODEC, the Teensy, or it makes absolutely no difference ?

  9. #9
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,791
    Yes, 30MHz is no use for analyzing logic edges (which transition in a few nanoseconds). In fact most standard cheap 'scope probes aren't fast enough anyway and specialized probery is required.

  10. #10
    Junior Member
    Join Date
    Feb 2021
    Posts
    15
    Hey ! The board is working . I add some stuff to the original schematic.

    Now I have the codec, 24 pots + 1 for volume control, 1 rotary encoder for the menu, a ILI9341 display, line out and headphone, midi in, thru and out. The Teensy and the display are mounted on socket so it can be plug and unplugged.

    Every SMD were assembled by JLCPCB excepted for the LDO. When I did the BOM it was in stock, and was not anymore when the layout was finished and ready for production... so I bought it on Mouser and soldered it by hand.

    For now I tested the codec (line out and headphone), all the pots (there are 2 mux to manage them), the rotary encoder, the screen and touch and the midi in. I was so happy it all worked really good that I stopped the tests and started coding ^^. I still have to test midi thru and out and take some measurement. I put test points for bus lines and clocks. And I have to measure SNR. Also I made it compatible with Teensy 4.1 and 4.0 but I didn't test with the 4.0 yet.

    I will share the schematic and the layout files (EAGLE PCB) as soon as all the tests are done.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	20220515_012400.jpg 
Views:	43 
Size:	81.4 KB 
ID:	28373  

  11. #11
    Junior Member
    Join Date
    Oct 2016
    Posts
    3
    Hi @jowell88 how is your project going?
    I'm currently designing my own synth, and I'm curious on how your experience with the WM8731 audio codec is?
    And also wondering if you would like to share your latest schematics and layout files?

  12. #12
    Junior Member
    Join Date
    Feb 2021
    Posts
    15
    Quote Originally Posted by Cinezaster View Post
    Hi @jowell88 how is your project going?
    I'm currently designing my own synth, and I'm curious on how your experience with the WM8731 audio codec is?
    And also wondering if you would like to share your latest schematics and layout files?
    Hi,

    I've had no issues with the codec so I suppose the codec, schematic and layout are ok.

    For the files try this link

    For now I don't use the board I'm working on something else.

    Have you already started designing your synth or you are in the brainstorming phase ?

Posting Permissions

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