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: TAC5112 loopback

Part Number: TAC5112

Hello

I have the ADC path working on TAC5112 while configuring over SPI from our MCU (so not relying on the EV kit) as this previous query: TAC5112: Configure for wclk/bclk generation from non standard Mclk - Audio forum - Audio - TI E2E support forums .
I now need to configure and test the DAC path. There is no easy way to write data onto the i2s (yet) so am curious what the loopback setting on INTF_CFG1 Register (Address = 0x10) did.
I was wonderring if this would route the data from ADC1 back into the DAC1 and hence feed some data into DAC1 and re-create the 'same' signal which I input into IN1P. This would be an easy way to test the DAC path for me. Is my understanding correct? Is it okay to assume ADC1 and DAC1 can operate at the same time and in this way for testing?

On trying the above (write 0xE0 to reg 0x10) I notice the DOut signal goes and stays Hi.
What should DOUT_DRV[2:0] values for reg 0x10 be set to? (Its value is 0x50 before I set the loopback)

Assuming the DAC1 is otherwise configured correctly to show signal to OUT1P/M I would expect a waveform similar to IN1P but there is none.
(I'm also considering hard-wiring Dout to DIn to get the same effect?)

Dac1 and Dac2 are configured as below (clocks already set up as per ADC operation):

Reg    Value
0x11, 0x80  Enable PASI DIn
0x28, 0x20   set PASI DIn slot 0 to ch1
0x29, 0x21   set PASI DIn slot 1 to ch2
0x64, 0x20   Route DAC1 to OUT1P and OUT1M as differential
0x65, 0x21   DAC channel 1 wide-width 96KHz mode
0x66, 0x20   Channel OUT1M 0dB
0x6b, 0x20   Route DAC2 to OUT2P and OUT2M as differential
0x6c, 0x21   DAC channel 2 wide-width 96KHz mode
0x6d, 0x20  Channel OUT2M 0dB
0x76, 0x0c  Enable ch1 ch2
0x78, 0x40  Power up DACs 

Thank you.

  • Hi Jas,

    This is possible, but you need to use the loopback mixer registers as opposed to the INTF_CFG1 register.

    To enable ADC1 loopback on DAC1:

    Page 0x11, Register 0x5a = 0x40

    To enable ADC2 loopback on DAC2:

    Page 0x11, Register 0x60 = 0x40

    Best,

    Garret

  • Hi Garret, thank you for your speedy response.

    Wondering if page 0x11 is valid for 5112, it's not documented in SLASF24A.(Maybe  it's undocumented?)

    I tried it anyways for DAC1 but unfortunately didn't see any analogue signal at OUT1P - assuming my DAC configs are correct!
    Could you please confirm that page for this codec. If it is absolutely correct I guess my DAC config is incorrect.

    Thanks a lot,

    Jas

  • Hi Jas,

    Page 0x11 (Page 17) is documented starting on page 214 of SLASF24A.

    Your DAC config looks correct - did you make sure the ADC channels are enabled and powered on as well? The snippet you sent only has the DAC channels enabled and powered on.

    Also - did you write 0x11 to page 0 to set the page before writing to the page 17 registers?

    Best,

    Garret

  • Hi Garret,

    sorry for delayed response.

    I reverted back to the EV Kit and Purepath3 to try to get both ADC And DAC working together (resorted to USB input on the AC-MB so not our normal AIF/I2S/clocking config). Had some success with this but also have some observations I hope you can help me with.

    Tried to use the i2c monitor to read/write to the loopback reg page 0x11, reg 0x5a using the below commands but 1) the loopback did not work, and 2) nothing was read back with the read command. (The read failed if I left out the redundant 00)

    w a0 00 11     # Set page to 0x11
    w a0 5a 40     # Loopback ADC1 o/p to DAC1 i/p
    r a0 5a 00      # Read back reg 5a

    The data sheet says the coeff registers seem to want to do multibyte reads (which our MCU implementation can not do). Can the i2c monitor do this and if so what would be the correct write and read commands? I was hoping the i2c monitor would be able to handle without problem.

    Failing with the above I fly-wired the Dout to DIn pins on the external ASI header on the AC-MB and this seemed to do the trick temporarily for testing the DAC operation (I saw good replica if the INI1P/M signal at OUT1P/M though there was a bit of crosstalk interference).

    Using the PPC preset configs I married together ADC and DAC setups but delayed Enabling the ADC (and obviously the power-up reg) until after both ADC and DAC configs. This sequence was the key going back to our MCU code, as I was setting up the ADC, enable i/p ch and power up ADC, then setting up the DAC, enable o/p ch and power up DAC but retaining the ADC enable and power bits too. This sequence was probably causing the issues I had at the start.

    By delaying the Enable and power up of both ADC and DAC till the very end things seemed to work on our application.

    However, our application requires we can start and stop both ADC and DAC individually at any time and possibly make setting changes on the fly, so I'd like help knowing what are the permissible sequence of events in allowing this flexibility? Do I need to power-down both ADC and DAC to change config of one of them or is Disabling them enough? Hope you see where I'm coming from.

    Going back to the loop back coeff register it would still be useful to know how to read/write to these correctly for our unit-testing, although we are using SPI bus from MCU to codec and so far it's implementation only expects single 8-bit register values, so I'm not sure it can handle multibyte operations.

    Many Thanks!

    Jas

  • Hi Jas,

    Yes the I2C monitor can handle multibyte reads. The value after the register in a read command specifies the number of bytes to be read, so the command "r a0 5a 00" means to read 0 bytes starting at register 0x5a, which is why you weren't seeing anything. Change this value to 01 to read 1 byte and you should read back 0x40.

    Most setting changes are not recommended on the fly - both the ADC and DAC should be powered down - but some are possible if necessary. Check which sections are not grayed out in PPC3 when the device is "Active".

    Best,

    Garret