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.

DM8168 AIC3106

Hi,all
Today,Iwant to test the AIC3106 in my DM8168evm is ok or not. I use the test code AIC3106 that spectrum digital evm8168 provided.(Website:http://support.spectrumdigital.com/boards/evm816x/revg/)。I can not hear the Audio loopback sound and 1kHz sine sound,Then i run the code step by step,then I find the problem,but I do not know how to solve。

The problem is as follow:when the program run tu the last line in AIC3106.c(return EVM816X_I2C0_write( AIC3106_I2C_ADDR, cmd, 2 );),then it comes to the function EVM816X_I2C0_write() in evm816x_i2c.c,the problem will come. The function EVM816X_I2C0_write() code is as follow:

Uint16 EVM816X_I2C0_write( Uint16 slave_addr, Uint8* data, Uint16 length )
{
Uint8 *pdata = ( Uint8 * )data;
Uint8 last_byte = ( data[length-1] & 0xFF );
Uint16 status;
Int16 i, timecount, timeout = 0x1000;

/* Set slave address */
I2C0_SA = slave_addr;

/* Set data count */
I2C0_CNT = length;

/* Poll BB field on I2C0_STAT - Wait for bus to become free */
for ( i = 0 ; I2C0_STAT & I2C_STAT_BB ; i++ )
if ( i > timeout )
return 2001;

/* Configure Options for Transmitting - Master Transmit mode */
I2C0_CON = 0
| I2C_CON_I2C_EN // I2C Enable
| I2C_CON_MST // Master Mode
| I2C_CON_TX // Transmit Mode
| I2C_CON_STP // Stop
| I2C_CON_STT // Start
;

/* Poll until complete */
for ( timecount = 0 ; timecount < timeout ; timecount++ )
{
/* Read I2C Status register */
status = I2C0_STAT;

// MY NOTE: when it come here,it can not go to the follow function.Then it will be time out. Why,how to solve?

/* Check for NACK */
if ( ( status & I2C_STAT_NACK ) != I2C_STAT_NACK )
{
/* Check for ARDY */
if ( ( status & I2C_STAT_ARDY ) != I2C_STAT_ARDY )
{
/* Check for XRDY */
if ( ( status & I2C_STAT_XRDY ) == I2C_STAT_XRDY )
{
/* Send Data */
if ( length == 1 )
{
I2C0_DATA = last_byte;
length--;
}
else
{
I2C0_DATA = *pdata++;
length -= 1;
}

/* Clear Transmit Ready field */
I2C0_STAT &= I2C_STAT_XRDY;
}
}
....

....


//I2C0_CON |= 0x02;
_wait( 1000 );
}
}

/* I2C Timeout */
return 2002;
}

The problem is that when it come to

/* Read I2C Status register */
status = I2C0_STAT;
Then follow code,it will not execute until timeout,why??where is my problem lies??How to solve??Besides,what is I2C0_STAT register means??

Thanks in advance,

Zhao

  • Hi Zhao,

    The test code should run fine. Are you using a Spectrum Digital EVM or your own design? If a Spectrum EVM, then what is the serial number?

    Regards,

    Pavel

  • Hi Zhao,

    The problem here might be that we are using the I2C_STAT register, instead of the I2C_IRQSTATUS register. I will further investigate and let you know when I have something more.

    Regards,

    Pavel

  • The board is my own design,the circuit in this part is same with the EVM board。When I  change  the Register definition and address,it did not work。So,what is wrong with it?Where can I get the new version Test Codes.

    Thanks

                Zhao

  • Hi Zhao,

    I just tested the evm816x/tests/aic3106/Debug/aic3106.out file, and everything works fine on the DM816x EVM from Spectrum Digital. I can hear the sound. This is my CCS console output, when I run the aic3106.out, without setting any breakpoints:

    [CortexA8] 01  Testing AIC3106 MCASP...
     -> 1 KHz Tone on Headphone [P2].
     -> 1 Khz Tone on Lineout [P3].
    <-> Audio Loopback from Line In [P4] --> to HP/Lineout [P2/P3]
    <-> Audio Loopback from MIC [P5] --> to HP/Lineout [P2/P3]
        PASS

    ***ALL Tests Passed***

    Can you please send me the steps you are doing to run the aic3106.out file in CCSv5 ? I will compare with mine. If they are the same, you should check your hardware design.

    Regards,

    Pavel

  • Hi Pavel

    Now I have meet the same problem, when it comes to here:status = I2C0_STAT; It cannot go to the follow  function. I see you have said the problem may be that you are using I2C_STAT register, instead of the I2C_IRQSTATUS register. So how should I can do to solve this problem. Thank you.

    zhong

    BR