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.

TAD5112: Example programming steps to get TAD5112 going in headphone mode

Part Number: TAD5112

Hi,

We're using the TAD5112 as a stereo DAC driving headphones. Audio is coming in as I2S via the serial interface.

Do you have example programming "code" or steps to get the device up and running?.

thanks

  • Hi,

    I would recommend you use the PPC3 tool (https://www.ti.com/tool/PUREPATHCONSOLE) to get the device up and running, there is a "Load Preset" button in the top right corner of the GUI. The default HP DAC playback I2C script it uses is here:

    w a0 01 01 
    w a0 02 09 
    w a0 11 80 
    w a0 19 00 
    w a0 1a 30 
    w a0 26 01 
    w a0 28 20 
    w a0 29 21 
    w a0 2a 22 
    w a0 2b 23 
    w a0 64 24 
    w a0 65 60 
    w a0 66 60 
    w a0 6b 24 
    w a0 6c 60 
    w a0 6d 60 
    w a0 76 0f 
    w a0 78 40 
    r a0 7c 04

    You can also find an example line output script in the datasheet: 

    To make this into a HP driver script, you can change registers 0x65 and 0x66, and then 0x6c and 0x6d bits 6-7 to the headphone driver mode. To change to I2S mode instead of TDM, you can change register 0x1a.

    Let me know if you need more help.

    Best,
    Mir

  • Thanks Mir,

    >>You can also find an example line output script in the datasheet: 

    Is there a new version of the datasheet available that is not on the website or are you referring to a different parts datasheet other than the TAD5112?.  The March 2025 TAD5112 datasheet has no section 8.2.5?

    thanks

  • Hi, 

    You can find that section here, page 214:

    https://www.ti.com/lit/ds/symlink/tad5112.pdf

    -Mir

  • My bad!.  Thanks

  • What is the best/recommended way to way to power a pair of studio grade headphones?.  

    • Single ended mono on each channel ( output in headphone mode )?
    • Psuedo-differential output on each channel (output in headphone mode)?

    thanks

  • Hi Stephen,

    Either will likely work. Psuedo-differential is often used to avoid the AC coupling capacitors on the output, or if the ground reference would be noisier than the VREF internally generated reference voltage. You can read more about output modes for this device here: https://www.ti.com/lit/an/slaaee0a/slaaee0a.pdf 

    One benefit of single ended over pseudo differential mode is that this device can have 4 single ended outputs, while pseudo differential can only have two (stereo). You could drive two sets of single ended headphones at once, or have headphones on one stereo pair and line out on the other. 

    Let me know what else you need help with!

    Best,
    Mir

  • Hi Mir,

    If using Psuedo-diff, the datasheet says:

    Psuedo-differential Output Connection with External Common-Mode Sense (OUT1x_CFG[2:0] = 3'b101)

    What about OUT2x_CFG0?.  0b101 (5d) is marked as do no use.  so use 0b100 (4d)?

    i.e

            # OUT1 - DAC is source, Pseudo differential with OUT1M as VCOM and OUT2M for external sensing
            self.tad5112_write(TAD5112_REG.OUT1X_CFG0, 0b001_101_00)  
            self.tad5112_write(TAD5112_REG.OUT1X_CFG1, 0b01_100_000) # OUT1P Headphone drive, 0dB gain.
            self.tad5112_write(TAD5112_REG.OUT1X_CFG2, 0b01_100_000) # OUT1M Headphone drive.
            # OUT2 - DAC is source, Pseudo differential with OUT2M as VCOM
            self.tad5112_write(TAD5112_REG.OUT2X_CFG0, 0b001_100_00) 
            self.tad5112_write(TAD5112_REG.OUT2X_CFG1, 0b01_100_000) # OUT2P Headphone drive, 0dB gain.
            self.tad5112_write(TAD5112_REG.OUT2X_CFG2, 0b01_100_000) # OUT2M Headphone drive.

  • Hi Stephen,

    I think the best option here would be to set OUT2x_CFG to 4d, since OUT2P needs to be set to an output. I am not sure where the common mode sense is used internal to the device, I cannot find more reference to it. I will ask the systems team to verify where the common mode sense is used. However, the setting I suggest will still work for pseudo differential case and if both OUT1M and OUT2M are connected as VCOM there will still only be 1 reference so the headphones should work as expected.

    Best,
    Mir

  • OK thanks will do (set OUT2x_CFG to 4d)

    One last question.  How do I make program the DAC left/right to use the 1st two slots of my 8slot/channel TDM (I8S) stream?.  2nd two slots?

    thanks

  • Hi,

    I believe these should be by default using the first 2 slots. The slots are specified with registers PASI_TX_CHx_CFG with CHx being CH1, CH2, etc. This starts in register 0x1e of page 0.

    Best,
    Mir

  • I have the TAD5112 working.  Here is my current code in python for anyone that may find it useful.

    class TAD5112_REG:
        PAGE_CFG       = 0x00
        SW_RESET        = 0x01
        DEV_MISC_CFG    = 0x02
        PASI_CFG0       = 0x1A
        PASI_RX_CH1_CFG = 0x28
        PASI_RX_CH2_CFG = 0x29
        OUT1X_CFG0     = 0x64
        OUT1X_CFG1     = 0x65
        OUT1X_CFG2     = 0x66
        DAC_CH1A_CFG0  = 0x67
        DAC_CH2A_CFG0  = 0x6E
        OUT2X_CFG0     = 0x6B
        OUT2X_CFG1     = 0x6C
        OUT2X_CFG2     = 0x6D
        CH_EN          = 0x76
        PWR_CFG        = 0x78



    class TAD5112_DAC(object):

        def __init__(self, i2c_bus, i2c_addr):
            self.bus = i2c_bus
            self.addr = i2c_addr
            self.get_reg_msgs = i2c_bus.alloc_msg(b'\x00', is_read=False, i2c_addr=i2c_addr), i2c_bus.alloc_msg(1, i2c_addr=i2c_addr)
            self.set_reg_msg = i2c_bus.alloc_msg(b'\x00\x00', is_read=False, i2c_addr=i2c_addr)

        def configure(self):
            self.tad5112_write(TAD5112_REG.PAGE_CFG, 0x00)  # select page 0
            self.tad5112_write(TAD5112_REG.SW_RESET, 0x01)  # s/w reset
            time.sleep(0.01) #10ms
            self.tad5112_write(TAD5112_REG.DEV_MISC_CFG, 0x09)  # exit sleep mode
            time.sleep(0.01) # 10ms - allow device to wake up
            self.tad5112_write(TAD5112_REG.PASI_CFG0, 0b00110100)  # TDM, 32bits, BCLK inverted=AKM, Cirrus

            # OUT1 - DAC is source, Pseudo differential with OUT1M as VCOM and OUT2M for external sensing
            self.tad5112_write(TAD5112_REG.OUT1X_CFG0, 0b001_101_00)  
            self.tad5112_write(TAD5112_REG.OUT1X_CFG1, 0b01_100_000) # OUT1P Headphone drive, 0dB gain.
            self.tad5112_write(TAD5112_REG.OUT1X_CFG2, 0b01_100_000) # OUT1M Headphone drive.
            # OUT2 - DAC is source, Pseudo differential with OUT2M as VCOM
            self.tad5112_write(TAD5112_REG.OUT2X_CFG0, 0b001_100_00)
            self.tad5112_write(TAD5112_REG.OUT2X_CFG1, 0b01_100_000) # OUT2P Headphone drive, 0dB gain.
            self.tad5112_write(TAD5112_REG.OUT2X_CFG2, 0b01_100_000) # OUT2M Headphone drive.

            self.output_gain_db = -20  # default output gain in dB
            self.tad5112_write(TAD5112_REG.DAC_CH1A_CFG0, 201+self.output_gain_db*2)  # Out1 gain in 0.5dB increments)
            self.tad5112_write(TAD5112_REG.DAC_CH2A_CFG0, 201+self.output_gain_db*2)  # Out2 gain in 0.5dB increments)

            # default to TDM slots 0 and 1 for left and right
            self.tad5112_write(TAD5112_REG.PASI_RX_CH1_CFG, 0x20) # TDM slot 0 -> left
            self.tad5112_write(TAD5112_REG.PASI_RX_CH2_CFG, 0x21) # TDM slot 1 -> right

            self.tad5112_write(TAD5112_REG.CH_EN, 0b00001100)  # Enable Ch1, 2
            self.tad5112_write(TAD5112_REG.PWR_CFG, 0b01000000)  # power DAC up
            return 0 # no error