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.

ADC088S022驱动不了,请帮我看下我的分析和代码有问题吗?

Other Parts Discussed in Thread: ADC088S022

根据手册上的时序要求,当把地址一写完就开始采样数据的读取,但是每次读出来都是0,我的时钟按照手册上0.8MHZ~3.2MHZ,我的时钟是1MHZ.下面是代码,请帮我分析下:

u8 ADC088S022_ReadByte(u8 byte)
{
u8 i,ReadByte=0;
SDA_L();


for(i = 0; i < 5; i++)
{
SCL_L();
if(byte & 0x80)
{
SDA_H();
}
else
{
SDA_L();
}
SCL_H();
byte<<=1;
}

SCL_L();
for(i = 0; i < 8; i++)
{
if(Read_SDA())
{
ReadByte |= 0x01;
}
else
{
ReadByte &= ~(0x01);
}
SCL_H();
SCL_L();
ReadByte <<= 1;
__nop();
__nop();
}
return ReadByte;
}