Initialization and anticollision (ISO/IEC 14433-3)
When a proximity card comes within the working range of a terminal, communications between the card and the terminal must first be established. It may happen that the terminal is already communicating with another card, or that several cards are concurrently present within the working range of the terminal. Means must be provided to allow interference-free communication with a single card or a specific group of cards to occur under such conditions. Establishing communications between a card and a terminal and the anticollision methods to be used for selecting a individual card are described in Part 3 of ISO/IEC 14 433. Due to the use of different modulation methods, Type-A and Type-B cards also have different protocol frames and anticollision methods.

Mifare DESFire EV1 8K Contactless Smart Cards,RFID Mifare DESFire EV1 8K Printing Cards,Mifare DESFire EV1 8K Plain White Cards,

Figure 3.92 Coding of a bit sequence from the card to the terminal for a Type-B communications interface with a subcarrier of fC/16 (≈847 kHz), BPSK, NRZ coding and a bit rate of 106 kbit/s. The figure shows the voltage on the coil in the card

Type-A initialization and anticollision
A dynamic binary search algorithm is used to initialize and select Type-A cards. With this method, it is necessary for the terminal to be able to recognize a data collision at the bit level. As explained below, the Manchester coding used here makes bitwise collision detection possible (see Figure 3.97). However, this requires all cards within the working range of the terminal to transmit their data synchronously. If a proximity card comes into the field of a terminal, the microprocessor in the card is supplied with power, and following the power-on reset the card enters the Idle state. In this state, the card is only allowed to respond to a REQA (Request Type-A) command or a
WUPA (Wake-up Type-A) command. All other commands transmitted by the terminal for communicating with any other Type-A or Type-B cards already present within the working
range of the terminal must be ignored in order to avoid interfering with these communications. The state diagram shown in Figure 3.93 shows all possible states that can be assumed by a Type-A card during the initialization and anticollision phase. As already mentioned, the card enters the Idle state after the power-on reset. The standard requires the card to enter the Idle state within 5 ms after it receives adequate operating power from the terminal’s field. In the Idle state, the card awaits further commands. It changes to the Ready state when it recognizes aREQAorWUPAcommand, but it ignores all other commands. In order to ensure a high level of reliability for recognizing the REQA and WUPA commands, they are transferred using special short frames. All other commands except anticollision commands are transmitted using standard frames. Special frames called ‘bit-oriented anticollision frames’ are defined for the anticollision commands.

Mifare DESFire EV1 8K Blank White Cards,Mifare DESFire 8K Pre-printed Cards,Clamshell MIFARE DESFire EV1 8K Card,

Figure 3.93 State diagram of a Type-A PICC during the initialization and anticollision phase. The abbreviations are explained in the text

Short frames
As already mentioned, short frames are only used for the initialization commands. A short frame consists of nine bits in the following sequence:
–one message start bit
–seven data bits starting with the least significant bit (lsb first)
–one message stop bit.
The coding rules for the start and end bits and the data bits are described in Section 3.6.3.1.

Mifare DESFire EV1 8K Access Control Cards,Mifare DESFire 8K Offset Printing Card,Mifare DESFire EV1 8K Silk Screen Printing Cards,

Figure 3.94 Structure of a short frame

Table 3.7 shows the coding of the REQA and WUPA commands, which are the only types of commands transmitted using short frames.

Table 3.7 Coding of the REQA and WUPA commands, which use the short-frame format with seven data bits

NXP MF3ICD81 Cards,Mifare DESFire 8K Offset Printing Card,Mifare DESFire EV1 8K Contactless Smart Cards,Mifare DESFire 8K Card

The REQA and WUPA commands are transmitted by the terminal to determine whether any cards are present within the working range of the terminal (see Figure 3.93).
Standard frames
Standard frames are used for regular data exchanges. A standard frame consists of:
–start of message
–n × (8 data bits + odd-parity bit), with n ≥ 1
–end of message.

Mifare DESFire EV1 8K,NXP DESFire 8K Pre-printed Card,Mifare DESFire 8K Printing Card,Mifare DESFire EV1 8K ISO Printing Cards,

Figure 3.95 Structure of a standard frame

Mifare DESFire EV1 8K Printing Cards,Mifare DESFire EV1 8K Proximity Cards,NXP Mifare DESFire D81 ISO Card,Mifare DESFire EV1 8K Pre-printed Cards,

Figure 3.96 Coding of ATQA. All RFU bits must be set to 0. Bits 9–12 can be used to indicate other, non-standardized methods. One of bits b1–b5 must be set to 1. Bits b7 and b8 indicate the size of the UID

