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.

set up TLV320AIC3254-slave with WCLK-output

Other Parts Discussed in Thread: TLV320AIC3254

There was a need to set TLV320AIC3254 up as a slave (for receiving audio data from ADC) (cc430 - master), and WCLK must be configured as an output, and the codec must clocked via a separate output CLK (for example - smclk), not through BCLK. Which registers need to adjust? I found nothing in http://www.ti.com/lit/an/slaa408a/slaa408a.pdf, besides how to adjust the direction of pins BCLK and WCLK. 


thanks in advance

  • Hi, Oleg,

    I have asked my colleague to look into this for you.

    -d2

  • Thank you very much, Don!

    I'll wait for the answer of your colleague.

  • Oleg,

    See these two app notes regarding the AIC3254:

    http://www.ti.com/litv/pdf/slaa404c (page 19)

    http://www.ti.com/litv/pdf/slaa469

    Regards,

    J-

  • Thank, J Arbona

    I understand, in the case (codec - in slave mode) when BCLK is configured to input and WCLK - to the output, codec receives MCLK from BCLK only. I need a different, because I have no time to clock codec from BCLK (I need some time so that to save data to SD card). So I'm going to use the simple slave mode, when BCLK and WCLK are the inputs. I use 10 MHz MCLK, so I try to apply the formula for the timer interrupt - (10 000 000 / 16 000) / 2 (16 000 - sample rate, 2 - for left and right channel). In the interrupt I will change WCLK and accept bytes as host-master:

    / / Code

    #pragma vector = TIMER0_A0_VECTOR
    __interrupt void CCR0_ISR(void)
    {

    P3OUT ^= BIT2;                              // wclk   (switch channel)

    Rxbyte = UCA0RXBUF;                   // reset rx flag
    while ((UCA0IFG & UCTXIFG) == 0);
    UCA0TXBUF = 0xFF;                      // for clock BCLK
    while ((UCA0IFG & UCRXIFG) == 0); 
    Rxbyte = UCA0RXBUF;                   // read first byte in channel

    WriteByte(Rxbyte);                          // for further processing

    Rxbyte = UCA0RXBUF; 
    while ((UCA0IFG & UCTXIFG) == 0); 
    UCA0TXBUF = 0xFF; 
    while ((UCA0IFG & UCRXIFG) == 0); 
    Rxbyte = UCA0RXBUF;

    WriteByte(Rxbyte);

    } // CCR0_ISR


    / / Code

    Will it work properly?
    And finally - when I start to receive bytes, at first I get 0x00 (about 200 bytes), and after that I get any values (probably, they are normal). How to avoid these zeros at the beginning of the exchange?

    I will be grateful for any advice.


  • Oleg,

    I haven't tested it, but please let us know if it works well for you.

    Here is an app note on implementing I2S on SPI without too much overhead (but requires some simple external logic):http://www.ti.com/litv/pdf/slaa449a.

    The zeroes are normal. This is because there is a delay dominated by the device decimation filters (see Filter A in datasheet for group delay). When I2S and MCLK is provided for the first time after power-up, the miniDSP starts and data memory is cleared. The first few samples are zero until it reaches approx. the group delay time.

    Regards,

    J-

  • In principle, my code would work, but the frequency WCLK in codec does not coincide with the frequency of the MSP430, the skewing. The solution is to use a signal ADC_MOD_CLK, which can be divided and output from the GPIO (MISO, DOUT). If AOSR set to divide by 128, then ADTS_MOD_TSLK can be divided by 128 and it will fit WCLK. With this signal I can synchronize frequencies in my case - when the MSP430 is master and codec - slave.

    There was one more question, I'm trying use codec ASI in DSP mode in msp430-master. Get the following picture:


    I'm doing one clock - WCLK rises, do a clock - WCLK drops, take 4 bytes (left and right channel), but if I do not make a clock in the second half of the period, the WCLK does not rise at all. Can this be avoided? If not, I'll use the LJF.

  • Oleg,

    That is correct. You would have to keep sending BCLK for WCLK to work properly as you mention.

    Regards,

    J-