unsigned char get_data_from_ROM()
{
unsigned char i = 0;
unsigned char in = 0;
unsigned char temp =0;
//Rom_SCK_SET;
for(i=0;i<8;i++)
{
Rom_OUT = 1;
Rom_SCK_SET;
Rom_SCK_CLR;
in = (in<<1);
//Rom_SCK_SET;
temp = Rom_OUT;
if (temp == 1)
{
in = in | 0x01;
}
}
return(in);
}
我用以上代码获取单个数据,但是每次得到的返回值都是OXFF.... |