I'm having issues getting stereo sound in and out of the Mikro WM87311 board
This is based on the "WM8731mikrosine_codec" example
Left line in, left headphone out and left line out work. No right channels do.
I have wired the line ins and outs myself and am very sure of the connections.
This is based on the MikroSine example so I used AudioInputI2Sslave. I don't understand why this works since the WM8731 is in master mode on the Mikro board, right?
Doesn't this mean the moed are mixed?
How would you co about using this in master mode, just like the sgtl5000? The CLKOUT pin of the WM8731 going to pin 11 of the teensy? I tried that and just got static on both channels.
I've been using the sgtl5000 but would really like to get this one working as it can be DC-coupled.
Thanks!
This is based on the "WM8731mikrosine_codec" example
Code:
// Mikroe Teensy 3.1
// ------ ----------
// SCK 9
// MISO 13
// MOSI 22
// ADCL ??
// DACL 23
// SDA 18
// SCL 19
// 3.3V +3.3V
// GND GND
uint32_t prev0;
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioInputI2Sslave i2ss1; //xy=114,152
AudioSynthWaveform waveform1; //xy=127,271
AudioMixer4 mixer1; //xy=320,249
AudioOutputI2Sslave i2ss2; //xy=501,212
AudioConnection patchCord1(i2ss1, 0, mixer1, 0);
AudioConnection patchCord2(i2ss1, 1, mixer1, 1);
AudioConnection patchCord3(waveform1, 0, mixer1, 2);
AudioConnection patchCord4(mixer1, 0, i2ss2, 0);
AudioConnection patchCord5(mixer1, 0, i2ss2, 1);
AudioControlWM8731master wm8731m1; //xy=657,495
void setup() {
wm8731m1.enable();
wm8731m1.inputLevel(.8);
AudioMemory(15);
waveform1.begin(WAVEFORM_SINE);
waveform1.frequency(440);
waveform1.amplitude(1);
wm8731m1.volume(.8);
pinMode(2, INPUT_PULLUP);
}
void loop() {
byte d2 = digitalRead(2);
mixer1.gain(2, 0);
if (d2 == 0) {
mixer1.gain(0, 1);
mixer1.gain(1, 0);
}
if (d2 == 1) {
mixer1.gain(0, 0);
mixer1.gain(1, 1);
}
if ((millis() - prev0) > 250 && 1 == 1) {
prev0 = millis();
Serial.print(AudioProcessorUsageMax());
Serial.print(" ");
Serial.println(AudioMemoryUsageMax());
Serial.println();
AudioProcessorUsageMaxReset();
AudioMemoryUsageMaxReset();
}
}
Left line in, left headphone out and left line out work. No right channels do.
I have wired the line ins and outs myself and am very sure of the connections.
This is based on the MikroSine example so I used AudioInputI2Sslave. I don't understand why this works since the WM8731 is in master mode on the Mikro board, right?
Doesn't this mean the moed are mixed?
How would you co about using this in master mode, just like the sgtl5000? The CLKOUT pin of the WM8731 going to pin 11 of the teensy? I tried that and just got static on both channels.
I've been using the sgtl5000 but would really like to get this one working as it can be DC-coupled.
Thanks!