Research and Implementation of TYPE B Non-contact IC Card Anti-collision Principle

1 Introduction

Non-contact IC card, also known as radio frequency card, is a new technology developed in recent years, and it is also a product of the organic combination of radio frequency identification technology and IC card technology. Compared with bar code cards, magnetic cards, and contact IC cards, non-contact IC cards are characterized by high security, high reliability, and convenient and fast use. The card and the reader can also be operated in the relative motion. Within the identifiable range of the reader antenna, multiple cards may appear at the same time. How to complete the identification of each workable card and make the correct communication is the problem to be solved by the anti-collision technology of the contactless smart card.

2 TYPE B non-contact IC card works

The non-contact IC card is composed of an RF circuit including an inductor coil or a small-sized high-frequency transceiver antenna, an energy conversion module, and a microprocessor system. The RF circuit is mainly used to complete the communication between the card and the reading and writing device; the energy conversion module is used to generate the clock signal and the power energy required for the card work from the received RF signal, and the basic working principle is based on the RF identification technology RF ID. The operating frequency of the RF field is 13.56 MHz, and the asynchronous half-duplex mode is used for communication between the reader and the card, and the amplitude modulation modulation method is adopted. The TYPE B communication protocol defined in the ISO 1443-2 international standard stipulates that the signal modulation method from the reader to the card adopts ASK 10%, and the encoding adopts the NRZ method. The signal modulation method from the card to the reader is BPSK, and the encoding is BPSK Manchester. The ASK 10% modulation mode signal adopted by TYPE B has no carrier rest, so it is more stable and can meet the requirements of high-speed communication in the future.

3 anti-collision implementation method when multiple cards appear in the terminal operation range at the same time

3. 1 instructions for the anti-collision process

The anti-collision of TYPE B is that the card reader performs an orderly operation on the valid cards entering the read/write range. During this process, the reader is always active, managing communication with multiple cards through a single command set. The internal operating system of the card can process the set of commands issued by the reader. When the reader detects a collision, the reader must perform a corresponding anticollision process to identify each work card and prepare to enter a higher layer of the transport protocol for subsequent communication. The instructions for TYPE B in the ISO/IEC 14443-3 protocol for anti-collision procedures are as follows:

REQB /WUPB: Used to query the card in the antenna working area. The command contains the AFI application class identifier and the number of slots N. The WUBP can also be used to wake up the card in the suspended state.

SLOTMARKER: Used to issue a query command to the card in slot N that is included in the command.

ATQB: Used to respond to the REQB /WUPB and SLOTMARKER instructions received by the card. In addition to giving the application data and the protocol information supported on the card, it also gives the 4-byte card unique identification number PUP I used to distinguish the cards in the anti-collision process.

ATTR IB: Used to select the card specified by PUP I in the command. At the same time, the protocol information of the reader and the unique channel identification CID for the multi-card communication environment are also given. ATB: The response of the card to the ATTR IB command.

HLTB: Used to place the card in the HALT suspended state. The card in the suspended state only responds to the WUBP.

ATH: The response of the card to the HLTB command.

3. 2 Status during conflict prevention

In order to cooperate with the command of the card reader, the card operating system (COS) processes the commands sent by the card reader in the form of a state machine. To this end, the card defines five processing states, namely, the POWEROFF state, the IDLE state, and the READY. Status, ACTIVE status, and HALT status.

POWER OFF state: The card has no energy because there is no carrier energy.

IDLE state: After the card is powered on, it enters the IDLE state. This is the REQB or WUPB command that the card only sends to the card reader and matches the card itself AF I.

READY state: In this state the card only processes valid ATTR IB or HLTB.

ACTIVE state: In this state, the card can receive high-level commands and process them.

HALT state: Only the WUBP command is accepted in this state.

Anti-collision process instance diagram

Figure 1 Anti-collision process example diagram

3. 3 anti-collision process

