Hello,
I am using the TRF7963A Reader/Writer IC to read and write tags that use an NXP NTAG213 device.
I was wondering if there is a recommended method for determining what actions to take in the interrupt handler based on the bits that are set in the IRQ Status Register when an IRQ service request is raised by the device. In particular are there certain conditions that take priority over others, and are any of the bits in the IRQ Status register mutually exclusive?
I believe I am not processing the IRQ interrupts correctly because I am encountering some unexpected results when going through the procedure for selecting a tag. I am also not obtaining the data I expect when reading from a (selected) tag using the NFC Forum READ command.
Some additional information:
- The NXP NTAG213 device is compliant with NFC Forum Type 2 Tag and ISO/IEC14443 Type A specifications
- It has a 7-byte NFCID1
- I am not implementing any of the anti-collision procedures.
To show what the interrupt handler is seeing I am logging the value of the IRQ Status Register (0x0C) each time the IRQ request is processed.
Example 1
One example of something I am encountering occurs when sending an SDD_REQ command for cascade level 2. This problem does not always occur and when it does not happen I am able to successfully select the device and obtain its UID. I ask the TRF7963A to transmit the following (so the listening tag should transmit back the complete cascade level 2 of its NFCID1):
0x95 0x20
I then receive 2 successive IRQ interrupts with the bits of the IRQ status register as shown (note that only the positions numbers of bits that are set are shown and zero bits are represented by underscores):
First interrupt {7_______} (End of transmit phase)
Second interrupt {_6_____0} (Receive started AND no response timeout)
The logic I use in my interrupt handler stops processing the transaction because the “no response” (bit 0) is set. However it seems contradictory that the both the “RX start” (bit 6) and the “no response” bits are set at the same time.
If I re-try the same transaction again, the next interrupt has the IRQ status register as:
{76______}
My interrupt handler ends the transaction on account of bit 6 being set without the “FIFO high/low” (bit 5) also set. However, I haven’t found anything in the documentation to indicate how to proceed when both bits 7 and 6 are set at the same time.
If I re-try the same transaction a third time I see the following, which is typically what I will see for any transaction when there are no listening devices in the field:
First interrupt {7_______}
Second interrupt {_______0}
Example 2
A second problem I am having occurs when I have a tag properly selected and I send the READ command and expect to receive 16 bytes. Below are the IRQ service requests I see and how I process each.
IRQ Status |
FIFO Status |
Actions / Interpretation |
|
Transmit READ Command (0x30 0x00) |
{7_______} (0x80) |
- |
Read IRQ Status register End of transmit READ command so nothing to do |
Receive data |
{_65_____} (0x60) |
0x69 |
Read IRQ Status register Receive in progress, FIFO is high Read FIFO Status register FIFO Level high, 9+1=10 bytes not yet read out Read 10 bytes out of the FIFO |
Receive data |
{_6______} (0x40) |
0x25 |
Read IRQ Status register Receive complete Read FIFO Status register 5+1=6 bytes not yet read out Read 6 bytes out of the FIFO |
When the transaction is finally over I have received the expected number of bytes (16), however when I compare them to what I expect to receive there is a discrepancy (see table below). The first 10 bytes read from the FIFO are correct. However the next 6 bytes are not. It appears that either data is missing or possibly the internal FIFO buffer pointer is offset by one position for the second read (hard to tell for sure because of the multiple zero values).
Byte |
Expected Data |
Data Read from TRF7963A FIFO |
0 |
0x4 |
0x4 |
1 |
0xf |
0xf |
2 |
0x17 |
0x17 |
3 |
0x94 |
0x94 |
4 |
0x4a |
0x4a |
5 |
0xa1 |
0xa1 |
6 |
0x3e |
0x3e |
7 |
0x81 |
0x81 |
8 |
0x54 |
0x54 |
9 |
0x48 |
0x48 |
10 |
0x0 |
0x0 |
11 |
0x0 |
0xe1 |
12 |
0xe1 |
0x10 |
13 |
0x10 |
0x12 |
14 |
0x12 |
0x0 |
15 |
0x0 |
0x0 |
If anyone can point out any mistakes that I am making in processing these interrupts, or point me to some guidelines on how to do this I would really appreciate it.
Thank you,
Steve