The Near Field Communication (NFC) market is emerging into multiple fields including medical, consumer, retail, industrial, automotive, and smart grid. Card emulation is one of the three operational modes supported by the TRF7970A. When using card emulation, the user can configure the TRF7970A to emulate a Type 4A or Type 4B tag platform. When emulating either of the tag platforms, record type definitions (RTD) can be used such as text, URI, smart poster, or V-Card. It should also be noted here that card emulation on the TRF7970A is not limited to NFC applications. Other applications could include payment systems, access control, proprietary customer systems, and other ISO 14443-4 applications. This application report describes the fundamental concepts of how card emulation is to be implemented and also how to successfully accomplish the mastery of the concept while using the TRF7970A.
The sample code described in this document can be downloaded from www.ti.com/lit/zip/sloa208.
BoosterPack, LaunchPad are registered trademarks of Texas Instruments.
Arm, Cortex are registered trademarks of Arm Limited.
Bluetooth is a registered trademark of Bluetooth SIG.
Wi-Fi is a registered trademark of Wi-Fi Alliance.
All other trademarks are the property of their respective owners.
ALL_REQ
NFC-A polling command, equivalent to ISO 14443-3 short frame command WupA (0x52)
ALLB_REQ
NFC-B polling command, equivalent to ISO 14443-3 command WupB
APDU
Application Protocol Data Unit, used in command-response pairs to exchange I (information), R (receive ready) or S (supervisory) blocks.
ATTRIB
PICC selection command, Type B
ATQA
Answer To ReQuest A, ISO 14443-3 term, equivalent to NFC term SENS_RES
ATQB
Answer To ReQuest B, ISO 14443-3 term, equivalent to NFC term SENSB_RES
CC
Capability Container, contains management data and is stored inside a read-only EF file. This EF is located inside the NDEF tag application. Default (or basic) file ID for this file (for NFC) is 0xE103. See NFC Type 4 Tag Operation Specification and ISO/IEC 7816-4 for more information.
CE
Card Emulation, one of the three modes offered by NFC devices. In this optional mode of NFC operation, an NFC Forum device is considered to be a card emulation platform only when it is emulating a Type 3, Type 4A or Type 4B tag platform. Emulation of any other cards or tags is outside the scope of the NFC Forum Brand Promise.
DEP
Data Exchange Protocol, an abstracted operational layer that uses either ISO or NFC protocols to exchange data. Thus, two terms can be created with this acronym: ISO-DEP and NFC-DEP. In the context of this document, after activation and selection of the emulated card and before deactivation, ISO-DEP is used exclusively to exchange data between the reader/writer (PCD) and the tag platform (PICC).
EF
Elementary File, a set of data objects, records or units sharing the same file identifier and the same security attributes
File Identifier
2-byte data element used to address a file
fc
Carrier frequency, in the context of NFC/HF RFID, is 13.56 MHz ±7 kHz. This is the fundamental transmit frequency of the reader/writer (also called PCD).
Initiator
Generator of the RF field and source of the beginning of the NFCIP-1 communication
MIME
Multipurpose Internet Mail Extensions
Modulation Index, m
Signal amplitude ratio of [(peak – minimum) / (peak + minimum)] or [(1 – b) / (1 + b)], where b is the ratio between the modulated amplitude and the initial signal amplitude. The index, m, is defined per protocol type for both downlink and uplink and is generally expressed as a percentage (for example, Type A uses m = 100%, Type B uses m = 8 to 14%)
NDEF
NFC Data Exchange Format
NFC
Near Field Communication
PCB
Protocol Control Byte, used for conveying information required to control data transmission of blocks during the exchange of command-response APDU pairs. Bit coding of this byte and usage rules are found in ISO/IEC FDIS 14443-4.
PCD
Proximity Coupling Device (also commonly referred to as reader/writer)
PICC
Proximity Integrated Circuit Card (also commonly referred to as tag, tag platform, or transponder)
PUPI
Pseudo Unique PICC Identifier (randomly generated or static number returned by PICC as part of the response to REQB, WupB, ALLB_REQ or SENSB_REQ)
RTD
Record Type Definition
SAK
Select AcKnowledge (from ISO 14443-3), in NFC terms this is also called SEL_RES
SDD_RES
Equivalent to ISO 14443-3 response to SDD_REQ, and is complete NFCID1 CLn + BCC (if cascade level 1 (single size UID) or indicates NFCID1 is incomplete in the response and further cascade levels must be completed to obtain complete NFCID1+BCC.
SDD_REQ
Equivalent to ISO 14443-3 Type A anticollision sequence. Comprised of SEL_CMD, SEL_PAR and n data bits coded based on cascade level specified by SEL_CMD and calculated by value of SEL_PAR
SEL_RES
Equivalent to ISO 14443-3 SAK response
SENS_REQ
NFC-A polling command, equivalent to ISO 14443-3 short frame command REQ_A (0x26)
SENS_RES
NFC-A polling response, equivalent to ISO 14443-3 ATQA
SENSB_RES
NFC polling command response, equivalent to ISO 14443-3 ATQB
SENSB_REQ
Polling command, equivalent to ISO 14443-3 command REQ_B
Single Device Detection (SDD)
Algorithm used by the reader/writer to detect one out of several targets in its RF field (Type A anticollision, from ISO/IEC 14443-3)
T4T
Type 4Tag
Tag Platform
Responds to reader/writer (PCD) commands by using load modulation scheme (passive operation)
TLV
Type Length Value
UID
Unique IDentifier, a randomly generated or static number returned by Type A PICC as part of the response to REQA, WupA, ALL_REQ or SENS_REQ. It must be 4, 7, or 10 bytes long.
The TRF7970A supports three operational modes: reader/writer, card emulation, and peer-to-peer. This document describes on how to use the TRF7970A in card emulation mode. Card emulation allows an NFC enabled system to act as or 'emulate' a tag platform. In the case of the TRF7970A, it is possible to emulate both Type 4A and Type 4B tags concurrently. This feature is a differentiator when compared to static tags that typically offer a single tag type platform.
Card emulation for Type 4A uses ISO/IEC 14443A technology at a baud rate of 106 kbps. Card emulation for Type 4B uses ISO/IEC 14443B technology at a baud rate of 106 kbps. After technology selection for either mode has been completed, the higher layers are the same (as shown in Figure 1).
When configured for the aforementioned mode, the TRF7970A transceiver behaves as an emulated card, so it does not produce its own RF field. When a RF field is presented from a reader, and properly formatted commands are issued, the transceiver load modulates the reader's field to communicate with it.
A 16-bit and a 32-bit microcontroller are used to interface with the TRF7970A to demonstrate a reference example of the card emulation mode. The firmware supports flexible functions that allow the user to enable or disable the supported card emulation modes. Additionally, the firmware demonstrates how to format various NDEF message types for card emulation applications, and allows NFC-enabled smart phones to write custom NDEF content to the device.
Table 1 lists the NFC-enabled devices that were used to validate the firmware.
Smartphone Model (Release Date) | Operating System | Kernel Version |
---|---|---|
Samsung Galaxy Nexus (Nov 2011) | Android 4.3 | 3.0.72 Jun 7 2013 |
Samsung Galaxy S3 (AT&T) (June 2012) | Android 4.0.4 | 3.0.8 Aug 29 2012 |
Samsung Galaxy S3 (T-Mobile) (June 2012) | Android 4.3 | 3.0.31 Mar 8 2014 |
Asus Nexus 7 (July 2012) | Android 4.4.2 | 3.1.10 Nov 20 2013 |
Samsung Galaxy Note 2 (Sept 2012) | Android 4.4.2 | 3.0.31 May 23 2014 |
AU Arrows Fujitsu FJL21 (Oct 2012) | Android 4.0.4 | 3.0.21 Oct 16 2012 |
Samsung S3 Mini (Oct 2012) | Android 4.4.2 | 3.4.0 Jun 9 2014 |
Nokia Lumia 820 (Nov 2012) | Windows Phone 8 | 8.0.10328.78 |
HP Elite Tablet (Nov 2012) | Windows 8 | Windows 8 Pro |
Samsung Nexus 10 (Nov 2012) | Android 4.4.2 | 3.4.39 Nov 20 2013 |
Google Nexus 4 (Nov 2012) | Android 4.4.4 | 3.4.0 Apr 16 2014 |
Samsung Galaxy S4 (April 2013) | Android 4.4.4 | 3.4.0 Aug 27 2014 |
Hisense Sero 7 Pro (June 2013) | Android 4.4.1 | 3.1.0 |
Asus Nexus 7 (July 2013) | Android 4.4.3 | 3.4.0 Mar 18 2014 |
Google Nexus 5 (Oct 2013) | Android 4.4.4 | 3.4.0 Mar 17 2014 |
Samsung Galaxy S5 (April 2014) | Android 4.4.2 | 3.4.0 Jul 22 2014 |
Sony Xperia Z3 (September 2014) | Android 4.4.4 | 3.4.0 Aug 19 2014 |
The TRF7970A supports card emulation for both Type A and Type B at 106 kbps (fc/128). When the transceiver is in default mode [ISO mode (See TRF7970A data sheet Section 5.9.6 Direct Mode for more information)] only the decoded data is available to the MCU through the FIFO.
This section covers the program flow and register settings for the anticollision sequence of each card emulation mode, and then provides a brief overview of how the data exchange sequence functions for Type 4A and Type 4B tag platforms. Figure 2 shows a high-level flow diagram.