When the card changes to the Ready state, it transmits an Answer to Request, Type A (ATQA) after a precisely defined frame delay time (see Figure 3.98). An ATQA consists of
two bytes, and due to the uniquely specified frame delay time, all ATQA messages are sent synchronously by all addressed cards. Figure 3.96 show the coding of the ATQA message.
When the terminal receives an ATQA, it recognizes that at least one card is present within its working range. It then initiates the anticollision procedure, which also allows it to read the Type-A unique identifier (UID), by transmitting a SELECT command. If the terminal is able to determine the complete identifier, it transmits a SELECT command containing this identifier. The card with the corresponding identifier confirms this command by transmitting a SELECT Acknowledge (SAK) message and changes to the Active state. In the Active state, the card can communicate using higher level protocols (such as those defined in ISO/IEC 14 443-4).

The card can be put into the Halt state by transmitting a HLTA command (Halt Command Type A). The card can also be put into the Halt state by means of special commands belonging to higher level protocols. In the Halt state, the card only responds to a WUPA (Wake-Up Type A) command, to which it responds by transmitting an ATQA (Answer to Request, Type A) and changing to the Ready* state. The Ready* state is similar to the Ready state. The conditions for changing to the Active* state are shown in Figure 3.93. In detail, the procedure used for collision avoidance and determining the identifier works as follows. If two or more cards are concurrently in the Ready state and located within theworking range of a terminal, they react simultaneously to aSELECTcommand from the terminal by each transmitting a portion of their different identifiers. This is done using a special bit-oriented frame, which allows the direction of data transmission between the terminal and the cards to be reversed after an arbitrary number of data bits have been transmitted. If several cards transmitting different data are present, the terminal will receive the data superimposed on each other, and it can detect a collision by the fact that this superimposition will cause the carrier to be modulated by the subcarrier for the full duration of one or more of the bit intervals. This is an irregular state, since the Manchester coding used requires a pulse edge to always occur within each bit interval. Figure 3.97 illustrates how this irregular state is produced. In order for the terminal to be able to detect a collision at the bit level, all cards in the Ready state that are located within the working range of the terminal must respond to an ANTICOLLISION command at exactly the same time. To ensure this, the timing requirements imposed on the terminal and the card for exchanging frames are precisely specified in ISO/IEC 14 433-3.

Frame delay time (FDT)
The time between the end of the final pause transmitted by the terminal at the end of a message and the leading edge of the modulation pulse for the start bit transmitted by the card is designated the ‘frame delay time PCD to PICC’, which is abbreviated as FDT. This interval is defined in Figure 3.98. There are two different cases, depending on whether the final data bit transmitted by the terminal is a logic 1 or a logic 0. For the REQA/WUPA, ANTICOLLISION and SELECT commands, the value of n is set to 9, which means that FDT is 1236/ fC or 1172/ fC. This causes all cards within the working range of the terminal to respond synchronously to these commands, which are used in the anticollision loop. This makes it possible to detect collisions at the bit level. For all other commands, n ≥ 9. The time between the final modulation pulse transmitted by the card and the first pause signal transmitted by the terminal is designated the ‘frame delay time PICC to PCD’. This time is not significant for collision detection at the bit level. Consequently, it is not precisely specified in the standard. The only requirement is that it must be equal to or greater than 1172/ fC.

In addition, the minimum time between two successive REQA commands is specified to be 7000/ fC. This time is designated the ‘request guard time’. As can be seen in the following sections, if there are several PICCs within the working range of the terminal, it may be necessary for the terminal to execute the anticollision loop many times before it can address a specific card. In order to avoid spending an excessive amount of time executing this loop, a special bit-oriented frame is used for the anticollision (AC) command, which is a special form of the SELECT command. This type of frame, which is called a ‘bit-oriented anticollision frame’, is described below.

ISO MIFARE DESFire EV1 Smart Card 8k byte/64k bit,Mifare DESFire 8K RFID Cards,Mifare DESFire EV1 8K ISO Printing cards,

Figure 3.97 Collision of two bit sequences with Manchester coding (Type A).With an interference-free transmission, the carrier is always modulated by the subcarrier during only one half of each bit interval. If different bits are superimposed, modulation is present for the entire duration of the bit interval, allowing the terminal to detect a collision

ISO MIFARE DESFire EV1 8K Cards with Magnetic Stripe,Mifare DESFire EV1 8K Silk Screen Printing Cards,ISO 14443 A Mifare DESFire EV1 8K Cards,

Figure 3.98 Frame delay time PCD to PICC (FDT)

