ISO14443 Type B Card anti-collision process and command parsing

Source: Internet
Author: User

First, Introduction

This post describes the PCD (Proximity coupling Device) using the iso14443-3 Type B protocol to detect the matching PICC (Polling for Proximity Cards) command and anti-collision process (Anticollision proccess).

Second, Command 2.1 REQBAnd WUPB2.1.1 Overview

The REQB command and the WUPB command are the commands that PCD uses to detect whether the PICC is in an infinite RF field (RF). Where the REQB command is used when PCD is just beginning to detect the PICC in RF, while the WUPB is used when the PCD wakes the PICC in the stopped state (HALT).

2.1.2 Command format

Description
(1) The anti-collision prefix APF has a value of 0x05, i.e. (0000 0101) B.
(2) Application Family Identifier (AFI) indicates the type of PICC detected by PCD, and if the value of AFI is 0, it means that PCD detects all supported PICC types. The types supported by AFI are as shown.
Note: The range of values for x and Y is 0x1~0xf.
(3) The encoding format of the Param is as shown.

Note:
A, all reserved for the future ISO/IEC use (RFU) bits are 0.
B, if the B4 bit is 0, indicating that the command is the REQB command, PCD can use the command to detect the PICC in the idle state, or ready state, if the B4 bit is 1, which means that the WUPB command, PCD can be in idle state (idle State), ready states, or stop states (HALT state) Use this command to detect PICC.
C, B1, B2, and B3 together make up the slot sequence numbers (number of slots). It's encoded as well as the meanings shown.

Note: For each PICC, the probability of using ATQB to respond to REQB first slot ordinal is 1/n. Therefore, if PCD is using a probabilistic response method, n is not used as the value of the adjustment slot ordinal, but the PICC will return its UID in the specified ATQB slot sequence number. That is, N is only the total number of slots, but the response probability of each PICC in 0~n is 1/n,n not encoded in ATQB B1, B2, and B2.

2.2 Slot-marker2.2.1 Overview

After PCD sends out the REQB/WUPB command, it can send (N-1) a slot-marker command in slot ordinal N. The Slot-marker command is sent in the following two scenarios.
A, PCD received the ATQB command of PICC after the start of the next slot (time slot), that is, when the next command is sent.
B, if the slot is known to be empty, and no atqb arrives, then there is no need to wait for ATQB until the end of the slot. That is, B1, B2 and B3 are all 0 o'clock.
Note: This command is not mandatory to be supported by PICC. If PICC does not support this command, it will ignore the command. At this time, PICC can only pass the probability of the method with ATQB to respond to the REQB command of PCD.

2.2.2 Command format

Description
A, the APN is the first byte of the Slot-marker command, and its binary representation is (nnnn 0101) B, i.e. its low four bits are fixed bit 0x5, i.e. (0101) b; Gausibit bit encoding is shown below.

Note: The Slot-marker command does not force a requirement to increment with the slot ordinal, as long as it is between 0~n.

2.3 ATQB2.3.1 Overview

The ATQB command is a response to the REQB/WUPB and Slot-marker commands issued by the PICC to PCD.

2.3.2 Command format

Description
(1) The first byte value is 0x50, which is the prefix of the ATQB command.
(2) The second to fifth byte represents the pseudo Unique PICC Identifier (Pupi) of PICC, which is the type B card number. Indicates that the type B has a card number of only four bytes.
(3) The six-to-nineth byte is the application (application data), and its encoding and meaning are as follows.

Note:
A, the first byte of the application data is AFI, which indicates the purpose of the card.
B, Crc_b calculation method refer to Iso14443-3 document.
C, the application ordinal (number of applications) takes one byte. A high of four bits is consistent with AFI, ' 0 ' means no application, ' 0xF ' means 15 applications or more; Low four bits represent the total number of applications, ' 0 ' means no applications, ' 0xF ' means 15 applications or more.
(4) The 12th byte is the protocol information (Protocol info). Its encoding and meaning is as follows.

Note:
1) The first byte represents the rate at which the data is transmitted. Coding and meaning are as follows

2) The Gausibit bit of the second byte represents the maximum frame value (max_frame_size), and the low four bit is the protocol type supported by PICC (Protocol_type).

A, maximum frame value encoding and meaning as shown.

B, the Protocol type code and the meaning as shown.

3) The third byte is divided into Fwi, ADC and fo three parts.
A, the first part is the Gausibit bit of the frame waiting for the integer time frame waiting times integer (FWI), which is used to define the frame wait time for frame waiting times (FWT). It represents the maximum time for the PICC to respond to PCD, and the conversion between FWI and FWT is: FWT = (16/FC) * 2^fwi, where the FWI value range is 0~14,FC is the frequency of the RF field 13.56MHz.
The second part is the Application data encoding (Application Data Coding) supported by B4 and B3 bits of PICC. Their encoding and meaning are shown below.

C, the third part is B2 and B1 bit of PICC supported frame options (frame option). They are encoded as well as the meanings shown.

