各位工程师,你们好。我现在采用RFID的读写芯片TMS3705去读写TMS37145标签。我现在遇到问题是,在TXCT拉低50MS,然后拉高,等待数据输出,我读回来的数据没有7E,或者FE。我能够用示波器看到SCIO线上有正常的方波。我的程序入下。请各位工程师给与指导。谢谢。
uint16_t TMS37145_read_bit(void)
{
uint8_t temp;
uint8_t ucNum;
uint8_t ReadDat[14];
for (temp = 0; temp < 14; temp++)
{
while(!GPIOE->IDR&0x1000); // 1
TimDelay_us(84); //64us
ReadDat[temp] = 0;
for (ucNum = 0; ucNum < 8; ucNum++)
{
ReadDat[temp] >>= 1;
//TimDelay_us(20); //64us
if (GPIOE->IDR&0x1000) // 0
{
ReadDat[temp] |= 0;
}
else // 1
{
ReadDat[temp] |= 0x80;
}
//ReadDat[temp] >>= 1;
TimDelay_us(64); //64us
}
while(GPIOE->IDR&0x1000); // 0
TimDelay_us(64);
}
return ReadDat[0];
}
unsigned char TMS37145_read(void)
{
unsigned char temp1=0;
// unsigned int SCIO=0;
for(temp1 = 1;temp1 < 14;temp1 ++)
{
RF_read_buf[temp1] = TMS37145_read_bit(); //读出所有字节数
}
}