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.

AIC3204 saving samples from ADC

Hi ::

How can i save samples from the AIC3204 ? When i use fprintf command to save a datafile the program the output of AIC3204 is distorted. My code is below

 

datafile=fopen("datafile.dat","w");

for(i=0;i<4000;i++) 

{

for(j=0;j<10000;j++) 

{

for(sample=0;sample<48;sample++)

{

data3=I2SRXLT1;

data1=I2SRXLT0;

while((I2SINTFL&0x08)==0x08)

data4=I2SRXRT1;

data2=I2SRXRT0;

fprintf(datafile,"%d\n",data3);

 

// I2STXLT1=data3;

// I2STXLT0=0;

// I2STXRT1=data4;

// I2STXRT0=0;

}

}

}

I2SSCTRL=0;

}