Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Audio issue with TAS5720A

  1. #1
    Junior Member
    Join Date
    Jun 2022
    Location
    Lyon, France
    Posts
    5

    Audio issue with TAS5720A

    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 :
    Click image for larger version. 

Name:	hard.jpg 
Views:	13 
Size:	60.5 KB 
ID:	28686

    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
    Click image for larger version. 

Name:	Capture d’écran du 2022-06-14 23-37-38.png 
Views:	4 
Size:	93.7 KB 
ID:	28687

    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
    Click image for larger version. 

Name:	Capture d’écran du 2022-06-14 23-40-10.png 
Views:	3 
Size:	101.2 KB 
ID:	28688

    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

  2. #2
    Senior Member
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    378
    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.

  3. #3
    Junior Member
    Join Date
    Jun 2022
    Location
    Lyon, France
    Posts
    5
    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.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,397
    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?

  5. #5
    Junior Member
    Join Date
    Jun 2022
    Location
    Lyon, France
    Posts
    5
    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.
    Click image for larger version. 

Name:	signal-2022-06-15-104049_001.jpg 
Views:	17 
Size:	110.4 KB 
ID:	28695

  6. #6
    Senior Member
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    378
    Quote Originally Posted by axoul View Post
    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.

  7. #7
    Junior Member
    Join Date
    Jun 2022
    Location
    Lyon, France
    Posts
    5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •