Update - realized I was mixed up about TDM in and out object pins. But still not getting the correct output.
I'm trying to get the AK4619 codec working via TDM with a 4.1 but with no luck so far. Right now I'm trying to determine if it's the hardware as it's hand soldered to a breakout board, the i2c setup, or something else.
I have the device hook up as descried in the TDM object(s!) on the tool.
I'm seeing the correct clocks on 23,21, and 20 and data on 7.
I'm trying to get the AK4619 codec working via TDM with a 4.1 but with no luck so far. Right now I'm trying to determine if it's the hardware as it's hand soldered to a breakout board, the i2c setup, or something else.
I have the device hook up as descried in the TDM object(s!) on the tool.
I'm seeing the correct clocks on 23,21, and 20 and data on 7.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform2; //xy=371.46665954589844,254.46665954589844
AudioSynthWaveform waveform1; //xy=409.46665954589844,214.46665954589844
AudioOutputTDM tdm2; //xy=609.4667911529541,345.4666748046875
AudioConnection patchCord1(waveform2, 0, tdm2, 1);
AudioConnection patchCord2(waveform1, 0, tdm2, 0);
AudioConnection patchCord3(waveform2, 0, tdm2, 2);
AudioConnection patchCord4(waveform1, 0, tdm2, 3);
// GUItool: end automatically generated code
unsigned long current_time;
unsigned long prev_time[8];
byte br[40];
void setup() {
AudioNoInterrupts();
delay(500);
AK2619_start();
AudioMemory(100);
waveform1.begin(1, 220, WAVEFORM_SINE);
waveform2.begin(1, 440, WAVEFORM_SINE);
AudioInterrupts();
}
void loop() {
current_time = millis();
if (current_time - prev_time[0] > 500 && 0) {
prev_time[0] = current_time;
Serial.print(AudioProcessorUsageMax());
Serial.print(" ");
Serial.print(AudioMemoryUsageMax());
Serial.println();
AudioProcessorUsageMaxReset();
AudioMemoryUsageMaxReset();
}
}
void AK2619_start() {
Wire.begin();
Wire.beginTransmission(0x11);
Wire.write(0);
Wire.write(B00110111); //turn all on
Wire.endTransmission();
Wire.beginTransmission(0x11);
Wire.write(1);
Wire.write(B11111100); //tdm
Wire.endTransmission();
Wire.beginTransmission(0x11);
Wire.write(2);
Wire.write(B00011100); //tdm
Wire.endTransmission();
Wire.beginTransmission(0x11);
Wire.write(0);
Wire.endTransmission();
Wire.beginTransmission(0x11);
Wire.requestFrom(0x11, 4);
br[0] = Wire.read();
br[1] = Wire.read();
br[2] = Wire.read();
br[3] = Wire.read();
Wire.endTransmission();
for (byte j = 0; j < 4; j++) {
Serial.println(br[j], BIN);
}
}
Attachments
Last edited: