Peer-to-peer (P2P) is one of the three modes supported by the TRF7970A. The Near Field Communication (NFC) market is emerging into multiple fields including medical, consumer, retail, industrial, automotive, and smart grid. P2P is very common in these fields, because it allows for a wireless virtual channel to be created between two devices. This application report describes two NFC technologies, the NFC-F and NFC-A protocols, which are used to initiate the communication for peer-to-peer active or passive modes. Furthermore, this application report explains how to implement an application using active or passive P2P communication, supporting baud rates of 106 kbps, 212 kbps and 424 kbps on the TRF7970A transceiver.
Project collateral and source code discussed in this application report can be downloaded from http://www.ti.com/lit/zip/sloa192.
BoosterPack, LaunchPad are registered trademarks of Texas Instruments.
FeliCa is a registered trademark of Sony Corporation.
All other trademarks are the property of their respective owners.
The TRF7970A supports three modes: reader/writer, card emulation, and peer-to-peer. This document describes how to use the TRF7970A in peer-to-peer (P2P) active or passive. P2P requires two NFC-enabled devices to communicate using technologies NFC-A or NFC-F at baud rates of 106 kbps (NFC-A), 212 kbps (NFC-F), or 424 kbps (NFC-F). The transceiver that is initially polling and initiates the communication is the initiator. The transceiver that is initially listening is the target.
The initiator always generates the RF field for both active and passive communication modes. However, the target generates its own RF field only for active mode (while the initiator's RF field is disabled) and load modulates the initiator's RF field in passive mode. After the technology selection for either mode has been completed, the higher layers are the same (as shown in Figure 1). The NDEF Push Protocol (NPP) was commonly used on Gingerbread Android NFC devices as the protocol to push NDEF messages from one NFC device to another; however, the Simple NDEF Exchange Protocol (SNEP) has become the standard on Ice Cream Sandwich Android NFC devices and onward.
A 16-bit and a 32-bit microcontroller are used to interface with the TRF7970A to demonstrate a reference example of the peer-to-peer mode. The firmware supports flexible functions that let the user enable or disable different peer-to-peer modes and technologies. The firmware supports both initiator and target for active and passive communication at baud rates of 106 kbps, 212 kbps, and 424 kbps. Additionally, the firmware can send and receive NDEF messages from NFC-enabled smart phones with SNEP.
Table 1 lists the NFC-enabled devices 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 (T-Mobile) (May 2012) | Android 4.0.4 | 3.031 Oct 31 2013 |
Asus Nexus 7 (July 2012) | Android 4.4.2 | 3.1.10 Nov 20 2013 |
Samsung Galaxy Note 2 (Sept 2012) | Android 4.3 | 3.0.31 Nov 19 2013 |
AU Arrows Fujitsu FJL21 (Oct 2012) | Android 4.0.4 | 3.0.21 Oct 16 2012 |
Nokia Lumia 820 (Oct 2012) | Windows 8 | 8.0.10211.204 |
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.3 | 3.4.0 Nov 20 2013 |
Samsung Galaxy S4 (April 2013) | Android 4.3 | 3.4.0 Nov 16 2013 |
Hisense Sero 7 Pro (June 2013) | Android 4.2.1 | 3.1.10 |
Asus Nexus 7 (July 2013) | Android 4.4 | 3.4.0 Dec 11 2013 |
Google Nexus 5 (Oct 2013) | Android 4.4 | 3.4.0 Nov 20 2013 |
Various implementations of peer-to-peer exist today; these implementations may poll through commands at different time intervals (500 ms, 300 ms, and so forth). To ensure that two NFC devices do not send commands at the same time, an initial RF collision detection is required. The transceiver must check the external Received Signal Strength Indicator (RSSI) value, which measures the strength of the demodulated subcarrier signal, before enabling its own RF field. If the RSSI value is greater than 0x00, the transceiver does not enable its RF field.
The relation between the 3-bit code and the external RF field strength (A/m) sensed by the antenna must be determined by calculation or by experiments for each antenna design. The antenna Q-factor, coupling factor between the two antennas, and connection to the RF input influence the result. Figure 3 through Figure 5 provide the correlation of the free space distance between two unmodified TRF7970ATB modules and the 3-bit external RSSI value in three directions. For more details on each orientation, see Figure 2. One TRF7970A has its RF field at full power (+23 dBm), and the second TRF7970A is used to take RSSI measurements across different distances.
The initial RF collision can be accomplished by performing the following steps:
After powering up the TRF7970A, the MCU must send SOFT_INIT (0x03) and IDLE (0x00) direct commands to enable the passive target mode at 106 kbps. Table 2 shows the default value of registers 0x00 through 0x16 and 0x18 through 0x1C after the commands are issued. The table also shows the registers that must be modified for both target and initiator modes.
The ISO Control (0x01) register is modified whenever the peer-to-peer technology or bit rate changes. The Chip Status Control (0x00) register is modified after initialization and whenever the RF field is enabled or disabled. The Modulator and SYS_CLK Control (0x09), RX Special Settings (0x0A), and Regulator and I/O Control (0x0B) registers need to be modified only once, right after initialization. The NFC Low Field Detection Level (0x16) register needs to be modified only for Target mode operation. The NFC Target Detection Level (0x18) register must be modified after initialization for Target mode operation, and also for Initiator mode operation based on the TRF7970A silicon errata.
Address | Register | Value | Notes | Requires Modification | |
---|---|---|---|---|---|
Initiator | Target | ||||
0x00 | Chip status control | 0x01 | 5-V operation | Yes | Yes |
0x01 | ISO control | 0x21 | Passive target | Yes | Yes |
0x02 | ISO14443B TX options | 0x00 | Automatic single device detection (SDD) disabled | No | No |
0x03 | ISO14443A high bit-rate options | 0x00 | See TRF7970A data sheet | No | No |
0x04 | TX timer setting, H-byte | 0xC1 | See TRF7970A data sheet | No | No |
0x05 | TX timer setting, L-byte | 0xC1 | See TRF7970A data sheet | No | No |
0x06 | TX pulse-length control | 0x00 | See TRF7970A data sheet | No | No |
0x07 | RX no response wait | 0x0E | See TRF7970A data sheet | No | No |
0x08 | RX wait time | 0x07 | See TRF7970A data sheet | No | No |
0x09 | Modulator and SYS_CLK control | 0x91 | 27-MHz crystal enabled, SYS_CLK enabled, OOK (100%) | Yes | Yes |
0x0A | RX special setting | 0x10 | Band-pass 100 kHz to 1.5 MHz | Yes | Yes |
0x0B | Regulator and I/O control | 0x87 | Automatic VDD RF | Yes | Yes |
0x0C | IRQ status | 0x00 | See TRF7970A data sheet | No | No |
0x0D | Collision position and interrupt mask | 0x3E | See TRF7970A data sheet | No | No |
0x0E | Collision position | 0x00 | See TRF7970A data sheet | No | No |
0x0F | RSSI levels and oscillator status | 0x40 | See TRF7970A data sheet | No | No |
0x10 | Special function | 0x00 | See TRF7970A data sheet | No | No |
0x11 | Special function | 0x00 | See TRF7970A data sheet | No | No |
0x12 | RAM | 0x00 | See TRF7970A data sheet | No | No |
0x13 | RAM | 0x00 | See TRF7970A data sheet | No | No |
0x14 | Adjustable FIFO IRQ levels | 0x00 | See TRF7970A data sheet | Optional | Optional |
0x15 | Reserved | 0x00 | N/A | No | No |
0x16 | NFC low field detection level | 0x00 | See TRF7970A data sheet | No | Yes |
0x18 | NFC target detection level | 0x00 | See TRF7970A data sheet | Yes | Yes |
0x19 | NFC target protocol | 0x00 | See TRF7970A data sheet | No | No |
0x1A | Test | 0x00 | See TRF7970A data sheet | No | No |
0x1B | Test | 0x00 | See TRF7970A data sheet | No | No |
0x1C | FIFO status | 0x00 | See TRF7970A data sheet | No | No |