void main()
{
Uint8 ad_data[128];
Uint8 i,j,k,busy;
init_GPI0();
InitMcbsp0_Master();
AD_Reset();
for(i=0;i<100;i++) //采样100次
{
AD_ConvstStart();
busy = (*GPIO_GPVAL) & 0x40;
while(busy==0x40)
{
delay_us(1);
busy = (*GPIO_GPVAL) & 0x40;
}
Mcbsp0_Recv_Master(ad_data, 128);
for(k=0;k<64;k++)
{
j = 2*i;
ad_data[i] = (ad_data[j] <<8) | ad_data[j+1];
*(Mcbsp0_DRR1 + i ) = ad_data[i];
}
}
}
|