Other Parts Discussed in Thread: TAS2110
Tool/software:
Hello,
I am trying to play a .wav file using an STM32U5 microcontroller with the TAS2110EVM amplifier board, but I am only getting noise or corrupted audio output.
Hardware Setup:
-
STM32U5 MCU (using SAI peripheral for I²S audio)
-
TAS2110EVM board
-
External 5V / 3A power supply for TAS2110EVM
-
Connected pins:
-
FSYNC, SCLK (SBCK), SDIN → to TAS2110 for I²S
-
SDA, SCL → I²C control interface
-
-
External speaker connected to TAS2110EVM
-
Checked SDZ pin → voltage is 1.8V (so device seems enabled)
Issue:
-
WAV parsing works fine.
-
TAS2110 initialization (via I²C) is successful.
-
Playback via
HAL_SAI_Transmit_DMA()
produces only noise/corrupted audio instead of the WAV file.
SAI Configuration:
hsai_BlockA1.Instance = SAI1_Block_A;
hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX;
hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS;
hsai_BlockA1.Init.Protocol = SAI_FREE_PROTOCOL;
hsai_BlockA1.Init.DataSize = SAI_DATASIZE_16;
hsai_BlockA1.Init.FirstBit = SAI_FIRSTBIT_MSB;
hsai_BlockA1.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE;
hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE;
hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;
hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_44K;
hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE;
hsai_BlockA1.Init.MckOutput = SAI_MCK_OUTPUT_DISABLE;
hsai_BlockA1.Init.MonoStereoMode = SAI_MONOMODE;
hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING;
hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED;
Example code:
if (tas2110_init(&tas_data) != 0) {
HAL_UART_Transmit(&huart1, (uint8_t*)"TAS2110 Init Failed\n", 20, 100);
Error_Handler();
}
tas2110_set_samplerate(&tas_data, wav_info.sample_rate);
tas2110_set_bitwidth(&tas_data, wav_info.bits_per_sample);
tas2110_set_dai_fmt(&tas_data, 0x0020);
tas2110_set_dai_tdm_slot(&tas_data, 1, 0, 1, wav_info.bits_per_sample);
tas2110_set_volume(&tas_data, 84);
TAS2110_ReadDVC(&tas_data);
tas2110_power_on(&tas_data);
tas2110_mute(&tas_data, false);
// Test tone
for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
audio_buffer[i] = (int16_t)(3276 * sinf(2 * M_PI * 1000 * i / 44100.0f)); // Low amplitude
}
HAL_SAI_Transmit_DMA(&hsai_BlockA1, (uint8_t*)audio_buffer, AUDIO_BUFFER_SIZE);
Question:
-
Is there any specific I²S format requirement for TAS2110 (e.g., word length / frame sync polarity / slot config)?
-
Do I need to use MCLK along with BCLK/LRCLK/SDIN, or can TAS2110 derive clock internally?
-
Could this be related to mono vs stereo configuration?
Any guidance on correct I²S + TAS2110 configuration or pointers to a working reference would be very helpful.
Thanks in advance!