Bit-oriented anticollision frame
If the terminal (PCD) detects a collision, it responds by transmitting bit-oriented anticollision frames, which have the same structure as standard seven-byte frames but are divided into two parts. The first part is used to transfer data from the PCD to the PICC, while the second part is used to transfer data in the opposite direction, from the PICC to the PCD. The relative lengths of the two parts vary in successive executions of the anticollision loop. The sum of the number of data bits in the two parts is always 56. The following rules apply to the lengths of the two parts:
–Rule 1: the total number of data bits is 56.
–Rule 2: the minimum length of Part 1 is 16 data bits.
–Rule 3: the maximum length of Part 1 is 55 data bits.
Consequently, Part 2 has a minimum length of one data bit and a maximum length of 40 data bits.
The frame can be divided between the two parts at any desired location, which means that the division may also be located within a data byte. In this case, no parity bit is appended to the first part of the divided byte, and the parity bit of the second part of the byte is ignored by the PCD. Two examples of anticollision frames are shown in Figure 3.99.
Commands used in the anticollision loop
As already indicated by the state diagram in Figure 3.93, the following commands may be used during initialization and in the anticollision loop:
–REQA (Request command, Type A)
–WUPA (Wake-Up command, Type A)
–ANTICOLLISION
–SELECT
–HLTA (Halt command, Type A).
The ANTICOLLISION and SELECT commands
The ANTICOLLISION and SELECT commands are used in the anticollision loop. As can be seen in Figure 3.99, these commands consist of the following data fields:
–SEL (select code; 1 byte)
–NVB (number of valid bits; 1 byte)
–0–40 data bits for the identifier (UID), depending on the value of NVB.

ISO MIFARE DESFire EV1 8K Card,Mifare DESFire EV1 8K Plain White Cards,NXP Mifare DESFire EV1 8K Smart Card,

Figure 3.99 Two examples of bit-oriented anticollision frames. In the first example, the frame is divided after a full byte, while in the second example it is divided after the fifth bit of a data byte

The unique identifier (UID) may consist of 4 bytes (single size), 7 bytes (double size) or 10 bytes (triple size).
Table 3.8 Possible sizes for the unique identifier (UID)

Mifare DESFire EV1 8K ISO Printing Cards,Mifare DESFire EV1 8K Contactless Smart Cards,HF 13.56MHz DESFire EV1 8K Cards,

The UID may be a fixed number or a random number generated by the card. With doubleand triple-size identifiers, a cascade tag is transmitted as the first byte for cascade levels 1 and 2. The cascade tag is coded as’88′. In a single-size UID, the first byte is not allowed to have the value’88′.

Table 3.9 Coding of the SEL, which shows the current cascade level of the terminal

Mifare DESFire EV1 8K ISO Proximity Card,Mifare DESFire EV1 8K Full Color Offset Printing Cards,NXP Mifare DESFire EV1 8K Card,

At most four data bytes can be transmitted from the PCD within an ANTICOLLISION or SELECT command (see Figure 3.99). If the card has a double- or triple-size identifier, it
indicates this fact to the terminal in the SAK (Select Acknowledge) by setting the cascade bit, and it remains in the Ready state. The terminal will then start the anticollision procedure anew in order to ascertain bytes 5 though 7 of the UID.With a triple-size identifier, the anticollision procedure must be executed a third time to ascertain bytes 8 through 10. The terminal uses the SELECT command to inform the card of its current cascade level, in order to indicate which part of the UID is being requested (see Table 3.9).
This process is illustrated in Figure 3.100 in the form of a flow chart. If the NVB byte does not specify 40 bits, the command is an ANTICOLLISION command and the card remains in the Ready or Ready* state. Once the terminal has ascertained the full UID, it sends a SELECT command with NVB =’70′, which means that 40 data bits are specified. A CRC A checksum formed in accordance with ISO/IEC 13 239 is appended to this command. The computation of this checksum is described in the informational Annex A of ISO/IEC 14 433-3 by means of an example. If the card is addressed using a SELECT command with its full identifier, it changes from the Ready state to the Active state, or from the Ready* state to the Active* state (see Figure 3.93), and then transmits SAK (Select Acknowledge) to indicate that the UID is complete. The codings of NVB (number of valid bits) and SAK are
shown in Tables 3.10 and 3.11.

The procedure executed in the anticollision loop is shown in Figure 3.102 in the form of a flow chart for the terminal. This loop must be executed at every cascade level as long as the full UID is not known to the terminal. To illustrate the selection process, Figure 3.103 shows an example in which two cards are within range of the terminal. In this example, card 1 (PICC 1) has a single-size UID with a value of’10′for uid0, while card 2 (PICC 2) has a double-size UID. The terminal initiates the selection process by transmitting a REQA command. All cards within range of the terminal respond to this command. In this example, PICC 1 responds with an ATQA in which an anticollision bit frame is indicated by bit b1 being set and a single-size UID is indicated by bits b7 and b8 being cleared. PICC 2 also indicates an anticollision bit frame by setting bit b1 in its ATQA and indicates that it has a double-size UID by setting bit b7.

