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.

TMS320C5505: ADS8330 to TMS320C5505

Part Number: TMS320C5505
Other Parts Discussed in Thread: ADS8330

Dear Sir/Mam,

i have interfaced ADS8330 to tms320c5505..i am using both the channels..with auto mode with SPI clk 4MHz. following is the code to get the samples.inputs are 50Hz,1V sinewave.

I
IODATAOUT2 |=(1<<1);//cs pin high for 40ns
IODATAOUT2 =~(1<<1);//cs pin low for 40ns

SPICMD2 = 0x107A;
SPIDAT2 = 0xEFFF;
IODATAOUT2 |=(1<<1); //cs pin low for 40ns
IODATAOUT2 =~(1<<1);//cs pin low for 40ns
SPICMD2 = 0x107A;
SPIDAT2 = 0xC000;//read data command
while((SPISTAT1 & 0x01) == 0x01);
IODATAOUT2 |=(1<<1); //cs pin low for 40ns
IODATAOUT2 =~(1<<1);//cs pin low for 40ns
SPICMD2 = 0x1079;
out1=SPIDAT2;//read data command
while((SPISTAT1 & 0x01) == 0x01);

while(1)
{

if( risingEdgeInt==1 &&timerInt==1 && i<4096 )
{

IODATAOUT1 =~(1<<12);//const high
Delay(10);

while((IOINDATA1&0x0020)!=(1<<5));//

IODATAOUT2 |=(1<<1); //cs pin low for 40ns
IODATAOUT2 =~(1<<1);//cs pin low for 40ns
SPICMD2 = 0x107A;
SPIDAT2 = 0xD000;//read data command
while((SPISTAT1 & 0x01) == 0x01);

spiReadDataClk();////SPICMD2 = 0x0079;//spiReadDataClk();
while((SPISTAT1 & 0x01) == 0x01);

smoothDataCh3[i++]=SPIDAT2;//&0xFFFF;


IODATAOUT2 |=(1<<1); //cs pin low for 40ns
IODATAOUT2 =~(1<<1);//cs pin low for 40ns

SPICMD2 = 0x107A;
SPIDAT2 = 0xD000;//read data command
while((SPISTAT1 & 0x01) == 0x01);

spiReadDataClk();////SPICMD2 = 0x0079;//spiReadDataClk();
while((SPISTAT1 & 0x01) == 0x01);

adcOutCh5[j++]=SPIDAT2;
IODATAOUT1 |=(1<<12);//convst low

timerInt=0;
}
if( risingEdgeInt==1 && count==0 &&i==4096)
{
break;
}
}

Timer0_Stop();

 

The problem is i am getting following waveform which is not cleaned one.I need cleaned waveform because i going to find phase difference between two waves,.

and the channel data get swapped between two buffers when i use highest clock speed.

:ploted only 1024 points