NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
SLOA137 ISO14443B MSP430F2370 MSP430 ISO15693 TRF7960-61 SLOU186 ISO14443A - Datasheet Archive
SLOA137 April 2009 Implementation of the ISO14443B Protocol in the TI TRF796x ShreHarsha Rao
Application Report SLOA137 SLOA137 April 2009 Implementation of the ISO14443B ISO14443B Protocol in the TI TRF796x ShreHarsha Rao . ABSTRACT This application note discusses the anti-collision sequence (slot marker method) of the ISO14443B ISO14443B standard implemented in the MSP430F2370 MSP430F2370 (a 16-bit ultra-low power microcontroller from the TI MSP430 MSP430 family) used with Texas Instruments' TRF796x, a fully integrated 13.56-MHz radio frequency identification (RFID) analog front end and data framing reader system. This document is designed for use by customers who are familiar with RFID and firmware development and want to develop their own application using the TRF796x. This reference guide should be used in conjunction with the ISO14443B ISO14443B standard which specifies the standard protocol, commands and other parameters required for communication between the transponder and the reader. 1 2 3 Contents Anti-Collision Sequence for ISO14443B ISO14443B . Pseudo-Code for ISO14443B ISO14443B Tag Detection . 2.1 Setting Up of Registers . 2.2 Enable No Response Interrupt . 2.3 Send REQB Command . 2.4 Send Slot Marker Command . Interrupt Handler Routine . 2 2 2 2 3 4 6 List of Figures 1 2 3 4 AntiCollisionLoop . Inerrupt Handler Routine (1) . Interrupt Handler Routine (2). Inerrupt Handler Routine (3) . 5 7 8 9 List of Tables 1 2 3 4 5 REQB Format . 3 Slot Marker Command Format . 4 . 4 Inerrupt Conditions . 6 IRQ Status Register . 6 SLOA137 SLOA137 April 2009 Submit Documentation Feedback in the TI TRF796x 1 Anti-Collision Sequence for ISO14443B ISO14443B 1 www.ti.com Anti-Collision Sequence for ISO14443B ISO14443B The following describes the anti-collision sequence for the ISO14443B ISO14443B. The commands used by the PCD during anti collision are: · REQB The REQB commands are sent by the PCD initially to probe the field for PICCs of Type B. Parameter `N' in the REQB command defines the number of slots to be used in the anti-collision sequence. · Slot Marker Command After the REQB command, the PCD may send up to (N-1) Slot Marker Commands to define the start of each timeslot. Each Slot Marker command has 1 byte which defines the slot number. The PCD initiates communication with the tag(s) by sending a REQB command. The PICC checks the parameter `N' on reception of the REQB command. If N = 1, the PICC responds with an ATQB message immediately. If N>1, the PICC internally generates a random number R which is evenly distributed between 1 and N. If R = 1, the PICC immediately sends an ATQB message. If R > 1, the PICCs wait for the Slot Marker command with a matched slot number (slot number = R) before sending the ATQB. If there is no collision, the reader reads the data bytes (PUPI) in the FIFO. If there is collision, the PCD repeats the anti-collision sequence until there are no collisions. 2 Pseudo-Code for ISO14443B ISO14443B Tag Detection 2.1 Setting Up of Registers The default configuration after power-up supports ISO15693 ISO15693, single sub-carrier, high data rate, 1-out-of-4 operation. To enter another protocol (ISO14443B ISO14443B in this case), the ISO Control register (0x01) has to be written to with the appropriate data byte. For example, to choose an ISO14443B ISO14443B, 106-Kbps protocol, the ISO Control register is written with 0x0C. All the low level options register (0x02 to 0x0B) are automatically set according to the new protocol. Next the RF field and receivers should be turned on. This can be done by setting bit B5 in the Chip Status Control (0x00) register. Now the reader is ready to transmit commands to the tag. 2.2 Enable No Response Interrupt During an inventory process, when the PCD receives no response from the PICC, it shall wait for a preset time (defined in RX No Response Wait Time register) before sending the Slot Marker command. The TRF796x informs the microcontroller when to send the Slot Marker command to the TRF796x via a no response interrupt. This is enabled by setting bit B0 in the Collision Position and Interrupt Mask register (CPIM). Thus if there is no response within the defined time, an interrupt request is sent and a flag is set in the IRQ Status register. Pseudo-Code: Read the Collision Position and Interrupt Mask register value. Set bit B0. Write the final value to the Collision Position and Interrupt Mask register. The Collision Position and Interrupt Mask register has masks for other interrupts like collision, errors, etc. To ensure that the mask status is maintained for other interrupts, the CPIM register is read first and then the bit zero (corresponding to No Response Interrupt) alone is set in the value obtained from the read. Alternately, if the mask status is known for all the interrupts, the register can be directly written to with the desired value, thereby avoiding the read operation. 2 in the TI TRF796x SLOA137 SLOA137 April 2009 Submit Documentation Feedback Pseudo-Code for ISO14443B ISO14443B Tag Detection www.ti.com 2.3 Send REQB Command Note: The general procedure to start transmission is described below. This is applicable to all commands that need to be transmitted to the tag. The data/command that is to be transmitted is written in to the FIFO, a 12 byte buffer. Transmission starts when the first data byte is written into FIFO. The reader adds SOF, EOF and CRC to the request packet before transmitting. 1. 2. 3. 4. 5. 6. 7. 8. Start condition Send Reset command 0x0F (command mode 0x8F) Send Transmission command (0x90 - without CRC or 0x91 with CRC) Continuous write to register 0x1D (0x3D) Data for register 0x1D (upper and middle nibble of the number of bytes to be transmitted) Data for register 0x1E (lower nibble of the number of bytes to be transmitted) Data byte(s) for FIFO Stop condition Note that the FIFO can be written to (and read from) in continuous mode only. For details on the Start and Stop conditions, refer to the timing diagrams for SPI/Parallel mode. The REQB format (according to the ISO 14443-3 spec) is as follows: Table 1. REQB Format APf AFI PARAM CRC_B 8 bits 8 bits 8 bits 16 bits As mentioned earlier, the SOF, CRC_B and EOF will be added automatically by the reader. Only the anti-collision prefix (APf), application family identifier (AFI) and parameters (PARAM) bytes have to written to the FIFO for transmission. Pseudo-Code: buf is an array that holds all the command/data bytes that are to be sent to the reader. size is the number of bytes to be transmitted. In this case, size = 3. AFI is the application family identifier. If 0, all the PICCs process the REQB command. buf[0] = 0x8f; /* Reset FIFO command */ buf[1] = 0x91; /* Send with CRC */ buf[2] = 0x3d; /* Write continuous from register 1D */ buf[3] = (char) (size >> 8); /* Data for register 1D */ buf[4] = (char) (size