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: Continuous read or write mode - not working after calling function second time - why?

Part Number: TRF7970A

Hi,

I have this code which works the first time around but not the second

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;
    
}

I've had to modify it to below and this works when I call it a second time but I don't know why continuous mode above doesn't work

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;
    
}

  • Quick update

    I am having the same problem with writing to the register in continuous mode. If I do it in non continuous mode it works ok

    When I try to issue the inventory command sequence after writing to the registers it is not working but I suspect it's linked to continuous vs non continuous read / writes

    Anyone able to help with this? There doesn't seem to be many people on this group. Anyone from TI available to help?