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.

SRC4392 register write

Other Parts Discussed in Thread: SRC4392

Hi,

I'm trying to send some data over the user data link by writing to page 2 registers. I can write to page 0 and configure all blocks just fine; I even read back the values I set. But I can't write to page 2: DIT user data buffer. Whether it's a slave unit downline or just a read back on the host, it's always 0x00.

 

I've played with disabling transfers (Reg:0x08 Tx CTRL 2: TXBTD)  and disallowing updates (Reg:0x09 Tx CTRL 3: TXCUS0:1) but can never read what I write whatever end I try.

 

Any example code of writing to the DIT user data buffer? Any thoughts on what to try? I'm baffled.

  • Hello,

    In order to write to Register Page 2 and have your data stick, the DIT block must be powered up in register 0x01, Page 0, and the MCLK clock must be active. Internally, a clock is derived from MCLK to clock data from the serial host registers to the DIT block.

    The following sequence should be used to initilaize the device.

    1. Apply power and external reset.

    2. Write all control registers on Page 0 except register 0x01.

    3. Apply MCLK, as well as any audio clocks desired for Ports A and B.

    4. Write register 0x01 on Page 0 to power up the desired blocks.

    5. Disable DIT buffer transfers by setting the TXBTD bit in register 0x08, Page 0, to a 1.

    6. Write 0x02 to register 0x7F to set Page 2 as the active page.

    7. Write data to the DIT C and U buffers on Page 2 as desired.

    8. Write 0x00 to address 0x7F to set Page 0 as the active page.

    9. Enable DIT buffer transfers by setting the TXBTD bit in register 0x08, Page 0, to a 0. This will update the DIT TA buffer with the data written to Page 2 registers.

     

    You can read back Page 2 registers without disabling buffer transfers. Just make sure to set the page register to Page 2. You should then be able to read back the buffer data.

     

    Regards,

    Bob Martin, Systems Engineering - TI Audio Converters

      

  • Thanks Bob!

    Following your instructions got the transfer working and I was able to determine the cause of my problems:

    cockpit error!

    I was using RXCKO as the DIT clock and of course this doesn't start until the DIR first locks onto an incoming stream. After that the PLL can free run but as I was writing to the DIT before the stream was connected - no write!

  • Hello,

    I have the very same problem as described by Iain McNeill: Writing to registers on page 2 does not  change the transmitted channel status nor can it be read back (just getting zeros).

    Prerequisites:

    I am only using Port A (Port B unconnected) in clock slave mode. An FPGA provides MCLK, sample clock and frame sync. I followed your steps without success so I asume an initialisation mistake. The sequence is as follows:

    1. External reset

    2. Setting control registers on page 0 (it's always register address first, then data [all values in hex])

            SetCodecReg(Card, CodecCS, $7F, $00);  // Set Register Page 0
            SetCodecReg(Card, CodecCS, $03, $20); // I²S Port A: Clock Slave, 24 Bit Audio MSB, Output Signal from Receiver - NOT from SRC
            SetCodecReg(Card, CodecCS, $04, $00); // I²S  Port A: MCLK Source = MCLK; MCLK Freq = 128x LRCLK (MCLK Freq other than 128x just for Master Mode operation)
            SetCodecReg(Card, CodecCS, $07, $00); // Clock Start Output; Transmitter MCLK Divider == FPGA CLK / 128
            SetCodecReg(Card, CodecCS, $09, $01); // Transmitter Channel State Update via SPI
            SetCodecReg(Card, CodecCS, $0D, $00); // Receiver Input == RX1, Ref CLK RXCKI (ext.)
            SetCodecReg(Card, CodecCS, $0E, $0D); // Receiver Mute if No CLK, Superclock on ext. Pin, CLK Divider = 4
           // Receiver PLL Ref Clk according Data Sheet (Table 4, S.60)
            SetCodecReg(Card, CodecCS, $0F, $22);
            SetCodecReg(Card, CodecCS, $10, $00);
            SetCodecReg(Card, CodecCS, $11, $00);
           //
            SetCodecReg(Card, CodecCS, $2D, $02); // SRC Source == Receiver, ref. CLK FPGA

    3. Enable clock outputs of the FPGA (mclk, frame sync, sample clock)

    4. SetCodecReg(Card, CodecCS, $01, $37); // switch on SRC, Receiver, Transmitter, I²S Port A

    5. - 9. As suggested.

    Maybe anyone can see the mistake. I can't. Thank's for your help!

    Best regards,
    Tobias.
  • Hi, Tobias,

    I have tried your initialization and DIT buffer read and write for steps 5 - 9 on SRC4392 EVM. There is no problem for both read back and the transmission of the channel status data. Here is the script for steps 5 to 9:

    w e0 08 08 - disable the DIT buffer transfer

    w e0 7f 02 - set page to 2

    w e0 2e ee - write ee to reg 2e on page 2

    w e0 2f ff - write ff to reg 2f on page 2

    w e0 7f 00 - change the page back to 0

    w e0 08 00 - enable the DIT buffer transfer

    w e0 7f 02 - switch back to page 2

    r e0 2e 01 - read back reg 2e on page 2

    r e0 2f 01 - read back reg 2f on page 2

    w e0 7f 00 - set page to page 0

    Before you send the commands for steps 5 -9, please check the DIT output to make sure that the DIT is already in operation.

    Please let me know if you have further questions.

    Regards,

    Shawn Yu - System engineer

     

  • Hi Shawn,

    thanks for your quick answer. I followed your instructions waiting for the DIT to come up (checking with another device locking onto the stream) and then issueing your write sequence. I still cannot see my channel status data coming up in the output stream nor am I able to read anything else than zeros on page 2.

    The wierd thing is, when I set register 09 on page 0 to 02 I can read back status data from the input stream. This is working fine. Switching register 09 back to 01 and following steps 5-9 seems to reset the CU-buffer to zeros.

    Am I missing something? What (other than the SPI init sequence) could lead to such behavior? Any help is appreciated.

    Regards,

    Tobias.

  • Hi, Tobias,

    It sounds strange. Have you tried on any other SRC4392 devices? If not, please try the same and let me know if the problem still exists. Also send me the exact setup, write and readback sequences for me to check on the test bench.

    Regards,

    Shawn Yu

  • Hi Shawn,

    I finally got this working. It turned out to be an SPI-timing issue. While write and read access on page 0 worked perfectly write access on page 2 was errornous resulting in register deletes. I prolonged the chip select after the last written bit for a few ns. That was it. Strange that page 0 is working fine though.

    Thanks for all your support. Keep it up!

    Regards,

    Tobias.