Audio issue with TAS5720A

axoul

Member
Hi everyone,
I'm new in SAI with Teensy and I really need your help. I'm not asking you to go deep into the code or the hardware, just to get feedback from your experiences and insights.

Project :
Implement a TAS5720A digital amplifier with a Teensy 4.1.

Hardware :
hard.jpg

Connections :
SCL -> 19
SDA -> 18
/SPK_SD -> 16
/SPK_FAULT -> 17
MCLK -> 23
BCLK -> 21
LRCLK -> 20
SDIN -> 7 (OUT1A)
VDD = 24V

Configuration :
PlatformIO : 6.0.2
Framework Arduino

Start-up procedure
Capture d’écran du 2022-06-14 23-37-38.png

Audio Code :
Code:
#include <Arduino.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include "config.h"
#include "TAS5720.h"
#include <SerialFlash.h>

#include "audio.h"

AudioPlaySdWav playerSD;
AudioOutputI2S i2s1;
AudioConnection patchCord1(playerSD, 0, i2s1, 0);
AudioConnection patchCord2(playerSD, 1, i2s1, 1);

const char *filename = "SDTEST1.WAV";

TAS5720 *amp;

void audio_init() {
    AudioMemory(8);
    pinMode(SPK_SD_PIN, OUTPUT);
    pinMode(SPK_FAULT_PIN, INPUT);
    digitalWrite(SPK_SD_PIN, LOW);
    delay(100);
    Serial.println("Start I2S");
    i2s1.begin();
    Serial.println("Start SD");
    if (!SD.begin(BUILTIN_SDCARD)) {
        Serial.println("SD init failed!");
    }
    playerSD.begin();
    patchCord1.connect();
    patchCord2.connect();
    Serial.println("Connect");
    
    amp = new TAS5720(Wire, 0x6D, false);

    amp->mute(true);
    amp->setSerialAudioInterfaceFormat(SAI_I2S);
    amp->setChannelSelection(RIGHT);
    amp->setAnalogGain(GAIN_25_DBV);
    amp->setDigitalBoost(DIGITAL_BOOST_6DB);

    Serial.println("TAS ON");

    digitalWrite(SPK_SD_PIN, HIGH);
    amp->setShutdown(true);
    amp->mute(false);
    amp->setVolume(210, 210);
    amp->setShutdown(false);
    delay(100);
}

void audio_play() {
    amp->dumpRegisters();
    if (SD.exists(filename)) {
        if (playerSD.play(filename)) {
            Serial.println("Playing ...");
        } else {
            Serial.println("not playing");
        }
    } else {
        Serial.println("file not exist");
    }
}

Status :
I2C is working with the amp.
No errors in the registers or in the code are present nor the errors in the clocks that I have solved before (amplifier register).
Registers dump after initialize it and before playing song from uSD card :
Code:
TAS5720: Register 0 = 0
TAS5720: Register 1 = 11111101
TAS5720: Register 2 = 10100
TAS5720: Register 3 = 10000000
TAS5720: Register 4 = 11010010
TAS5720: Register 5 = 11010010
TAS5720: Register 6 = 11011001
TAS5720: Register 8 = 0
TAS5720: Register 10 = 11111111
TAS5720: Register 11 = 11111100

Capture d’écran du 2022-06-14 23-40-10.png

All seems to be alright but no sound !!
I have the impression that there is no audio data signal on OUT1A, is this possible?

I won't go into more detail. I hope with all my heart that you can help me!

Thank you very much in advance

Axoul
 
For sure, remove the call to i2s1.begin() - that’s a killer! You also don’t need to connect() the patch cords or begin() the SD wave player object, though I think those are harmless.

That should at least get you data on OUT1A, which I think should be in the correct format for your settings, but not 100% sure.
 
It works! The problem was simpler than I thought. Thanks for your help. If you want my hardware design around the TAS5720A, don't hesitate to ask me ! I will share with you a GitHub link to manage this IC.
 
Hope you'll share on github and give the link. I'm sure people using TAS5720A in months and years from now will find this thread by search.

I'm also curious how you physically connected this chip. Did you solder to the bottom side and thermally connect to a heatsink? Does it get hot if you run at higher power? Any chance you might share photos?
 
I will share the library link in the next few days on this post.
I soldered the underside of the component with a hotgun and solder paste to a ground plane with thermal vias. For the rest of the pins, it's manually soldered with a traditional iron.
signal-2022-06-15-104049_001.jpg
 
It works! The problem was simpler than I thought. Thanks for your help. If you want my hardware design around the TAS5720A, don't hesitate to ask me ! I will share with you a GitHub link to manage this IC.
Great! Simple solution, it's just knowing where to look... also it's brought to light an error in the Audio Shield documentation, which I can

It would be good if you could share your design on GitHub, I don't have a need myself right now but others might, and I might in the future. Thanks.
 
Hi how you configured below pins in arduino.

MCLK -> 23
BCLK -> 21
LRCLK -> 20
SDIN -> 7 (OUT1A)

Does arduino has I2S protocol?
 
Back
Top