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.

TLV320DAC3120: Minimum settings to get input I2S data to Class-D amp out

Part Number: TLV320DAC3120

Hi,

We are trying to set this chip up properly to communicate with our FPGA. We've got the I2C communication working between our FPGA and the TLV320DAC3120. We also can see on an oscilloscope that our I2S output signals are correct. We want the TLV320DAC3120 to be configured as a slave device so that BCLK and WCLK are inputs. MCLK is not connected to anything. 

I2S BCLK - 1.4112 MHz

 WCLK - 44.1 kHz

The registers we write to and their values are listed below.

PX_RX = Page number X followed by Register number X

P0_R0 = 0 ( default is page 0 but go to page 0 in case TLV320DAC3120 hasn't been powered down )

P0_R1 = 1 ( software reset )

Delay for at least 1 ms 

P0_R4 = 0x07 ( BCLK for PLL_CLKIN and PLL_CLK for CODEC_CLKIN

P0_R5 = 0x96 ( PLL is powered up, P = 1, R-VAL = 6 )

Delay for at least 10 ms

P0_R6 = 0x0A ( J-VAL = 10 )

P0_R7 = 0x00 ( D-VAL MSB = 0 )

P0_R8 = 0x00 ( D-VAL LSB = 0 )

P0_R11 = 0x85 ( NDAC_VAL = 5 and NDAC divider is powered up )

P0_R12 = 0x83 ( MDAC_VAL = 3 and MDAC divider is powered up )

P0_R13 = 0x00 ( DOSR MSB = 0 )

P0_R14 = 0x80 ( DOSR LSB = 128 )

P0_R25 = 0x03 ( CDIV_CLKIN = PLL_CLK ) 

P0_R26 = 0x81 ( CLKOUT divider M = 1 )

P0_R27 = 0x00 ( I2S, 16-bit word length, BCLK is input, WCLK is input )

P0_R51 = 0x10 ( GPIO1 output = CLKOUT output )

P0_R63 = 0x94 ( DAC is powered up, DAC data path = left data, Reserve bits, DAC channel volume control soft-stepping is enabled for one step per sample period )

P0_R64 = 0x04 ( DAC not muted )

P0_R65 = 0x00 ( DAC digital gain = 0 dB )

P0_R0 = 0x01 ( switch to page 1 )

P1_R32 = 0x86 ( Class-D output driver is powered up, Reserve bits )

P1_R35 = 0x40 ( DAC is routed to the mixer amp )

P1_R38 = 0x80 ( Analog vol control output is routed to class-D output driver, volume = 0 dB )

P1_R42 = 0x04 ( Gain = 6 dB, class-D driver is not muted )

P3_R16 = 0x08 ( internal osc is used, divided by 8 for ~1 MHz delay timer )

By these settings we should see the PLL_CLK on GPIO1 and all I see is the output is held high. If i route BCLK to GPIO1 and M = 1 then I'll see the clock coming out is exactly the same as BCLK coming in which is good. But for some reason it appears the PLL block doesn't get powered on. Even though in P0_R5 bit D7 = 1.

To further test this theory we connected BCLK to CODEC_CLKIN instead of PLL_CLK to see if we could generate DAC_CLK using NDAC and DAC_MOD_CLK using MDAC. So connecting DAC_CLK to GPIO1 we did see BCLK / NDAC as output so we know that NDAC is powered. Then we connected DAC_MOD_CLK to GPIO1 to test if MDAC is powered and we saw that the output clock was equal to BCLK/( NDAC * MDAC ) which is correct.

With BCLK still as the source of CODEC_CLK we tried sending some data just to see if we could get garbage on the output but we did not. 

There's probably just some setting I'm missing or something. Does anybody know what the missing piece is?

EDIT: For anyone with a similar issue make sure you have HPVDD and HPVSS even if you're not using headphone out. This is the reason why we couldn't get our PLL to work. 

  • Hi Adam,

    Did you write 0x01 into register 0x00 when you change to page 1? I don't see this command line but this could be implicit, just asking...
    Are you getting audio at the Class-D output? Is the audio coming out fine?

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators
  • Yes I missed that line when I wrote the original post. I see no output from the class-D. I also added writing to page 0 register 60 the value of 0x04 to use block PRB_P4. But that still didn't allow me to see any output.
  • This is odd, the register values you're setting should work fine.
    Do you have a way to read back the registers? Just to verify that the values are correct in the device.

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators
  • Yes, to make sure that I had the correct values for every single one of these registers I would read the value to see what it was. Then write to the register and read it back to make sure it took hold. What is most puzzling is that the PLL block doesn't seem to power on correctly. When I change the values such that PLL will be output on GPIO1 on the oscilloscope all I see is the line held high. An extremely similar situation happened to somebody else who made a post about this here.
    e2e.ti.com/.../540452

    From the master I'm sending it values from 0 to 0xFFFF over I2S for both left and right channels to try to produce a sawtooth wave. What i see at the output is just a flat line at 0 volts.

    Can I send you our schematic? Maybe you'll see something wrong with how we hooked it up.
  • Adam,

    You can send me the schematic through a message or you can email me at: ivan.salazar@ti.com

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators
  • Just wanted to add one comment. Could you please try to move the following commands after all the PLL values are written?:
    P0_R5 = 0x96 ( PLL is powered up, P = 1, R-VAL = 6 )
    Delay for at least 10 ms

    This shouldn't affect the PLL initialization but just want to see if this could possibly solve the issue.

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators