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, ISO1443A, can't read UID

Other Parts Discussed in Thread: TRF7970A

Hi,
i am using TRF7970A with custom board. The commands are sent via SPI with slave select. The microcontroller
is STM32F207. I am successfully turning on the chip with this sequence:
1) VIN high
2) Waiting 2 ms
3) SS line high
4) Waiting 3 ms
5) EN2 line high
6) Waiting 1 ms
7) EN line high

I am measuring 1.6V on BAND_GAP and 13.56 mHz on OSC.

After that i am sending SOFT_INIT(0x83) and IDLE(0x80) commands. Now chip status register(0x00) has 0x01 value.

My registers configuration is:

1) Chip Status Control: 0x21

2) ISO Control: 0x88

3) ISO14443B TX Options: 0x00

4) ISO14443A HighBitRate Options: 0x00

5) TX Timer HByte: 0xC1

6) TX Timer LByte: 0xC1

7) TX PulseLength Control: 0x20

8) RX NoResponseWaitTime: 0x0E

9) RX WaitTime: 0x07

10) Modulator and SYSClock Control: 0x21

11) RX SpecialSettings Register: 0x20

12) IRQStatus Register: 0x00

13) CollisionPosition and InterruptMaskRegister: 0x3E

14) CollisionPosition: 0x00

15) RSSILevel and OscillatorStatus Register: 0x40

Now i am transmitting the REQA command:

ChipSelect(true);

Spi2Send(0x8F);    // Reset FIFO command
Spi2Send(0x90);    // send with CRC
Spi2Send(0x3D);    // write continuous from register 1D
Spi2Send(0x00);    // Data for register 1D
Spi2Send(0x0F);    // Data for register 1E
Spi2Send(0x26);    // ISO14443A REQA command byte

ChipSelect(false);

wait 10 ms

ChipSelect(true);
Spi2Send(0x6C);   // read IRQ status register
Buffer[0] = Spi2Send(0x00);
Buffer[1] = Spi2Send(0x00);
Buffer[2] = Spi2Send(0x00);         
ChipSelect(false);

Value in Buffer[0] is 0x80, than i am sending:

ChipSelect(true);
Spi2Send(0x8F);
Spi2Send(0x90);
Spi2Send(0x3D);
Spi2Send(0x00);
Spi2Send(0x20);
Spi2Send(0x93);
Spi2Send(0x20);
ChipSelect(false);

and there is no UID. FIFO is empty. Where i am wrong?

Thanks in advance !

  • Peter - 

    You need to get ATQA back from the tag first. It appears you are almost there as you are sending out REQA and getting EOTX. but you need to wait for the EORX before you send out the first anti-collision command.

  • I changed my code:

    ChipSelect(true);
    Spi2Send(0x6C);   // read IRQ status register
    Buffer[0] = Spi2Send(0x00);
    Buffer[1] = Spi2Send(0x00);
    Buffer[2] = Spi2Send(0x00);                 
    Buffer[3] = Spi2Send(0x00);                 
    ChipSelect(false);

    Now value's are
    Buffer[0] -> 0x80
    Buffer[1] -> 0x3E
    Buffer[2] -> 0x00
    Buffer[3] -> 0x40

    Wait 10 ms and send:

    ChipSelect(true);
    Spi2Send(0x8F);
    Spi2Send(0x90);
    Spi2Send(0x3D);
    Spi2Send(0x00);
    Spi2Send(0x20);
    Spi2Send(0x93);
    Spi2Send(0x20);
    ChipSelect(false);

    And again there is no UID. FIFO is empty also FIFO status register.

  • Peter -

    are you reading out the FIFO status and the ATQA value first? are you using the IRQ pin? 

    should be like this.

    This is RX Complete (getting 0x40 in IRQ status, triggered off IRQ going high), then read of FIFO status for # of bytes, then reading FIFO to get out the ATQA.

    then (leaving the ISO Control register at 0x88), sending the first SEL + NVB command (0x93, 0x20)

    then from this you will get another EOTX IRQ that needs to be serviced

    then, if the tag is in the field, you should get another EORX IRQ, which can be serviced same as before, to get the UID (example below is single size) - or the first bytes of the UID if its double sized or triple sized (first byte of UID will be 0x88 if its a double or triple here)

    after you get to this point, you can change ISO Contol register to 0x08 and issue first Select command (0x93 + 0x70 + UID and BCC bytes)

     

  • I fix my mistakes and now it work :)