The NFC Tag Initiation Sequence
When a Near Field Communication (NFC) reader initiates a tag, the reader and the tag must follow a specific sequence to ensure proper operation. The reader and tag need to establish two things: that a specific tag is selected and what sort of tag is selected.
The figure shows how this sequence works for Type A cards. (Type B and F cards use a similar but somewhat different initiation sequence, but this sequence gives you an idea of how the initiation sequence will work.)
Whenever you work with NFC, there is a proximity coupling device (PCD) and a proximity inductive coupling card (PICC). The PCD emits a radio frequency (RF) signal that provides energy to the PICC. However, if more than one PICC is available within the required distance, all the PICCs respond, resulting in a collision.
The initiation sequence ensures that the PCD selects only one PICC and communicates with it, preventing the collision from causing problems. When the PCD begins the initiation process by powering the PICC, it does so using the following steps:
- The PCD sends a Request (REQA) command to the PICC.
The REQA is specially constructed — it only has seven bits, it can’t be confused with any other command. The PCD continues to send the REQA command until it receives at least one tag response. The intervals between these requests vary by vendor.
- The PICC responds with an Answer to Request (ATQA) block.
This block contains information such as a Unique Identifier (UID) prefix. It also tells the PCD whether the tag provides anticollision support. If not, the tag is proprietary — it doesn’t provide standard NFC support. The UID prefix isn’t the complete identifier; it contains only part of the UID.
- When the tags provide anticollision support, the PCD sends a SELECT command that includes the UID prefix.
Multiple tags can have the same prefix. If they do, the PCD detects this condition and sends another SELECT command with more prefix bits. As the PCD adds prefix bits, the number of responding tags becomes fewer until only one tag responds — the select tag.
- The final step in the anticollision process occurs when the PCD sends out a SELECT command that includes the complete UID for the PICC.
- The PICC responds by sending a Select Acknowledgement (SAK) command to the PCD. The PICC activates at this point.
- The PCD must know how to interact with the PICC at this point.
When bit 6 of the SAK contains a 1, the activated PICC supports the MiFARE protocol. Otherwise, the PCD can assume that the PICC provides standardized ISO 14443-4 support.
- The PICC continues to process all commands until it receives a HALT command from the PCD. At this point, the PICC becomes disabled.
The REQA command works only on PICCs that aren’t disabled — that is, that the PCD hasn’t read before. In order to read disabled tags, the PCD instead issues a Wakeup (WUPA) command.