Problem with PCM5102A

tref

Member
I’m working on an 8-channel audio project with Teensy 4.1 and four PCM5102A DACs using I²S. At first, the DACs weren’t producing any sound even though the wiring was correct. After troubleshooting, I found that grounding the SCK (MCLK) pin made them work. It looks like the DACs were expecting an external master clock, but when SCK was grounded, they switched to Auto-Clock Mode and used just BCLK and LRCLK from the Teensy.
It worked for a while, but suddenly it stopped working. When I was testing, it just stopped working completely. Now, I’m trying to figure out why. I’m planning to use I2S_OCT and wondering if it will work with this DAC board.





IMG_0770.jpeg
 
This is the schematic of Micro Dexed Touch Synthesizer. It also uses a PCM5102 DAC on Teensy 4.1.
Info: Vin on the PCM5102 DAC is not 3.3V but must be +5V.

Screenshot 2025-03-08 101508.png
 
Grounding the MCLK pin by shorting the solder pads next to that pin to force internal clock generation is how MIcroDexed uses this module in their system which works quite well, so I don't think that would be a factor in why it stopped working.

It is probably worth trying a new PCM5102 module as it may have just been a random failure. I haven't used this module myself, so can't offer suggestions on how to drive it.
 
Grounding the MCLK pin by shorting the solder pads next to that pin to force internal clock generation is how MIcroDexed uses this module in their system which works quite well, so I don't think that would be a factor in why it stopped working.

It is probably worth trying a new PCM5102 module as it may have just been a random failure. I haven't used this module myself, so can't offer suggestions on how to drive it.
It started working suddenly, but still the quality of audio is so bad idk what the reason or where I start.
 
It started working suddenly, but still the quality of audio is so bad idk what the reason or where I start.
Could you show us a photo of your setup and wiring? These I2S signals are pretty fast; BCLK is running at 2.824 MHz.
So far you did not share your code for us to look at - can you show a minimal sketch which generates the bad audio?

Paul
 
Could you show us a photo of your setup and wiring?
#include <Audio.h>


AudioInputUSB usb1;
AudioOutputI2SOct i2s_oct1;
AudioAmplifier amp1;
AudioAmplifier amp2;
AudioAmplifier amp3;
AudioAmplifier amp4;
AudioAmplifier amp5;
AudioAmplifier amp6;
AudioAmplifier amp7;
AudioAmplifier amp8;


AudioConnection patchCord1(usb1, 0, amp1, 0);
AudioConnection patchCord2(usb1, 0, amp2, 0);
AudioConnection patchCord3(usb1, 0, amp3, 0);
AudioConnection patchCord4(usb1, 0, amp4, 0);
AudioConnection patchCord5(usb1, 1, amp5, 0);
AudioConnection patchCord6(usb1, 1, amp6, 0);
AudioConnection patchCord7(usb1, 1, amp7, 0);
AudioConnection patchCord8(usb1, 1, amp8, 0);


AudioConnection patchCord9 (amp1, 0, i2s_oct1, 0);
AudioConnection patchCord10(amp2, 0, i2s_oct1, 1);
AudioConnection patchCord11(amp3, 0, i2s_oct1, 2);
AudioConnection patchCord12(amp4, 0, i2s_oct1, 3);
AudioConnection patchCord13(amp5, 0, i2s_oct1, 4);
AudioConnection patchCord14(amp6, 0, i2s_oct1, 5);
AudioConnection patchCord15(amp7, 0, i2s_oct1, 6);
AudioConnection patchCord16(amp8, 0, i2s_oct1, 7);

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
AudioMemory(4);
}

void loop()
{
float vol = usb1.volume(); // Read PC volume setting
amp1.gain(vol);
amp2.gain(vol);
amp3.gain(vol);
amp4.gain(vol);
amp5.gain(vol);
amp6.gain(vol);
amp7.gain(vol);
amp8.gain(vol);

delay(100);
digitalWrite(LED_BUILTIN, HIGH);
}
IMG_4138.jpeg

The wiring as documentation from the GUI for i2s_oct but not using the master clock, SCK at the DAC connected at the ground
 
Thanks for the photo and your code.
1. please increase the number of audio buffers to 30 like so:
C++:
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  AudioMemory(30);
}
2. is the Teensy 4.1 GND connected to the GND of the rest of your circuit? Can't really tell from the photo.

Paul
 
Last edited:
Please do so! Otherwise the Teensy signals are floating with respect to the other circuitry.

Paul
Thank you a lot, everything works fine.
Just i have one question what would be better connecting MSCK at the DACs or connecting The SCK at gnd I’m planning to implement beamforming with the eight speakers.
 
Just i have one question what would be better connecting MSCK at the DACs or connecting The SCK at gnd I’m planning to implement beamforming with the eight speakers.
Happy to hear it's working fine now.
Just connect SCK to GND at each DAC board. I have always used PCM5102A's in that configuration without any problems.
Distributing the 11.29 MHz MCK signal from Teensy to all 8 DAC boards may introduce other problems.

Paul
 
Back
Top