2.4 ATTRIB2.4.1 Overview

The order is issued by PCD to PICC, once the order is sent, it means that PICC has been determined.

2.4.2 Command format

Description
(1) The first byte value is 0x1d, which is the attrib command prefix.
(2) The second to fifth byte is the card number of type B identifier, and the value is the same as Pupi.
(3) The sixth byte we call the parameter 1, and its encoding and meaning are as follows.

Description
1) B8 and B7 bits represent minimum TR0, meaning the minimum delay time for the PICC to respond to the PCD command. Its encoding and meaning is as follows.

2) B6 and B5 bits represent the minimum TR1, meaning the minimum delay time that the PICC subcarrier modulation begins to transmit data. Its encoding and meaning is as follows.

3) B4 bit indicates whether a frame end ID is required, 0 means required, and 1 means no.
4) B3 bit indicates whether a frame start ID is required, 0 means required, and 1 means no.
(4) The seventh byte we call a parameter 2. Its encoding and meaning is as follows.
1) B8 and B7 bits are encoded and have the following meanings.

2) B6 and B5 bits are encoded and have the following meanings.

3) B4 to B1 bits represent the size of the maximum received frame of PCD, and these four bits represent the following meanings.

(5) The eighth byte we call a parameter 3. Its Gausibit bit is RFU, reserved for the future, with a value of 0; Low four bit defines the protocol type that PICC supports.
(6) The nineth byte we call a parameter 4. Its Gausibit bit is RFU, the value is 0, the low four bit is CID, and its value range is 0~14. PCD defines each activated PICC must have its own unique CID, if the PICC does not support CID, then the CID value is (0000) b.
(10) The remaining bytes are high-level information, it is optional, depending on the circumstances. PICC does not require the inclusion of this part of the information. However, like the ID card type, must have high-level information.

2.5 response of the attrib commandCommand format

Description
(1) The first byte is divided into two parts: the Gausibit bit is maximum buffer Length Index (mbli), which allows PCD to know the limits of the PICC internal buffering to the receiving frame. If the value of Mbli is 0, it means that PICC does not provide information to the internal input buffer, and if Mbli is greater than 0, then mbl= (PICC maximum frame size) *2^ (MBLI-1), PICC will return the size of PICC maximum frame in ATQB. When PICC sends MBL, PCD should ensure that the frame length does not exceed MBL. The lower four bit is the CID returned by PICC to PCD and returns (0000) b If the PICC does not support CID.
(2) High-level information response bytes may or may not be available depending on the card itself.

2.6 HLTB2.6.1 Overview

This command is used to set the PICC to be in the stopped state (HALT), and let it not respond to the REQB command. After the command is sent, all other commands are ignored and only the WUPB command responds.

2.6.2 command format

Description
(1) The first byte value is 0x50, which is the HLTB command prefix.
(2) The second to the fifth byte is PICC's card number identifier, namely Pupi.
(3) The last two bytes are crc_b, and the calculation method refers to the iso14443-3 document.

2.7 HLTB Command ResponseCommand format

Third, PCD detection of PICC process flow chart

Note:
A, R is a random number generated by the PICC between 1~n.
B, Option 1 is a PICC branch that does not support the Slot-marker command. Option 2 is a PICC branch that supports the Slot-marker command.

Four, anti-collision Process 4.1 description

The anti-collision process is performed by some commands, and PCD starts using the REQB command and communicates with one or more of the PICC that sends the ATQB. If you send REQB in PCD with more than one PICC sending ATQB response REQB, we call this phenomenon "collision". The series of commands that PCD performs in the anti-collision process is to select a specific PICC. When PCD finishes the anti-collision process, the selected PICC's communication will be controlled by PCD

4.2 Principle

The principle of anti-collision process is based on the time slot, during the anti-collision process, PICC will transfer the application data in the shortest time. In the REQB/WUPB command that is sent by PCD, the slot sequence number may change, the PICC in each time slot and other possible response slot sequence number, all of the PICC can be in the anti-collision process to answer (send ATQB). PCD in the anti-collision process set up the command depends on the use of PCD strategy, it can either use the probability method (repeat single slot sequence number, so that the PICC's random number equals 1 o'clock response), can also use pseudo-determination method (multi-slot serial number, in the collision process all PICC can respond, in a specific slot serial number to determine PICC).

4.3 rules

When PICC receives the REQB/WUPB command and is in ready-requested sub-state, the response of PICC should follow the following rules (n is the parameter in the REQB/WUPB command):
--If N=1,PICC should send ATQB and enter ready-declared sub-state.
--If n>1:

PICC can use the probability method (PCD detects option 1 in the PICC flowchart), and enters the idle state (idle);
PICC adopts the method of sending Slot-marker command (PCD detects option 2 in PICC flowchart), until the slot number equals R, then PICC sends ATQB and enters Ready-declared sub-state.

V. Examples


ISO14443 Type B Card anti-collision process and command parsing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.