I2S DAC not working unless touched

Windorey

Active member
Hi! My only I2S DAC board I have available to purchase is a UDA1334 breakout by Adafruit, but it only works when I touch the pins of it, otherwise I just get noise. See the attached videos below.
 
Touching pins adds capacitance. Is that the BCLK you are touching? You can try adding a small series resistor, 22 to 50 ohms. Or try adding a small capacitor to ground, 22 to 100 pf. Or a resistor in parallel to ground may be needed to load the signal, try 1k to 5k to ground.
 
The SGTL5000 chip on the audio shield is sensitive to overshoot or ringing or other high speed effects on its MCLK pin. We never knew this until the Teensy 4 beta testing (in early 2019) because the older Teensy 3.x models don't have such high bandwidth in their digital signals as Teensy 4.0 and 4.1 do. Then it was discovered in hindsight that Teensy 3.6 had trouble if longer MCLK wire was used between the boards.

A 100 ohm series resistor was added to MCLK on the audio shields. You can see it on the schematics:

https://www.pjrc.com/store/teensy3_audio.html

Maybe try adding a similar series resistor on MCLK and even BCLK. Also best to keep the I2S wires short and physically close to the GND wire.
 
With some resistor experimentation (I only have 13K ones) I managed to get it almost working, but there is still some noise sometimes which touching the wires completely eliminates. Tomorrow I will go to the electronic parts store, can you give me values of what components I should buy?

 
In the video, looks like you wired the resistors from each signal to GND.

But the intention was to connect the resistor in series. The resistor connects to Teensy's pin, and then the other side of the resistor connects to the wire which goes to the DAC chip. Resistors between 33 ohms to 220 ohms are probably the right range. 13K is far too much.
 
You might also try adding a wire for MCLK to the SCLK pin on the UDA1334 DAC. Internally the UDA1334 needs to use a PLL because it doesn't get a system clock. That is exactly the purpose of MCLK. Maybe the PLL has trouble and connecting MCLK will help?
 
Is this related to your issue?

Paul

I guess it is related, but I don't seem to be having any issues with the mute pin on it.
Also, I noticed another thing, while using an SPI-TFT, the audio for some reason gets interrupted for a little (ILI9341). It is very short, but definitely noticeable, like when a CD skips a little every time the display is updated.
 
You might also try adding a wire for MCLK to the SCLK pin on the UDA1334 DAC. Internally the UDA1334 needs to use a PLL because it doesn't get a system clock. That is exactly the purpose of MCLK. Maybe the PLL has trouble and connecting MCLK will help?

I connected everything for I2S2. It works better if I leave the MCLK pin disconnected for some reason. When I connect MCLK to SCLK on the DAC, I only get noise no matter what I do. Leaving it disconnected works better, maybe there is something needed to configure the DAC so it needs a MCLK instead of generating it via PLL?
 
There should be no need to configure the DAC - the board should just work out of the box.
Since I've been using the board with a Teensy 3.2 succesfully, I hooked it up to a Teensy 4.1:

IMG_20230227_213143.jpg

This is the code:
Code:
// UDA1334 bd   Teensy 4.x
// VCC          Vin           5V
// GND          GND
// WSEL         20            LRCK 44.1 kHz
// DIN          7
// BCK          21            2.8224 MHz = 64.LRCK
// --           23            MCLK 11.29 MHz

#include <Audio.h>

AudioSynthWaveformSine   sine1;
AudioOutputI2S           i2s1;
AudioConnection          patchCord1(sine1, 0, i2s1, 0);
AudioConnection          patchCord2(sine1, 0, i2s1, 1);

void setup(){
  AudioMemory(2);
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);

  sine1.frequency(1000);
  sine1.amplitude(1.0);
}

void loop(){
}

And this is how it looks at the scope:

SDS00080.png

Not sure what's going on with your board/setup. Did you check your colored wires? I once had a wire that was broken but made intermittent contact...took me a long time to figure out the wire was the culprit.

Paul
 
Last edited:
Well, I did some changes and it "works" now, but I get issues running a display and the audio library at the same time.
Here is a video of my issue. The code is this.
 
Well, I did some changes and it "works" now
So the original issue ["I2S DAC not working unless touched"] is not an issue anymore?
Did you perhaps try the minimal code in my message #10?

Looking and listening to your video, it seems the display driver and audio library are fighting for priority.

Paul
 
Back
Top