Q:The communication between F2812 & TLV320AIC10 !



A test using F2812 & aic10 to form a audio system. but i don't
know how to initiate the aic10(how to set up the 2nd
communication!),and i can't read data form aic10 DX correctly! I
want to know why ?please anser me .thank you very much!
The system conection as folliow:

The DSP MCLKX and MCLKR connect to AIC10 SCLK;
The DSP FSX and FSR connect to AIC10 FS;
DX(DSP)----DIN(AIC10) ; DR(DSP)-----DOUT(AIC10)
the FC pin is connected to a GPIO in order to start 2nd comm. by FC
pulse .

The F2812 Mcbsp work as Master . and AIC10 as slave!
I use two method to start the 2nd comm:
1.using FC
2.after reset,send (0x0001) first ,then send regcode for the 4
registers initializing!

but no matter which method , i can't receive the right data from
AIC10.
why???

The code as follows:
#define ESTOP0 asm(" ESTOP0");
#define NOP asm(" NOP");
void InitMcbsp(void)
{
asm(" EALLOW");
GPFMUX = 0x3F00; //config as Mcbsp IO
asm(" EDIS");
//No.1 : Reset all the registers
SPCR1 = 0x0000; //RRST = 0;
SPCR2 = 0x0000; //XRST = 0;
RCR2 = 0x0000;
RCR1 = 0x0000;
XCR2 = 0x0000;
XCR1 = 0x0000;
SRGR2 = 0x0000;
SRGR1 = 0x0000;
PCR = 0x0000;
NOP;
NOP;
//No.2 : set the relative control bit
SPCR1 = 0x0000;
SPCR2 = 0x0200;
RCR2 = 0x0041;
RCR1 = 0x0040;
XCR2 = 0x0041;
XCR1 = 0x0040;
PCR = 0x0A00;
SRGR2 = 0xB0FF;
SRGR1 = 0x0025;
SPCR2 |= 0x0040;
NOP;
NOP;
NOP;
//No.3 : Mcbsp reset enable
SPCR1 |= 0x0001; //McbspRegs.SPCR1.bit.RRST = 1;
SPCR2 |= 0x0001; //XRST = 1;
SPCR2 |= 0x0080; //FRST
NOP;
NOP;
}
void InitAic10FC()
{
int i=0;
int value[4]={0x0210,0x0404,0x0640,0x0800}; //D loop back
for (i=0;i<4;i++)
{
SetFC(1);
NOP;
NOP;
Mcbsp_Tx(value); //send a data from Mcbsp
NOP;
NOP;
status[i] = Mcbsp_Rx();//readout the received data
SetFC(0);
}
}

void InitAic10Soft1()
{
int i=0;
int value[4]={0x0250,0x0404,0x0600,0x089B}; //for sampling
for (i=0;i<8;i++)
{
Mcbsp_Tx(0x0001);
NOP;
NOP;
Mcbsp_Tx(value[i/2]);
NOP;
NOP;
status[i/2] = Mcbsp_Rx();
}
}

void main()
{
SysInitial();
InitMcbsp1();
InitAic10Soft1();
......
}
No matter i use InitAic10FC(),or InitAic10Soft1(), I can receive the
data from AIC10 DOUT,but I can't get the right data, I want to know
why??? , Oh,One thing ,the circuit is all right!!!

Could you please give me a right way to solve it? and try to find
what's the problem?? for i am depressed for this problem for a long
time.
If you have any good idea ,could you please send me a E-mail of the
relative method to solve the problem ! Thank you very much.

Good luck!

.