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.

[参考译文] TRF7970A:连续读取或写入模式-在第二次调用函数后不工作-为什么?

Guru**** 2446590 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1161349/trf7970a-continuous-read-or-write-mode---not-working-after-calling-function-second-time---why

器件型号:TRF7970A

您好!

我有这个代码、它第一次运行、但第二次运行

void  RFIDReadDataBlock(unsigned char startAddress, unsigned char numBytes)
{
	unsigned char Local_8;
	unsigned char i;

	unsigned char commandAddrByte = 0;

	commandAddrByte |= 0x60;					// Set the 'read' and 'continuous' bits
	commandAddrByte |= (startAddress & 0x1F);	// AND in the lower 5 bits of the address

	SPI2Init(RFID_WRITE);

    RFID_CS = 0;							// Activate chip select
    Local_8 = writeSPI2(commandAddrByte);	// Send the address


	for(i = 0; i < numBytes; i++)
	{
    	Local_8 = writeSPI2(0);					// Read back the data
		spiBlockReadBuf[i] = Local_8;
	}

    RFID_CS = 1;							// Deactivate the chip select

	return;
    
}

我必须将其修改为下面的内容、当我再次调用它时、这会起作用、但我不知道为什么上面的连续模式不起作用

void  RFIDReadDataBlock(unsigned char startAddress, unsigned char numBytes)
{
	unsigned char Local_8;
	unsigned char i;

	unsigned char commandAddrByte = 0;

	commandAddrByte |= 0x40;					// Set the 'read' bit
	commandAddrByte |= (startAddress & 0x1F);	// AND in the lower 5 bits of the address

	SPI2Init(RFID_WRITE);

    RFID_CS = 0;							// Activate chip select 

	for(i = 0; i < numBytes; i++)
	{        
        Local_8 = writeSPI2(commandAddrByte);	// Send the address
        commandAddrByte = commandAddrByte + 1;        
    	Local_8 = writeSPI2(0);					// Read back the data
		spiBlockReadBuf[i] = Local_8;
	}

    RFID_CS = 1;							// Deactivate the chip select

	return;
    
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    快速更新

    我在连续模式下对寄存器进行写入时遇到同样的问题。 如果我在非连续模式下执行该操作、它工作正常

    当我在写入寄存器后尝试发出资源清册命令序列时、它不起作用、但我怀疑它链接到连续读取/写入与非连续读取/写入

    有人能够帮助解决这个问题? 该组中似乎没有太多人。 TI 有人可以提供帮助?