Part Number: TAS5828M
Other Parts Discussed in Thread: PCM5102A
Tool/software:
Hi,
We are trying to integrate the TAS5828M with an ESP32-S3 using ESP-IDF's I2S library. Are there any reasons why this should not be possible?
We are having problems setting up the chip with I2C commands. Please see the sequence we are using.
0x00, 0x00 // Change Page
0x7F, 0x00 // Change Book
0x00, 0x00 // Change Page
0x01, 0x11 // Reset
< wait 100ms >
0x01, 0x00 // Relinquish Reset
< wait 100 ms >
0x03, 0x18 // DSP Reset + Mute + Deep Sleep
< wait 100 ms >
0x03, 0x02 // HiZ Mode
< wait 100 ms >
0x33, 0x00 // I2S format and 16 bit word size
0x35, 0x11 // L and R channels have their own data
0x4C, 0xFE // DIG_VOL setting
0x54, 0x1F // AGAIN setting
0x03, 0x03 // PLAY
The ESP IDF is configured for 48K sample rate, 16 bit word size. The expected BCLK is 1.536MHz, which is verified on an oscilloscope. LRCLK at 48KHz is also verified.
Please see the registers logged from the MCU below. The audio channels are registering over current and sending the chip into a fault state after several seconds of operation. We expect the value of register 0x38 to be 0x20 (32 decimal) to reflect our clock rate, but the chip seems to detect 0x40 (64 decimal).
E (6948) TAS5828M register 0x00 0x00 0
E (6948) TAS5828M register 0x01 0x00 0
E (6948) TAS5828M register 0x02 0x00 0
E (6948) TAS5828M register 0x03 0x03 3
E (6958) TAS5828M register 0x04 0x00 0
E (6968) TAS5828M register 0x05 0x44 68
E (6968) TAS5828M register 0x0F 0x00 0
E (6978) TAS5828M register 0x28 0x00 0
E (6988) TAS5828M register 0x29 0x7C 124
E (6988) TAS5828M register 0x30 0x00 0
E (6998) TAS5828M register 0x31 0x00 0
E (7008) TAS5828M register 0x33 0x00 0
E (7008) TAS5828M register 0x34 0x00 0
E (7018) TAS5828M register 0x35 0x11 17
E (7018) TAS5828M register 0x37 0x00 0
E (7028) TAS5828M register 0x38 0x40 64
E (7038) TAS5828M register 0x39 0x00 0
E (7038) TAS5828M register 0x40 0x01 1
E (7048) TAS5828M register 0x46 0x01 1
E (7058) TAS5828M register 0x4C 0xFE 254
E (7058) TAS5828M register 0x4E 0x33 51
E (7068) TAS5828M register 0x4F 0x30 48
E (7078) TAS5828M register 0x50 0x00 0
E (7078) TAS5828M register 0x51 0x55 85
E (7088) TAS5828M register 0x53 0x00 0
E (7088) TAS5828M register 0x54 0x1F 31
E (7098) TAS5828M register 0x5E 0x66 102
E (7108) TAS5828M register 0x60 0x00 0
E (7108) TAS5828M register 0x61 0x00 0
E (7118) TAS5828M register 0x62 0x00 0
E (7128) TAS5828M register 0x63 0x00 0
E (7128) TAS5828M register 0x64 0x00 0
E (7138) TAS5828M register 0x65 0x00 0
E (7148) TAS5828M register 0x66 0x00 0
E (7148) TAS5828M register 0x67 0x98 152
E (7158) TAS5828M register 0x68 0x01 1
E (7158) TAS5828M register 0x69 0x00 0
E (7168) TAS5828M register 0x6A 0x00 0
E (7178) TAS5828M register 0x6B 0x00 0
E (7178) TAS5828M register 0x6C 0x00 0
E (7188) TAS5828M register 0x6D 0xA0 160
E (7198) TAS5828M register 0x6E 0x11 17
E (7198) TAS5828M register 0x6F 0x24 36
E (7208) TAS5828M register 0x70 0x01 1
E (7218) TAS5828M register 0x71 0x00 0
E (7218) TAS5828M register 0x72 0x00 0
E (7228) TAS5828M register 0x73 0x01 1
E (7228) TAS5828M register 0x74 0x00 0
E (7238) TAS5828M register 0x75 0xF8 248
E (7248) TAS5828M register 0x76 0x00 0
E (7248) TAS5828M register 0x77 0x00 0
E (7258) TAS5828M register 0x78 0x00 0
Code:
#define SAMPLE_RATE 48000
i2s_chan_config_t tx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
ESP_ERROR_CHECK(i2s_new_channel(&tx_chan_cfg, &tx_chan, NULL));
i2s_std_config_t tx_std_cfg = {
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(SAMPLE_RATE),
.slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG(
I2S_DATA_BIT_WIDTH_16BIT,
I2S_SLOT_MODE_STEREO
),
.gpio_cfg = {
.mclk = STD_MCLK_IO1, // some codecs may require mclk signal, this example doesn't need it
.bclk = STD_BCLK_IO1,
.ws = STD_WS_IO1,
.dout = STD_DOUT_IO1,
.din = STD_DIN_IO1,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false,
},
},
};
tx_std_cfg.clk_cfg.clk_src = I2S_CLK_SRC_PLL_160M;
tx_std_cfg.clk_cfg.mclk_multiple = I2S_MCLK_MULTIPLE_1024;
tx_std_cfg.slot_cfg.slot_bit_width = I2S_SLOT_BIT_WIDTH_16BIT;
ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_chan, &tx_std_cfg));
ESP_ERROR_CHECK(i2s_channel_enable(tx_chan));




