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.

TAC5112: Help configuring outputs of codec

Part Number: TAC5112

Hello,

I am trying to work with the TAC5112 codec. I was told to make a new account with a proper email address so hopefully this one from my domain is ok. If not well, what can you do really. I have also seen there is a program you can download to help configure but i requested a few times and was denied, i think because i did not but the evaluation board, i just used my own board. So basically im just looking for some guidance configuring the IC.

I  cant seem to get the outputs to work as desired. The inputs and i2s communication seem ok (the host MCU gets good accurate data from the codec) . The i2c communication with the codec to configure it also seems ok and i can write and verify through reading back that the registers are being set as intended.

What i can't seem to get is any signal output on the outputs beyond the configured DC offset. On a scope it looks like the I2S data is there being sent to the codec so I believe it to be a configuration issue.

The inputs are configured as differential. 

For the outputs we want output 1 to be configured as stereo single ended and configured to drive headphones.

For output 2 we also want stereo single ended and just configured as a line output.

I want the same data to go to both outputs though. SO from the data sheet is seems this is possible using the DAC mixer. With that in mind, you can see the register/setting data in the attached c code. I added some comments also. The function called to transmit the setting puts 'tac_value' in 'tac_register' via i2c. 'tac_verify' determines whether or not the function will do a read after write to verify the value was written correctly (we are doing this but as stated it does seem like i2c comms is not the issue).