Step 1: If there are multiple cards entering the RF field, after the card reader detects the conflict, send a multi-slot REQB or WUBP command with the AF I application identifier, and those cards that match the AF I generate an internal random The number R, R ranges from 1 to N, and the card with R = 1 is the card in the 1 slot, and the ATQB is returned to the card reader. If more than one card returns to ATQB in 1 time slot, a new conflict occurs, and these cards cannot be recognized in this anti-collision cycle, waiting for the next anti-collision cycle; if there is only one card and it is correct To reply to ATQB, the reader can then issue an ATTR IB or HALT command; if an AT2TR IB command is issued, the card is selected to enter the ACTIVE state, at which point the card can accept high-level commands and process, and the REQB and WUPB commands are invalid until the card Leave the RF field; if the HLTB command is issued, the card enters the HALT state, at which point the card only accepts the WUBP command until the card leaves the RF field.

The second step: the card reader sends the SLOTMARKER command, and checks the N-1 time slots from 2 to N in order from small to large. The principle and process of selecting the card are the same as the first step.

Step 3: If a card is not recognized after an anti-collision cycle, continue with steps 1 and 2 until all cards are recognized.

The anti-collision cycle allows one or more cards to be selected for further high-level communication at any time.

3. 4 Anti-collision process instance

An example is shown in Figure 1. It is assumed that three cards enter the RF field at the same time, and the application types of the three cards are different. First, the card reader issues a single-slot REQB command, and both card 1 and card 3 reply to ATQB. After the card reader detects the conflict, the card re-transmits the REQB command of 4 slots, and card 1 selects slot 2, this time does not reply. ATQB; Card 3 selects 1 time slot and immediately replies to ATQB; the card 2 type does not match, so no response is made. Then the card reader sends the SLOTMARKER command of time slot 2, the card 1 returns AT2QB; the card 2 type does not match, or does not reply, the card 3 time slot does not match and does not reply. The card reader then issues the SLOTMARKER command for time slot 3 and time slot 4, cards 1 and 3 are not in these 2 time slots, no reply is made; card 2 is not in the correct type and does not respond; at this time cards 1 and 3 are waiting HLTB or ATTR IB, so there is no reply in these 2 slots. The card reader then sends the SLOTMARKER command for time slot 3 and time slot 4, cards 1 and 3 are not in these 2 time slots, no reply is made; card 2 is not correct in type and does not respond; at this time cards 1 and 3 are waiting HLTB or ATTR IB, so there is no reply in these 2 slots.

4 experiment

The reader is designed with P IC16F876 microcontroller and MF RC531 ISO14443 reader chip from PH IL2IP, which complies with ISO14443-A and ISO14443-B. The RC531 can read TYPE A and TYPE B cards, and can complete all the work required to generate RF fields, send and receive data, check CRC, etc. It performs the corresponding operations according to the commands issued by the microcontroller, and uses the C language in the programming language.

5 Conclusion

In most practical applications, only one card (such as an attendance machine) will appear in the RF field at the same time, so the entire system is constantly sending a single-slot card reading command in the default state. When a conflict is detected, taking into account the range of the RF field (10 cm) and the actual application, a 4-slot read command is issued to perform an anti-collision cycle. This design not only ensures that the card reader accurately and quickly identifies the card in most cases, but also ensures the correct identification of multiple cards in the event of a conflict. In addition, because the software is written in C language, the code is efficient and portable. For other microcontrollers, the design of the RC531 can be applied without major modifications. According to the anti-collision model, the anti-collision protocol is implemented on PH IL IP's RC531 contactless IC card chip. The practical application proves that the system runs efficiently and correctly.

(Text / School of Information Engineering, Wuhan University of Technology, Zhu Can, Liang Chuyi)

Whiten And Brighten Skin Mask

White Skin Mask,Brightening Skin Mask,Arbutin Mask,Brighten The Skin Mask

Guangdong Yueji Cosmetics Co., Ltd , https://www.mask-family.com

Posted on