In the next step, the actual anticollision loop starts at cascade level 1. The terminal transmits an ANTICOLLISION command with a Select code of ’93′, which indicates an anticollision frame for cascade level 1. The value of ’20′ for NVB (number of valid bits) means that the terminal is not sending any portion of the cascade level 1 UID. Each card within range of the terminal thus responds with its full cascade level 1 UID. The first bit collision occurs at bit b4. The terminal recognizes this bit collision and sends a newANTICOLLISION command, this time containing the first three bits of the CL1 UID, which were received without errors, followed by a ˚1˚, and consequently with a value of’24′assigned to NVB. The first four bits now match the first four bits of the CL1 UID of card 2, but not the first four bits of the CL1 UID of card 1. Consequently, only card 2 responds with the remaining 36 bits of its CL1 UID. Since the terminal now knows the complete CL1 UID of card 2, it transmits a SELECT command for card 2, which responds with a SAK (Select Acknowledge) with the cascade bit (b3) set. From this, the terminal recognizes that the UID is not yet complete, so it increments the cascade level.

The terminal now sends a new ANTICOLLISION command with a Select code (SEL) indicating an anticollision bit frame and cascade level 2. NVB is set to’20′in order to request
the complete CL2 UID from the card. Card 2 responds to this command with all 40 bits of its CL2 UID. The terminal can now transmit a SELECT command containing all of the bits
of the CL2 UID, to which the card responds with a SAK in which cascade bit b3 is not set, indicating that its UID is complete. Card 2 now changes from the Ready state to the Active state, in which it can receive commands for higher level protocols.
ISO 14443 A Mifare DESFire EV1 8K Cards,Mifare DESFire EV1 8K Proximity Contactless Cards,NXP Mifare DESFire D81 ISO Card,

Figure 3.100 Flow chart for the process of selecting a particular card. After the terminal has transmitted a SELECT command, all cards in the Idle state respond simultaneously with ATQA

Mifare DESFire EV1 8K Clamshell Proximity Card,Mifare DESFire EV1 8K Contactless Smart Cards,ISO MIFARE DESFire EV1 8K Cards with Magnetic Stripe,

Figure 3.101 Format of SAK (Select Acknowledge). SAK is transmitted by the card when NVB indicates 40 data bits and these bits match the UID of the card

Table 3.10 Coding of NVB (number of valid bits). The upper four bits are called the ‘byte count’ and indicate the number of complete data bytes (including SEL and NVB) transmitted by the terminal. The lower four bits are called the ‘bit count’ and indicate the number of bits of any incomplete byte transmitted by the terminal

Mifare DESFire EV1 8K,HF 13.56MHz DESFire EV1 8K Cards,Mifare DESFire EV1 8K Contactless Cards,Mifare DESFire EV1 8K ISO Proximity Card,

Table 3.11 Coding of SAK (Select Acknowledge)

Mifare DESFire EV1 8K Clamshell Proximity Card,Mifare DESFire EV1 8K Contactless Smart Cards,ISO MIFARE DESFire EV1 8K Cards with Magnetic Stripe,

Table 3.12 The steps of the anticollision algorithm. The numbering corresponds to Figure 3.102
Step 1 The terminal specifies the select code (SEL) for the cascade level.
Step 2 The terminal sets the NVB byte (number of valid bits) to’20′. This indicates that the

terminal will not transmit any part of the UID, which means that every card within the working range of the terminal will transmit its complete CLn UID (the portion of the UID for cascade level n).

Step 3 The terminal transmits an ANTICOLLISION command containing SEL and NVB.
Step 4 All cards within range of the terminal respond with their CLn UIDs.
Step 5 If several cards with different identifiers are within range of the terminal, a collision

will occur. If no collision occurs, steps 6 through 10 are skipped.

Step 6 The terminal determines the bit position of the first collision.
Step 7 The terminal assigns a value to NVB that indicates the number of valid bits of the CLn UID. The valid bits are the portion of the CLn UID that was received before the

collision occurred, followed by a ˚0˚or ˚1˚.

Step 8 The terminal transmits an ANTICOLLISION command containing SEL, NVB and the

valid bits.

Step 9 All cards whose corresponding portion of their CLn UID matches the valid bits

transmitted by the terminal transmit the remaining bits of their CLn UIDs.

Step 10 If a collision occurs again, steps 6 through 9 are repeated.
Step 11 When no more collisions occur, the terminal sets NVB to’70′. This means that the

terminal will transmit the complete CLn UID.

Step 12 The terminal transmits a SELECT command containing SEL, NVB and the complete CLn UID, followed by the CRC A checksum.
Step 13 The card whose identifier matches the CLn UID responds with SAK.
Step 14 If the UID is complete, the card transmits a SAK with the cascade bit cleared and

changes from the Ready state to the Active state, or from the Ready* state to the

Active* state.

Step 15 The terminal checks whether the cascade bit is set in order to decide whether an

additional anticollision loop must be executed at a higher cascade level.