void hope_codec_ctl_port_856_tac5112_init()
{
    
    uint8_t tac_register = 0x00;
    uint8_t tac_value = 0x00;
    uint32_t tac_value_word = 0x00000000;

    uint8_t tac_verify = 2;

    //set to page 0.
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //wait at least 2 ms
    LL_mDelay(100);

    //DEV_MISC_CFG Register
    //Wake up the device by writing to P0_R2 to disable sleep mode
    tac_register = 0x02;
    tac_value = 0x01;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //wait at least 2 ms
    LL_mDelay(100);

    //PASI_CFG0
    //set format to i2s and 16 bits data
    tac_register = 0x1a; 
    tac_value = 0b01000000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //CH_EN
    //enable ins and outs
    tac_register = 0x76; //CH_EN Register 
    tac_value = 0b11001100; //
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //PASI_TX_CH1_CFG
    //put pasi tx channel 1 on the appropriate I2S slot    (right slot 1)
    tac_register = 0x1e;
    tac_value = 0b00110000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //PASI_TX_CH2_CFG   
    //put pasi tx channel 2 on the appropriate I2S slot    (left slot 1)
    tac_register = 0x1f;
    tac_value = 0b00100000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //PASI_RX_CH1_CFG
    //ch1 is left data say
    tac_register = 0x28;
    tac_value = 0b00100000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //PASI_RX_CH2_CFG
    tac_register = 0x29;
    tac_value = 0b00110000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);


    // go to page 1
    tac_register = 0x00;
    tac_value = 0b00000001;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //MIXER_CFG0
    //now turn on the dac asi mixer
    tac_register = 0x2c;
    tac_value = 0b10000000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //now change to page 17
    tac_register = 0x00;
    tac_value = 0b00010001;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //using word program (4 bytes) we need to setup outputs. 
    //channel 1 goes to LDAC and LADC2
    tac_register = 0x08;
    tac_value_word = 0x00400040;
    hope_codec_ctl_port_program_tac5112_word(tac_register, tac_value_word, tac_verify);

    //channel 2 goes to rdac and rdac2
    tac_register = 0x10;
    tac_value_word = 0x40004000;
    hope_codec_ctl_port_program_tac5112_word(tac_register, tac_value_word, tac_verify);

    //now change to page 0
    tac_register = 0x00;
    tac_value = 0b00000000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //DSP_CFG0
    //no biquads adc
    tac_register = 0x72;
    tac_value = 0b00000000; 
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //DSP_CFG1
    //no biquads dac
    tac_register = 0x73;
    tac_value = 0b00000000; 
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //VREF_MICBIAS_CFG
    //sets vref_fscale to 2.75V
    tac_register = 0x4d;
    tac_value = 0b00010000;
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //ADC_CH1_CFG0
    //setup adc channel 1
    //differential input
    //5k input impedance
    //ac coupled
    //2vrrms fullscale
    //audio band
    tac_register = 0x50; 
    tac_value = 0b00000000; //differential mode
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //ADC_CH2_CFG0
    //setup adc channel 2
    //differential input
    //5k input impedance
    //ac coupled
    //2vrrms fullscale
    //audio band
    tac_register = 0x55; //ADC_CH2_CFG0
    tac_value = 0b00000000; //differential mode
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //OUT1x_CFG0
    //setup DAC
    //out1 is the headphone output
    //input from dac signal chain
    //dac1a -> out1p
    //dac1b -> out1m
    //vcom = .6*vref
    tac_register = 0x64; 
    tac_value = 0b00100100; //
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //OUT1x_CFG1
    //hp driver with min 16 ohm
    //out_1p configuration for headphone driver se
    tac_register = 0x65; 
    tac_value = 0b01100010; // //headphone driver
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //OUT1x_CFG2
    //out_1m configuration for headphone driver
    tac_register = 0x66; //OUT1x_CFG2
    tac_value = 0b01100000; //headphone driver
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);


    //OUT2x_CFG0
    //out2, the line out/effect out
    tac_register = 0x6B; 
    tac_value = 0b00100100; //
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //OUT2x_CFG1
    tac_register = 0x6C; 
    tac_value = 0b00100010; // line out driver
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);
 
    //OUT2x_CFG2
    tac_register = 0x6D; 
    tac_value = 0b00100000; // line out driver
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);

    //PWR_CFG
    tac_register = 0x78; //PWR_CFG  
    tac_value = 0b11000000; //
    hope_codec_ctl_port_program_tac5112_byte( tac_register, tac_value, tac_verify);


}

 

 

 

  • Hi Scott,

    Unfortunately the configuration GUI PPC3 can only be accessed with a company email, and regardless is only compatible with the evaluation kit.

    Nonetheless, I can review your code and offer my suggestions.

    A couple things here, first I believe your mixer settings are a little off. You current config has

    1/256 * CH1 to RDAC (OUT1M) and 1/256 * CH1 to LDAC (OUT1P)

    1 * CH2 to RDAC (OUT1M) and 1 * CH2 to LDAC (OUT1P)

    You may be seeing a clipping issue at full-scale since these exceed 1.0.

    Also, since you do not have CH3/4 enabled on the ASI bus, nothing will output onto OUT2P or OUT2M. Stereo single-ended requires 4 channels to utilize all outputs, for this the recommended interface is TDM, as I2S only supports two channels.

    If you let me know your expected mapping (which channels you want mapped to each output), I can help provide a script.

    Here is a good reference for setting this up: https://www.ti.com/lit/an/slaaer9/slaaer9.pdf

    Best,

    Garret

  • Hi Garret,

    Thanks for your response. I will review that document tomorrow and see if i can improve things.

    RE software:  even though the software from ti only works with the EVK, i believe that from its output i2c commands which are shown on the termingal i could reverse engineer the correct settings from what the console says to output over i2c via my own function, so getting the software working is still useful to me.

    Today i was granted access to the core software but didn't understand i also have to request the specific tac5112 module, so now i am waiting on that approval, hopefully it goes through. I have the main software installed now. We will see I guess.

    Regarding CH3,4. I have tried just enabling all channels but it makes no difference.

    Its a bit confusing but from my understanding i only need 2 channels because i want the same data on both outputs. So for example ihave i2s data, just 1 Left channel and 1 right channel. I want the first (and only) left slot from said i2s signal to be output on OUT1P and OUT2P and the first (and only) right slot on OUT1M and OUT2M.  So there is only 2 "channels" of data required. However it is quite confusing what "channel" means. But to your point, enabling all 4 channels does not change the result.

    S

  • Hi Scott,

    Garret is out of office today and will follow up with you tomorrow.

    I did see your comment about the software approval and I have just confirmed it. You should see it appear in PPC3 in <24 hours.

    Thank you,
    Jeff McPherson

  • Hi Jeff,

    Yes no problem. Thanks for following up.

    I got the software installed. In the end maybe it seems PPC does not have any configuration settings for the DAC mixer or the BiQuads etc? Even the "register map" tab only shows register pages 0,1 and 3, but the device has several more. But thank you for approving the software download, it is still helpful verifying the other settings.

    I haven't had time to go over the other document Garret linked but i will update if i can't sort it out with that. 

    S

  • Hi Scott,

    You can enable these in the "Advanced" settings section:

    Click the Advanced tab, check whichever settings you want to configure, and click Apply. They will appear next to GPIO/Interrupts.

    Best,

    Garret

  • Hi Garret,

    Ok thank you for showing me that. I had tried clicking on "Advanced" but not the right side with the check mark, which does bring up the menu you showed.

    Thank you very much. I will try this out shortly.

    S

  • You're welcome, please let me know if any further support is needed.

  • I think I should be able to sort it out with these resources now. If not ill make a more specific ticket with wherever I get stuck.

    Thanks again Garret and Jeff. Have a good weekend.

  • Have a great weekend, Scott.