NFC WISP Firmware Ver 0.2 Documentation (01.18.2013)

Authors: Jeremy Gummeson and Derek Thrasher

Introduction

This version of the NFC WISP Firmware is written for the NFC-WISP Version 0.1. The code implements a complete send/receive communication stack for ISO 15693. The specific protocol settings we support are 1-out-of-4 encoding (Reader to tag) and single subcarrier (Tag to reader). We implement the single slot anti-collision protocol as specified in ISO-15693-2.

We have tested this firmware against a Texas Instruments TRF7970A evaluation module, which was configured to use the above settings using the supplied GUI software from TI.

ISO 15693 Signal Interface

A reader that implements ISO 15693 sends data by inserting pauses in a 13.56 MHz carrier wave. The 13.56 MHz carrier is received by a tag that observes the voltage across a coil antenna tuned to resonance. Due to magnetic coupling, the tag will see the same 13.56 MHz carrier with pauses.

The NFC-WISP rectifies the AC voltage across its coil loop antenna and uses a comparator circuit to provide a logic level signal that denotes where and how long reader pauses are inserted into the carrier.

To encode data that may be decoded by a tag, the reader splits the subcarrier into fixed-length periods, where the position of a negative pulse within the period defines the data sent. In 1 out of 256 encoding, this period contains 8 bits (1 byte); in 1 out of 4 encoding, each period contains a pair of bits. Since the current firmware only supports 1 out of 4 encoding, this document focuses exclusively on 1 out of 4 encoding.

In order to define the boundaries for each period that contains the reader’s transmitted bits, the reader will first send a start of frame (SOF) delimiter. This delimiter is used to both determine the encoding of the frame that follows and serve as a timing reference. A delimiter consists of 2 37.76 µs periods; an example of the SOF used for 1 out of 4 encoding is shown in Figure 1.

Figure 1: ISO 15693 SOF (Taken from ISO 15693-2)

To decode this delimiter, a receive looks for a falling edge, which denotes the beginning of the first 37.76 µs period. During the 1st quarter of the first period, the logic level is low and high for the rest of the period. During the second period, the 2nd quarter of the period is expected to be low, while the rest is high. The SOF has a total length of 75.52 µs.

After sending an SOF, the reader sends the subsequent bytes of a message frame. Following the transmission of the SOF, the reader encodes pairs of bits within 75.52 µs periods. Unlike the SOF, the reader inserts a single pause into the carrier which translates into a single negative pulse. The timings used to encode different pairs of bits are shown in Figure 2.

Figure 2: Pulse timings for 1 out of 4 encoding (Taken from ISO 15693-2)

After encoding a set of bytes, the end of frame (EOF) is denoted by another delimiter; an example of the EOF is shown in Figure 3. Unlike the SOF and encoded bit timings, the EOF is 37.76 µs in length. Since a negative pulse is inserted after 18.88 µs, it can be uniquely distinguished between encoded data used in both 1 out of 4 and 356 encodings.

Figure 3: Timing of an EOF delimiter (Taken from ISO 15693-2)

ISO 15693 Protocol Description

Using the signaling primitives described in the previous section, a reader builds up message frames that follow a transmission protocol. A generalized example of a transmission frame is shown in Figure 4.

Figure 4: An example of an ISO 15693 Request frame (Taken from ISO 15693-3)

With the exception of the SOF and EOF, each of the fields shown contain an integer number of bytes. A brief description of each field is described below:

Flags:

A set of 8 flags (1 byte) describe how the subsequent fields of a frame are set. Flags also specify how a tag should encode data sent back to the reader. In the simplest scenario, the reader will initially set the flags field to (0x04), where only a single flag in bit position 3 is set to indicate that an inventory is taking place.

Command Code:

This field describes how the rest of the frame should be interpreted. A command code is 1 byte in length. Values in the range of 0x01 to 0x1F are required for ISO 15693 compliance; values in the range 0xA0 to 0xDF may be used to define custom commands, while values in the range of 0xE0 to 0xFF should not be used, as they are proprietary and used for programming or testing. The command values of particular interest are:

0x01 – Inventory:

Figure 5: Definition of an Inventory Command (From ISO 15693-2)

An inventory command contains the previously described flags field and has its command code value set to Inventory (0x01). The following field contains an optional application family identifier (AFI) which is used to distinguish between different classes of applications. In the simplest case, this field is not present. The mask length field is used during the inventory processes to singulate an individual tag. Since tags contain 64-bit IDs, the mask length field will be between 0 (no mask) and 64 bits in length. The mask value contains the actual mask that should be used during inventory; if this does not result in an even number of bytes, the mask is padded with 0s such that a minimal number of bytes are used. Finally, the message integrity is protected using a 16-bit CRC.


Figure 6: Definition of an Inventory Response (taken from ISO 15693-3)

A frame sent in response to an inventory command is similar to the structure of a request. After the SOF, the subsequent field specifies flags that are used to denote error conditions. In the ideal case, all of these flags are set to 0 (Flags == 0x00). DSFID is a 1-byte field used to indicate how data is organized on the tag. The UID is a globally unique 64-bit identifier used to distinguish different tags. Finally, the CRC16 provides frame integrity and the frame terminates with an EOF.
0x02 – Stay Quiet
To Do
0x20 – Read Single Block
To Do
0x21 – Write Single Block
To Do
0x23 – Read Multiple Blocks
To Do
0x24 – Write Multiple Blocks
To Do
0x25 – Select
To Do
0x26 – Reset to Ready
To Do