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

Thread: Audio WM8731 T3.6: I2S breaks I2C?

  1. #1
    Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    58

    Audio WM8731 T3.6: I2S breaks I2C?

    Hi,

    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:	54 
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:	38 
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?

    Richard
    --------------------------------------------------------

    #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() {
    Serial.begin(38400);
    while (!Serial)
    ;
    Serial.println("Hello world");

    wm8731_1.enable();
    wm8731_1.volume(0.9);
    wm8731_1.inputLevel(0.9);

    AudioMemory(15);

    waveform1.begin(WAVEFORM_SINE);
    waveform1.frequency(440);
    waveform1.amplitude(0.9);
    }

    void loop() {

    Wire.beginTransmission(WM_ADDR);// Right Line IN
    Wire.write(WM_RLI);
    Wire.write(0x05); // simple pattern sets line in gain to something small
    Wire.endTransmission();
    delay(1);

    }
    Last edited by palmerr; 10-26-2016 at 04:47 AM.

  2. #2
    Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    58
    To check my work, I ran the same code and connections up on a T3.2.

    It worked fine (including with the I2S and patchcord code enabled) on the T3.2 but not on the T3.6

    Subtle differences?

  3. #3
    Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    58
    Egg on face.

    I had jumpers that were still tied together in an IDC cable - parasitics were causing the issue.

    Mischief managed.

Posting Permissions

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