I2S ADC Input Data Troubleshooting

domingo

Well-known member
Hi all,,

How can I know if the Teensy (4.0) is effectively receiving I2S data from an ADC?

I made a PCB where all connections from the Teensy to an AK5381 ADC are made: MCLK(pin23), LRCLK(20), BCLK(21) and DATAIN (pin8). I measured all signals with an oscilloscope and all of them seem consistent to me (first time I use one). Below a screenshot of a reading on pin8.

Screenshot from 2022-12-22 12-42-16.jpg

When I shutdown the ADC (PDN pin LOW), pin8 stops transmitting square waves, so it seems that the ADC is working as it should.

But the Teensy outputs no audio on all DAWs I've tried. The following code is being used (USB output).

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioInputI2S            i2s2;          
AudioOutputUSB           usb1;        
AudioConnection          patchCord1(i2s2, 0, usb1, 0);
AudioConnection          patchCord2(i2s2, 1, usb1, 1);

const int pdnADC = 22;

void setup() {
  AudioMemory(10);

  pinMode(pdnADC, OUTPUT);

  digitalWrite(pdnADC, HIGH);    // set the PDN on
  delay(2000);               // wait for 2 seconds
  digitalWrite(pdnADC, LOW);     // set PDN off
  delay(2000);               // wait for 2 seconds
  digitalWrite(pdnADC, HIGH);    // set the PDN on  
}

void loop() {
}

I also tried setting the Teensy to output to a DAC from a USB source and it works fine. But sourcing the DAC from an ADC also doesn't work.

Any ideas on how could I troubleshoot this problem? Maybe a code that monitors the readings on pin8 would give a sign?
 
Back
Top