不知道我的时序哪里出了问题,希望大家能帮忙看一下,转换结果有时对,有时错,谢谢
void ReadDaDat( void )
{
long int temp;
char i = 0;
temp = AdDat;
CLK = 1;
CS = 1;
CLK = 0;
_nop_();_nop_();_nop_();
CS = 0;
for(i=0;i<16;i++)
{
CLK = 0;
_nop_();
temp &= 0x1000;
if(temp)
DIN = 1;
else
DIN = 0;
CLK = 1;
_nop_();
AdDat <<= 1;
AdDat &= 0x1110;
temp = AdDat;
}
CS = 1;
CLK = 1;
}
|