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.

TAS2505: Noisy playback of sine wave

Part Number: TAS2505

Hi TI,

I am using the TAS2505 as an amp and speaker driver which is fed with an I2S signal. The input is a sine wave (800Hz), which I have confirmed with a logic analyser is being sent properly over I2S (16kHz sample rate, 16-bit 2's complement, MSB first, and the first bit of each sample is sent on the *second* rising BCLK edge after a WCLK transition just like in the timing diagram here https://en.wikipedia.org/wiki/I%C2%B2S). The output is a 4Ω 2W speaker and HP output is disabled (N/C).

When I play the audio, it sounds very noisy and scratchy. I am trying to clean up the audio so the playback is clear and crisp.

I was expecting to see the same sine wave on the speaker pin outputs with an oscilloscope, but instead I see a square wave of sorts with what appears to be ringing at each level. I get a similar signal if I use a sawtooth wave over I2S. I'm somewhat new to audio processing, so I could be interpreting it incorrectly. Is this an expected signal, or indicative of a failure?

My register settings are as follows:

enum page0_registers {
    PAGE_SEL = 0x00,
    P0_SW_RESET = 0x01,
    P0_CLOCK_CTRL1 = 0x04,
    P0_CLOCK_CTRL2 = 0x05,
    P0_CLOCK_CTRL3 = 0x06,
    P0_CLOCK_CTRL4 = 0x07,
    P0_CLOCK_CTRL5 = 0x08,
    P0_CLOCK_CTRL6 = 0x0b,
    P0_CLOCK_CTRL7 = 0x0c,
    P0_DAC_DOSR_MSB = 0x0d,
    P0_DAC_DOSR_LSB = 0x0e,
    P0_CLOCK_CTRL10 = 0x19,
    P0_CODEC_IFACE_CTRL1 = 0x1b,
    P0_CODEC_IFACE_CTRL2 = 0x1c,
    P0_MISO_CTRL = 0x37,
    P0_SCLK_CTRL = 0x38,
    P0_DAC_PROC_BLK = 0x3c,
    P0_DAC_CHAN_CTRL1 = 0x3f,
    P0_DAC_CHAN_CTRL2 = 0x40,
    P0_DAC_VOL_CTRL = 0x41,
};

enum page1_registers {
    //0: page control
    P1_REF_CTRL = 0x01,
    P1_LDO_CTRL = 0x02,
    P1_PLAY_CTRL = 0x03,
    P1_COMMON_CTRL = 0x0a,
    P1_SPK_AMP_VOL_CTRL1 = 0x2d,
    P1_SPK_VOL_CTRL1 = 0x2e,
    P1_SPK_AMP_VOL_CTRL2 = 0x30,
    P1_RESERVED_52 = 0x52,
};

// Playback settings for the Class-D amp
// Page switch to Page 0
WREG(PAGE_SEL, 0x00);
// Assert Software reset
WREG(P0_SW_RESET, 0x01);

// Page Switch to Page 1
WREG(PAGE_SEL, 0x01);
// LDO output programmed as 1.8V and Level shifters powered up.
WREG(P1_LDO_CTRL, 0x00);

// Page switch to Page 0
WREG(PAGE_SEL, 0x00);
// DAC Instruction programming PRB #1
WREG(P0_DAC_PROC_BLK, 0x01);
// CODEC_CLKIN=PLL. PLL=BCLK
WREG(P0_CLOCK_CTRL1, 0x07);
// PLL ON: P=1, R=4
WREG(P0_CLOCK_CTRL2, 0x94);
WREG(P0_CLOCK_CTRL3, 0x27); //PLL J value
WREG(P0_CLOCK_CTRL4, 0x00); //PLL D MSB value
WREG(P0_CLOCK_CTRL5, 0x00); //PLL D LSB value
// CDIV_CLKIN=BCLK
WREG(P0_CLOCK_CTRL10, 0x01);
vTaskDelay(pdMS_TO_TICKS(10)); //delay 10ms for PLL to stabilise (app ref s3.2.3)
// Codec Interface control Word length = 16bits. BCLK&WCLK inputs. I2S mode.
WREG(P0_CODEC_IFACE_CTRL1, 0x00);
// Data slot offset 00
WREG(P0_CODEC_IFACE_CTRL2, 0x00);
// DAC NDAC Powered up, NDAC=1
WREG(P0_CLOCK_CTRL6, 0x81);
// DAC MDAC Powered up, MDAC=2
WREG(P0_CLOCK_CTRL7, 0x82);
// DAC OSR(9:0)-> DOSR=16
WREG(P0_DAC_DOSR_MSB, 0x00);
WREG(P0_DAC_DOSR_LSB, 0x10);
// Disable MISO pin
WREG(P0_MISO_CTRL, 0x00);
// Disable SCLK pin
WREG(P0_SCLK_CTRL, 0x00);
// Only LDAC powered up. Dac path setup LDAC data Mono of LDAC and RDAC. RDAC data disabled. Soft step 1 per Fs.
WREG(P0_DAC_CHAN_CTRL1, 0xb0);
// DAC volume for Left channel not muted. Right DAC muted.
WREG(P0_DAC_CHAN_CTRL2, 0x04);
// LDAC digital gain 0dB
WREG(P0_DAC_VOL_CTRL, 0x00);

// Page Switch to Page 1
WREG(PAGE_SEL, 0x01);
// Master Reference Powered off
WREG(P1_REF_CTRL, 0x00);
// Output common mode for DAC set to 0.9V (default)
WREG(P1_COMMON_CTRL, 0x00);
// LDAC AFIR is 6th order FIR filter and Powered up.
WREG(P1_PLAY_CTRL, 0x00);
// SPKL attn. Gain=0dB
WREG(P1_SPK_VOL_CTRL1, 0x00);
// SPKL driver PGA Gain=6.0dB
WREG(P1_SPK_AMP_VOL_CTRL2, 0x10);
// SPK OSCP enabled, OCP Degltich=4, OTP enabled, OTP Deglitch=5
WREG(P1_RESERVED_52, 0x00);
// SPK powered up
WREG(P1_SPK_AMP_VOL_CTRL1, 0x02);

Are these register settings correct for the input I2S data that I am supplying?

Thanks in advance, any help will be appreciated.

Matt.

  • Hi, Matt,

    Welcome to E2E and thank you for your interest in our products!

    Could you share the TAS2505 schematic portion?

    Do you have details about the BCLK frequency you are using?

    Could you use a Class-D filter ( https://www.ti.com/lit/an/sloa107/sloa107.pdf ) in order to take the output measurement with the scope? The TAS2505 has some high frequency noise due to the delta sigma modulator. This noise cannot be heard but it affects the captures and measurements with the scope. So, it is necessary to filter it. The Class-D filter could give us a better approach to this case.

    Could you try sending a constant value like 0x7FFF or 0x8000 through the I2S interface? Could you take a capture of this in order to see if the data is sent correctly?

    Thank you.

    Best regards,
    Luis Fernando Rodríguez S.

  • Thanks Luis!

    The BCK rate is 512kHz. I don't have access to a class-D filter, but I will try to source the components and build one.

    Yes, I can share the TAS2505 portion of the schematic:

    I was also able to send I2S data as a flat line (in this case at 0x7fff). This is the scope capture (without filter):

    Even though that scope capture shows the square wave still being present, when I sent 0x7fff as the I2S data the speaker remained silent (but with a very small amount of crackling). So it looks like I either need the filter, or I have connected the scope wrongly (for these captures, the scope GND = PSU GND and scope lead = speaker output +).

    Thanks,

    Matt.

  • Hi, Matt,

    I just noticed that the DOSR value is 16 in your registers configuration. We actually recommend to use 128 for the best performance.

    Could you try with the settings below? Could you also try with and without the output LC filter?

    P = 1
    R = 3
    J = 56
    D = 0
    NDAC = 3
    MDAC = 14
    DOSR = 128

    Best regards,
    Luis Fernando Rodríguez S.

  • Thanks Luis, you've been very helpful! It turns out that changing those register settings were the key. I'm glad it turned out to be something simple :)

  • Hi, Matt,

    I'm glad to read it. Please feel free to start a new e2e thread in case you have additional questions or comments.

    Best regards,
    Luis Fernando Rodríguez S.