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

Thread: Can someone give me a ideal?

  1. #1
    Junior Member
    Join Date
    May 2018

    Can someone give me a ideal?


    I'm setting up an open music labs audio board (WM8731) with a T3.6

    Assuming the audio library uses I2S (WM8731 as slave) & I2C0 I have connected to the default pins for both.

    I2S: SCK 9, RX 13, TX 22
    I2C: SDA0 18, SCL0 19
    Pullups: 1.2k to 3.3V rail

    I2S buffer chip PSU pin (nominally +5V) connected to 3.3V rail, as T3.6 I/O is 3.3V

    Teensyduino 1.31-beta.

    In the code below, the loop() has a simple instruction to set the right line input to 0x05 - this is simply to give me something to watch on the CRO and logic analyser.

    The issue:

    The I2C runs fine up until I uncomment the "AudioOutputI2S i2ss1; " line, which I assume starts up the I2S interface.

    Click image for larger version.

    Name: good.gif
    Views: 22
    Size: 5.6 KB
    ID: 8618

    At this point, the WM8731 ceases to respond to Wire commands (SDA stays high for ACK).

    Click image for larger version.

    Name: bad.gif
    Views: 17
    Size: 4.0 KB
    ID: 8619

    BTW both these tests remain the same whether the I2S pins (9, 13, 22) are connected or disconnected from the WM8731.

    Any clues?


    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #define WM_ADDR 0x1a // WM8731
    #define WM_RLI 0x07 // Right Line IN register
    AudioControlWM8731 wm8731_1; //xy=576,536
    AudioSynthWaveform waveform1; //xy=489,466
    AudioOutputI2S i2ss1; //xy=677,459
    AudioConnection patchCord1(waveform1, 0, i2ss1, 0);
    AudioConnection patchCord2(waveform1, 0, i2ss1, 1);
    int wireclock;
    void setup() {
    while (!Serial)
    Serial.println("Hello world");
    void loop() {
    Wire.beginTransmission(WM_ADDR);// Right Line IN
    Wire.write(0x05); // simple pattern sets line in gain to something small
    Last edited by defragster; 05-20-2018 at 07:59 AM. Reason: added code tags [CODE] //code here [/CODE]

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Hi Richard, Inserted images not showing? Code tags added to post #1. Using the '#' hashtag on the posting bar aids readability to show code spacing - also doing a Ctrl+T format in the IDE helps give uniform formatting as well.

    It says TeensyDuino version 1.31 - Version 1.42 is currently in Beta - not sure it has any needed features or fixes - but TD 1.41 or the TD 1.42 Beta 5 install would likely be a better starting point.

    I see the loop() code is paused only by delay(1) - is that code that should run up to 1,000 times per second?

    Is the WM8731 a supported device with a common interface/

  3. #3
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Colmar, France
    I see absolutely no sense in re-sending the same data again and again over I2C in the loop. This part should go into setup to be run once instead of flooding the WM8371 with the same commands over and over...

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Quote Originally Posted by scullsold View Post
    Teensyduino 1.31-beta.
    Wow, that's ancient!

    I very recently made some improvements to the WM8731 support. They're in 1.42-beta5.

    I also updated the example program and tested it with a Micro Elektronika 506 board.

    When you have 1.42-beta5, open the example from File > Examples > Audio > HardwareTesting > WM8731MikroSine. The latest example to simultaneous input (rms analysis) and output (sine wave) and it is known to work with that MicroE 506 board using the connections documented in the comments.

Posting Permissions

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