This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TAS5828M: Problems integrating with ESP32 S3

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));

  • Hello,

    Can you send the scope shots of the LRCLK and the SCLK at the pins of the device?

    Regards,

    Ramsey

  • Thank you for your response Ramsey.

    Please find the clock shots attached.

  • Please note that I reduced the value of SAMPLE_RATE to 32KHz as I was testing with a lower clock rate. I am also attaching the clocks for 48KMhz sample rate for your reference.

  • hi,

    1.can you try to initialize the amp with this script?

    what you use seems are made by yourself manully.

    2.can you check before you flashing the script through i2c, has the i2s clk already be provided.

    just as the start up sequence list in DS.

    /cfs-file/__key/communityserver-discussions-components-files/6/tas5828_5F00_stereo_5F00_initialize_5F00_script.h

  • Hi Jesse,

    Thank you for sharing that. I can confirm that I2c is up and running, because these logs are created by the firmware, and it is able to issue write and read commands to TAS5828M. The values being written to the register are bring read back correctly.

    Unfortunately, the startup sequence from the file did not help. Please see the register values underneath:

    Register 0x38 shows a ratio of 64, but I believe it should show a ratio of 32 for 2x 16 bit words?
    Also, register 0x70 continues to report over current.

    Please advise.

    E (22488) TAS5828M register 0x00 0x00 0
    E (22488) TAS5828M register 0x01 0x00 0
    E (22488) TAS5828M register 0x02 0x40 64
    E (22498) TAS5828M register 0x03 0x03 3
    E (22498) TAS5828M register 0x04 0x01 1
    E (22508) TAS5828M register 0x05 0x44 68
    E (22518) TAS5828M register 0x0F 0x00 0
    E (22518) TAS5828M register 0x28 0x00 0
    E (22528) TAS5828M register 0x29 0x00 0
    E (22538) TAS5828M register 0x30 0x00 0
    E (22538) TAS5828M register 0x31 0x00 0
    E (22548) TAS5828M register 0x33 0x00 0
    E (22558) TAS5828M register 0x34 0x00 0
    E (22558) TAS5828M register 0x35 0x11 17
    E (22568) TAS5828M register 0x37 0x00 0
    E (22578) TAS5828M register 0x38 0x40 64
    E (22578) TAS5828M register 0x39 0x00 0
    E (22588) TAS5828M register 0x40 0x01 1
    E (22598) TAS5828M register 0x46 0x01 1
    E (22598) TAS5828M register 0x4C 0x30 48
    E (22608) TAS5828M register 0x4E 0x33 51
    E (22608) TAS5828M register 0x4F 0x30 48
    E (22618) TAS5828M register 0x50 0x00 0
    E (22628) TAS5828M register 0x51 0x55 85
    E (22628) TAS5828M register 0x53 0x61 97
    E (22638) TAS5828M register 0x54 0x00 0
    E (22648) TAS5828M register 0x5E 0x64 100
    E (22648) TAS5828M register 0x60 0x07 7
    E (22658) TAS5828M register 0x61 0x0D 13
    E (22668) TAS5828M register 0x62 0x09 9
    E (22668) TAS5828M register 0x63 0x0B 11
    E (22678) TAS5828M register 0x64 0x00 0
    E (22688) TAS5828M register 0x65 0x00 0
    E (22688) TAS5828M register 0x66 0x00 0
    E (22698) TAS5828M register 0x67 0x98 152
    E (22708) TAS5828M register 0x68 0x01 1
    E (22708) TAS5828M register 0x69 0x00 0
    E (22718) TAS5828M register 0x6A 0x00 0
    E (22718) TAS5828M register 0x6B 0x00 0
    E (22728) TAS5828M register 0x6C 0x00 0
    E (22738) TAS5828M register 0x6D 0xA0 160
    E (22738) TAS5828M register 0x6E 0x11 17
    E (22748) TAS5828M register 0x6F 0x24 36
    E (22758) TAS5828M register 0x70 0x01 1
    E (22758) TAS5828M register 0x71 0x00 0
    E (22768) TAS5828M register 0x72 0x00 0
    E (22778) TAS5828M register 0x73 0x00 0
    E (22778) TAS5828M register 0x74 0x00 0
    E (22788) TAS5828M register 0x75 0xF8 248
    E (22798) TAS5828M register 0x76 0x00 0
    E (22798) TAS5828M register 0x77 0x00 0
    E (22808) TAS5828M register 0x78 0x00 0

  • hi, 

    0x70 continues to report over current.

    -> this should be a sign for why you cannot start amp successfully.

    the board you use is our evm? or customer's designed board?

    if not using our evm, please share me your sch.

    thanks

    jesse

  • Hi Jesse, thanks for your review and response. Please see the attached schematic

  • hi,

    your circuit seems no problem. can you tell me your pvdd and load resistance?

    also, can you remove the inductor and check whether it can be initialize normally?

    have you tried other chips, is that possible this chip having any problem?

    thanks

    jesse

  • Hi Jesse,

    PVDD is 12V, and we are driving 2x 4ohm speakers, 20 watt rating. Because of the design of the circuit it is not possible to desolder the inductor. But we have tested without the speakers attached and have the same result. All boards of this schematic implementation have this issue. For reference, we are using 4.1 Amp 10 mH inductors.

    Please let me know how we can debug further.

    Thanks.

  • hi 

    with your condition, it is hard to have the OC happen.

    this is strange.

    have you observed your i2s signal, is it stable during start up?

    do you have our evm or Audio precision?

    you can jump your i2s to our evm to see whether it is configurable?

    OR, you can jump i2s from audio precision to make sure i2s stable to see whether the i2s in your board having problem.

    thanks

    jesse

  • Hi Jesse,

    We don't have the EVM or Audio Precision. I will check if we can get a hold of either of them. I can confirm that we have another circuit with a PCM5102A which we can operate with a similar circuit schematic, layout and firmware. I dont know if that provides any information about the I2S signal integrity. The I2S signal is derived from an ESP32 S3 WROOM 2 module.

    Do you feel the inductor is causing any issues? We have an upgraded board with a 7.1 Amp inductor in production to see if that fixes this issue. 

    In the meantime, please let us know if there any other improvements or debugging steps we can pursue.

    Thanks.

  • hi,

    base on your situation, let me summarize my analysis. maybe we have some miss.

    1.origianlly, as your code is very obviously different with how we dumped from ppc3, so i suspect your initialization code having problem. especially, we don't recommend manually config the i2s setting as we have auto detect in dsp, it will help make customer easy to use with our amp. manually change the setting always may miss some configuration. that's why i share you another script for initialization.

    2.as you read the register, find the oc happen during start-up.

    this is usually because your inductor isat not large enough as the startup current usually is large. this point you can check the "inductor selection" section in our DS for double confirming.

    but as your sch show you have 7.1A Isat inductor be used, this spec is good enough, also, your pvdd is not that large, so this seems also impossible.

    3.as you find the i2s seems having problem, but usually, if i2s clk having problem, the fault report register will report clk fault, you can check 0x70-73, except oc, no other fault be reported. so the clk fault seems haven't happen.

    but because your sch shows no obvious risk to let oc happen, so it maybe better to check the i2s to double confirm what kind of fault will happen.

    thanks

    jesse