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.

TMS320C5517: Audio processing

Part Number: TMS320C5517

Hi,

The customer bought the tmdsevm5517. But the demo can only test AIC3024-1 or AIC3024-2 independently. He wants voice input from mic1 and output from p8 and p9 at the same time. I have checked the schematic and that can realized throguh codec2, am i right? How to configure in programming?

  • Nancy,
    I will get back to you.

    Lali
  • Nancy,

    Which demo are you talking about? Is it a specific TI design?

    If its a general question on routing the audio from codec 1 to codec 2, you can consider looking at the below setup.

    Have not tried this before but the idea is that you want connect the U19  codec 1 output I2S to the input of U72 codec 2 input.

    Please see J28 pins 2 & 3 on the EVM. As long as your SW initializes and the I2S BCLK and WCLK is being fed into both codecs, it should work.

    Hope this helps.

    Lali

  • Hi,That'a my question.I don't know too much about TMS320C5517.So,the question is I don't know how to do the SW initializes.Below is the test code for aic3204-1and aic3204-2.

    How can I meet the requirements.

    //test of aic3204-1

    #define AIC3204_I2C_ADDR 0x18

    #include "evm5517.h"
    #include "evm5517_gpio.h"
    #include "evm5517_i2c.h"
    #include "evm5517_i2cgpio.h"
    #include "stdio.h"

    extern Int16 aic3204_tone_headphone( );
    extern Int16 aic3204_tone_stereo_out( );
    extern Int16 aic3204_loop_stereo_in1( );
    extern Int16 aic3204_loop_stereo_in2( );
    extern Int16 aic3204_loop_mic_in( );

    /*
     *
     *   AIC3204_rget( regnum, regval )
     *
     *      Return value of codec register regnum
     *
     */
    Int16 AIC3204_rget(  Uint16 regnum, Uint16* regval )
    {
        Int16 retcode = 0;
        Uint8 cmd[2];

        cmd[0] = regnum & 0x007F;       // 7-bit Device Address
        cmd[1] = 0;

        retcode |= EVM5517_I2C_write( AIC3204_I2C_ADDR, cmd, 1 );
        retcode |= EVM5517_I2C_read( AIC3204_I2C_ADDR, cmd, 1 );

        *regval = cmd[0];
        EVM5517_wait( 10 );
        return retcode;
    }

    /*
     *
     *   AIC3204_rset( regnum, regval )
     *
     *      Set codec register regnum to value regval
     *
     */
    Int16 AIC3204_rset( Uint16 regnum, Uint16 regval )
    {
        Uint8 cmd[2];
        cmd[0] = regnum & 0x007F;       // 7-bit Register Address
        cmd[1] = regval;                // 8-bit Register Data

        return EVM5517_I2C_write( AIC3204_I2C_ADDR, cmd, 2 );
    }

    /*
     *
     *  aic3204_test( )
     *
     */
    Int16 aic3204_test( )
    {

        /* Test Instructions */
     printf("For this test, make sure J27 (1-3=Off, 2-4=Off)\n");
        printf("                         J28 (1-3=Off, 2-4=Off)\n");
        printf("                         J29 (1-3=On,  2-4=On)\n");
        printf("                         J30 (1-3=On,  2-4=On)\n\n");

        /* Configure Serial Port 0 */
        SYS_EXBUSSEL &= ~0x0300;   //
        SYS_EXBUSSEL |=  0x0100;   // Serial Port mode 1 (I2S1 and GP[11:10]).

        /* Configure I2C mux for AIC3204-1 */ 
        EVM5517_I2CGPIO_configLine(  2, 0 );
        EVM5517_I2CGPIO_writeLine(  2, 0 );  // SEL_I2C_S0 = 0

        EVM5517_I2CGPIO_configLine(  3, 0 );
        EVM5517_I2CGPIO_writeLine(  3, 0 );  // SEL_I2C_S1 = 0

        /* Set AIC_MCBSP_MODE to I2S (disable McBSP) */ 
        EVM5517_I2CGPIO_configLine(  1, 0 );
        EVM5517_I2CGPIO_writeLine(  1, 1 );  // AIC_MCBSP_MODE = 1

        /* Set SEL_MMC0_I2S to I2S */ 
        EVM5517_I2CGPIO_configLine(  8, 0 );
        EVM5517_I2CGPIO_writeLine(  8, 1 );  // SEL_MMC0_I2S = 1
       
        /* Release AIC3204 reset */
        EVM5517_I2CGPIO_configLine(  0, 0 );
        EVM5517_I2CGPIO_writeLine(  0, 0 );  // AIC_RST = 0

        /* Codec tests */
        printf( " -> 1 KHz Tone on Headphone.\n" );
        if ( aic3204_tone_headphone( ) )
            return 1;
        
        EVM5517_wait( 100 );  // Wait   
        printf( "<-> Microphone --> to HP\n" );
        if ( aic3204_loop_mic_in( ) )
            return 1;

     EVM5517_GPIO_setOutput( GPIO26, 0 );
        return 0;
    }

    //test of aic3204-2

    #define AIC3204_I2C_ADDR 0x18

    #include "evm5517.h"
    #include "evm5517_gpio.h"
    #include "evm5517_i2c.h"
    #include "evm5517_i2cgpio.h"
    #include "stdio.h"

    extern Int16 aic3204_tone_headphone( );
    extern Int16 aic3204_tone_stereo_out( );
    extern Int16 aic3204_loop_stereo_in1( );
    extern Int16 aic3204_loop_stereo_in2( );
    extern Int16 aic3204_loop_mic_in( );

    /*
     *
     *   AIC3204_rget( regnum, regval )
     *
     *      Return value of codec register regnum
     *
     */
    Int16 AIC3204_rget(  Uint16 regnum, Uint16* regval )
    {
        Int16 retcode = 0;
        Uint8 cmd[2];

        cmd[0] = regnum & 0x007F;       // 7-bit Device Address
        cmd[1] = 0;

        retcode |= EVM5517_I2C_write( AIC3204_I2C_ADDR, cmd, 1 );
        retcode |= EVM5517_I2C_read( AIC3204_I2C_ADDR, cmd, 1 );

        *regval = cmd[0];
        EVM5517_wait( 10 );
        return retcode;
    }

    /*
     *
     *   AIC3204_rset( regnum, regval )
     *
     *      Set codec register regnum to value regval
     *
     */
    Int16 AIC3204_rset( Uint16 regnum, Uint16 regval )
    {
        Uint8 cmd[2];
        cmd[0] = regnum & 0x007F;       // 7-bit Register Address
        cmd[1] = regval;                // 8-bit Register Data

        return EVM5517_I2C_write( AIC3204_I2C_ADDR, cmd, 2 );
    }

    /*
     *
     *  aic3204_test( )
     *
     */
    Int16 aic3204_test( )
    {
     Uint16 regval;
     Int16 i;

        /* Test Instructions */
     printf("For this test, make sure J27 (1-3=Off, 2-4=Off)\n");
        printf("                         J28 (1-3=Off, 2-4=Off)\n");
        printf("                         J29 (1-3=On,  2-4=On)\n");
        printf("                         J30 (1-3=On,  2-4=On)\n\n");

        /* Configure Serial Port 0 */
        SYS_EXBUSSEL &= ~0x7300;   //
        SYS_EXBUSSEL |=  0x4100;   // Enable I2S2 pins

        /* Configure I2C mux for AIC3204-2 */ 
        EVM5517_I2CGPIO_configLine(  2, 0 );
        EVM5517_I2CGPIO_writeLine(  2, 1 );  // SEL_I2C_S0 = 1

        EVM5517_I2CGPIO_configLine(  3, 0 );
        EVM5517_I2CGPIO_writeLine(  3, 0 );  // SEL_I2C_S1 = 0

    //    EVM5517_I2CGPIO_configLine(  4, 0 );
    //    EVM5517_I2CGPIO_writeLine(  4, 0 );  // HPI_ON = 0

        /* Configure SPI2 mux for AIC3204-2 */
     EVM5517_I2CGPIO_configLine(  5, 0 );
        EVM5517_I2CGPIO_writeLine(  5, 1 );  // SPI_I2S2_S0 = 1

        EVM5517_I2CGPIO_configLine(  6, 0 );
        EVM5517_I2CGPIO_writeLine(  6, 1 );  // SPI_I2S2_S1 = 1

        /* Release AIC3204 reset */
        EVM5517_I2CGPIO_configLine(  0, 0 );
        EVM5517_I2CGPIO_writeLine(  0, 0 );  // AIC_RST = 0

        /* Codec tests */
        printf( " -> 1 KHz Tone on Headphone.\n" );
        if ( aic3204_tone_headphone( ) )
            return 1;
        
        EVM5517_wait( 100 );  // Wait   
        printf( "<-> Microphone --> to HP\n" );
        if ( aic3204_loop_mic_in( ) )
            return 1;

     EVM5517_GPIO_setOutput( GPIO26, 0 );
        return 0;
    }

     

  • Nancy,

    Were you able to overcome your issues?

    Lali
  • Nancy,

    My recommendation is to start by using this example that's in the CSL
    C:\ti\c55_lp\c55_csl_3.08\ccs_v6.x_examples\i2s\CSL_I2S_AudioCodec_DMA

    If you look at C:\ti\c55_lp\c55_csl_3.08\ccs_v6.x_examples\i2s\CSL_I2S_AudioCodec_DMA\AudioCodec_DMA.c the I2C setup has 2 instances setup. Each AIC is on I2C0 and I2C1.
    So, could you try to get the example to work with each individual AIC first?
    Then try to combine the two.

    Lali