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 :
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
Audio Code :
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 :
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
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 :
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
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
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