Application Programming ACR122U
Application Programming ACR122U
www.acs.com.hk
Table of Contents
1.0.
Introduction ............................................................................................................. 4
1.1.
1.2.
Features ................................................................................................................................. 4
USB Interface ........................................................................................................................ 5
2.0.
Implementation ........................................................................................................ 6
2.1.
2.2.
3.0.
3.1.
3.1.1.
3.1.2.
4.0.
4.1.
Get Data............................................................................................................................... 11
5.0.
PICC Commands (T=CL Emulation) for MIFARE Classic Memory Cards .......... 12
5.1.
5.2.
5.3.
5.4.
5.5.
6.0.
Pseudo-APDUs ...................................................................................................... 21
6.1.
6.2.
6.3.
6.4.
6.5.
6.6.
6.7.
7.0.
7.1.
7.2.
7.3.
7.4.
7.5.
Appendix A.
Appendix B. APDU Command and Response Flow for ISO 14443-Compliant Tags .. 39
Appendix C. APDU Command and Response Flow for ISO 18092-Compliant Tags .. 40
Appendix D. Error Codes ............................................................................................... 41
Appendix E. Sample Codes for Setting the LED .......................................................... 43
Page 2 of 47
www.acs.com.hk
List of Figures
Figure 1 : Communication Flow Chart of ACR122U .............................................................................. 6
Figure 2 : Smart Card Reader Interface on the Device Manager .......................................................... 7
Figure 3 : Basic Program Flow for Contactless Applications ............................................................... 29
Figure 4 : Topaz Memory Map ............................................................................................................. 34
List of Tables
Table 1 : USB Interface .......................................................................................................................... 5
Table 2 : ATR format for ISO 14443 Part 3 PICCs ................................................................................. 8
Table 3 : ATR format for ISO 14443 Part 4 PICCs ................................................................................. 9
Table 4 : MIFARE 1K Memory Map ...................................................................................................... 14
Table 5 : MIFARE Classic 4K Memory Map ......................................................................................... 14
Table 6 : MIFARE Ultralight Memory Map ............................................................................................ 15
Page 3 of 47
www.acs.com.hk
1.0. Introduction
The ACR122U is a PC-linked contactless smart card reader/writer used for accessing ISO 14443-4
Type A and Type B, MIFARE, ISO 18092, and FeliCa tags. The ACR122U is PC/SC compliant
making it compatible with existing PC/SC applications.
The ACR122U serves as the intermediary device between the personal computer and the contactless
tag via the USB interface. The reader carries out the command from the PC whether the command is
used in order to communicate with a contactless tag, or control the device peripherals (LED or
buzzer). This API document will discuss in detail how the PC/SC commands were implemented for
the contactless interface and device peripherals of the ACR122U.
1.1. Features
CCID Compliance
Built-in antenna for contactless tag access, with card reading distance of up to 50 mm
(depending on tag type)
Support for ISO 14443 Part 4 Type A and B cards, MIFARE, FeliCa, and all four types of
NFC (ISO/IEC 18092 tags)
Supports PC/SC
Built-in Peripherals:
o
User-controllable buzzer
ISO 18092
ISO 14443
CE
FCC
KC
VCCI
MIC
PC/SC
CCID
Microsoft WHQL
RoHS 2
IEC/EN 60950
Page 4 of 47
www.acs.com.hk
Signal
Function
VBUS
D-
D+
GND
+5 V power supply for the reader (Max. 200 mA, Normal 100 mA)
Page 5 of 47
www.acs.com.hk
2.0. Implementation
2.1. Communication Flow Chart of ACR122U
The Standard Microsoft CCID and PC/SC drivers are used; thus, no ACS drivers are required
because the drivers are already built inside the Windows operating system. Your computers registry
settings can also be modified to be able to use the full capabilities of the ACR122U NFC Reader. See
Appendix A for more details.
Page 6 of 47
www.acs.com.hk
Page 7 of 47
www.acs.com.hk
3.1.1.
Value
(Hex)
Designation
3Bh
Initial Header
Description
-
8Nh
T0
80h
TD1
01h
TD2
80h
T1
4Fh
0Ch
Length
To
RID
3+N
SS
Tk
C0 .. C1h
00 00 00 00h
RFU
RFU # 00 00 00 00h
UUh
TCK
4+N
Example:
ATR for MIFARE 1K = {3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6Ah}
ATR
Initial
Header
T0
TD1
TD2
T1
Tk
Length
RID
Standard
Card
Name
RFU
TCK
3Bh
8Fh
80h
01h
80h
4Fh
0Ch
A0 00
00 03
06h
03h
00 01h
00 00
00 00h
6Ah
Where:
Length (YY)
= 0Ch
Page 8 of 47
www.acs.com.hk
RID
Standard (SS)
3.1.2.
Value (Hex)
Designation
3Bh
Initial Header
Description
-
8Nh
T0
80h
TD1
01h
TD2
XXh
T1
4
to
3+N
4+N
Historical Bytes:
ISO 14443A:
The historical bytes from ATS response. Refer
to the ISO14443-4 specification.
XXh
XX
XXh
Tk
UUh
TCK
ISO 14443B:
The higher layer response from the ATTRIB
response (ATQB). Refer to the ISO14443-3
specification.
Exclusive-oring of all the bytes T0 to Tk
Page 9 of 47
www.acs.com.hk
ATR
Initial Header
T0
TD1
TD2
3Bh
86h
80h
01h
ATS
T1
Tk
TCK
06h
75 77 81 02 80h
00h
T0
TD1
TD2
3Bh
86h
80h
01h
ATQB
T1
Tk
TCK
50h
12 23 45 56 12 53 54 4E 33 81 C3h
55h
Since this card follows ISO 14443 Type B, the response would be ATQB which is 50 12 23 45 56 12
53 54 4E 33 81 C3h is 12 bytes long with no CRC-B
Note: You can refer to the ISO7816, ISO14443 and PC/SC standards for more details.
Page 10 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
Get Data
FFh
CAh
00h
01h
00h
00h
(Full Length)
Data Out
UID
(LSB)
UID
(MSB)
SW1
SW2
Data Out
ATS
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Error
6A 81h
Example:
1. To get the serial number of the connected PICC
UINT8 GET_UID[5]={FFh, CAh, 00h, 00h, 04h};
2. To get the ATS of the connected ISO 14443 A PICC
UINT8 GET_ATS[5]={FFh, CAh, 01h, 00h, 04h};
Page 11 of 47
www.acs.com.hk
Class
INS
P1
P2
Lc
Data In
FFh
82h
Key Structure
Key Number
06h
Key (6 bytes)
Where:
Key Structure: 1 Byte.
00h = Key is loaded into the reader volatile memory.
Other = Reserved.
Key Number: 1 Byte.
00h ~ 01h = Key Location. The keys will disappear once the reader is
disconnected from the PC.
Key:
6 Bytes.
The key value loaded into the reader. E.g. {FF FF FF FF FF FFh}
Data Out
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Example:
Load a key {FF FF FF FF FF FFh} into the key location 00h.
APDU = {FF 82 00 00h 06 FF FF FF FF FF FFh}
Page 12 of 47
www.acs.com.hk
5.2. Authentication
The Authentication command uses the keys stored in the reader to do authentication with the
MIFARE 1K/4K card (PICC). Two types of authentication keys are used: TYPE_A and TYPE_B.
Load Authentication Keys APDU Format (6 Bytes) [Obsolete]
Command
Class
INS
P1
P2
P3
Data In
Authentication
FFh
88h
00h
Block Number
Key Type
Key Number
Class
INS
P1
P2
Lc
Data In
Authentication
FFh
86h
00h
00h
05h
Byte 2
Byte 3
Byte 4
Byte 5
Version 01h
00h
Block Number
Key Type
Key Number
Where:
Block Number: 1 Byte. This is the memory block to be authenticated.
Key Type:
1 Byte
60h = Key is used as a TYPE A key for authentication.
61h = Key is used as a TYPE B key for authentication.
Data Out
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Page 13 of 47
www.acs.com.hk
Sectors
(Total 16 sectors. Each
sector consists of 4
consecutive blocks)
Data Blocks
(3 blocks, 16 bytes per
block)
Trailer Block
(1 block, 16 bytes)
Sector 0
00h ~ 02h
03h
Sector 1
04h ~ 06h
07h
..
1K
Bytes
..
Sector 14
38h ~ 0Ah
3Bh
Sector 15
3Ch ~ 3Eh
3Fh
Sectors
(Total 32 sectors. Each
sector consists of 4
consecutive blocks)
Data Blocks
(3 blocks, 16 bytes per
block)
Trailer Block
(1 block, 16 bytes)
Sector 0
00h ~ 02h
03h
Sector 1
04h ~ 06h
07h
..
2K
Bytes
..
Sector 30
78h ~ 7Ah
7Bh
Sector 31
7Ch ~ 7Eh
7Fh
Sectors
(Total 8 sectors. Each
sector consists of 16
consecutive blocks)
Data Blocks
(15 blocks, 16 bytes
per block)
Trailer Block
(1 block, 16 bytes)
Sector 32
80h ~ 8Eh
8Fh
Sector 33
90h ~ 9Eh
9Fh
..
2K
Bytes
..
Sector 38
E0h ~ EEh
EFh
Sector 39
F0h ~ FEh
FFh
Page 14 of 47
www.acs.com.hk
Byte Number
Page
Serial Number
SN0
SN1
SN2
BCC0
Serial Number
SN3
SN4
SN5
SN6
Internal/Lock
BCC1
Internal
Lock0
Lock1
OTP
OPT0
OPT1
OTP2
OTP3
Data read/write
Data0
Data1
Data2
Data3
Data read/write
Data4
Data5
Data6
Data7
Data read/write
Data8
Data9
Data10
Data11
Data read/write
Data12
Data13
Data14
Data15
Data read/write
Data16
Data17
Data18
Data19
Data read/write
Data20
Data21
Data22
Data23
Data read/write
Data24
Data25
Data26
Data27
10
Data read/write
Data28
Data29
Data30
Data31
11
Data read/write
Data32
Data33
Data34
Data35
12
Data read/write
Data36
Data37
Data38
Data39
13
Data read/write
Data40
Data41
Data42
Data43
14
Data read/write
Data44
Data45
Data46
Data47
15
512 bits
Or
64 Bytes
Example:
1. To authenticate the Block 04h with a {TYPE A, key number 00h}. For PC/SC V2.01, Obsolete.
APDU = {FF 88 00 04 60 00h};
2. To authenticate the Block 04h with a {TYPE A, key number 00h}. For PC/SC V2.07
APDU = {FF 86 00 00 05 01 00 04 60 00h}
Note: MIFARE Ultralight does not need to do any authentication. The memory is free to access.
Page 15 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
FFh
B0h
00h
Block Number
Where:
Block Number:
Data Out
Result
0 <= N <= 16
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Example:
1. Read 16 bytes from the binary block 04h (MIFARE Classic 1K or 4K)
APDU = {FF B0 00 04 10h}
2. Read 4 bytes from the binary Page 04h (MIFARE Ultralight)
APDU = {FF B0 00 04 04h}
3. Read 16 bytes starting from the binary Page 04h (MIFARE Ultralight) (Pages 4, 5, 6 and 7
will be read)
APDU = {FF B0 00 04 10h}
Page 16 of 47
www.acs.com.hk
Class
Update Binary
Blocks
FFh
INS
D6h
P1
P2
Lc
Data In
00h
Block
Number
Number of
Bytes to
Update
Block Data
4 Bytes for MIFARE Ultralight or
16 Bytes for MIFARE 1K/4K
Where:
Block Number:
1 Byte.
16 bytes for MIFARE 1K/4K
4 bytes for MIFARE Ultralight.
Block Data:
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Example:
1. Update the binary block 04h of MIFARE Classic 1K/4K with Data {00 01 .. 0Fh}
APDU = {FF D6 00 04 10 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0Fh}
2. Update the binary block 04h of MIFARE Ultralight with Data {00 01 02 03}
APDU = {FF D6 00 04 04 00 01 02 03h}
Page 17 of 47
www.acs.com.hk
5.5.1.
The Value Block Operation command is used for manipulating value-based transactions. E.g.
Increment a value of the value block etc.
Class
INS
P1
P2
Lc
Data In
Value Block
Operation
FFh
D7h
00h
Block
Number
05h
VB_OP
VB_Value
(4 Bytes)
{MSB .. LSB}
Where:
Block Number:
VB_OP:
1 Byte.
00h = Store the VB_Value into the block. The block will then be
converted to a value block.
01h = Increment the value of the value block by the VB_Value. This
command is only valid for value block.
02h = Decrement the value of the value block by the VB_Value. This
command is only valid for value block.
VB_Value:
4 Bytes. The value used for value manipulation. The value is a signed
long integer (4 bytes).
LSB
FFh
FFh
FFh
FCh
LSB
00h
00h
00h
01h
Data Out
SW1
SW2
Page 18 of 47
www.acs.com.hk
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
5.5.2.
The Read Value Block command is used for retrieving the value from the value block. This
command is only valid for value block.
Read Value Block APDU Format (5 Bytes)
Command
Class
INS
P1
P2
Le
FFh
B1h
00h
Block Number
04h
Where:
Block Number: 1 Byte. The value block to be accessed.
Data Out
Result
Value
{MSB .. LSB}
SW1
SW2
Where:
Value: 4 Bytes. The value returned from the card. The value is a signed long integer (4
bytes).
LSB
FFh
FFh
FCh
LSB
00h
00h
01h
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Page 19 of 47
www.acs.com.hk
5.5.3.
The Restore Value Block command is used to copy a value from a value block to another value
block.
Restore Value Block APDU Format (7 Bytes)
Command
Class
INS
P1
P2
Lc
FFh
D7h
00h
02h
Data In
03h
Target Block
Number
Where:
Source Block Number:
1 Byte. The value of the source value block will be copied to the
target value block.
Data Out
Result
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Example:
1. Store a value 1 into block 05h
APDU = {FF D7 00 05 05 00 00 00 00 01h}
Answer: 90 00h
2. Read the value block 05h
APDU = {FF B1 00 05 00h}
Answer: 00 00 00 01 90 00h [9000h]
3. Copy the value from value block 05h to value block 06h
APDU = {FF D7 00 05 02 03 06h}
Answer: 90 00h [9000h]
4. Increment the value block 05h by 5
APDU = {FF D7 00 05 05 01 00 00 00 05h}
Answer: 90 00h [9000h]
Page 20 of 47
www.acs.com.hk
6.0. Pseudo-APDUs
Pseudo-APDUs are used for the following:
Class
INS
P1
P2
Lc
Data In
Direct
Transmit
FFh
00h
00h
00h
Number
of Bytes
to send
Payload
Where:
Lc:
Data In:
Response
Data Out
Direct Transmit
Response Data
Page 21 of 47
www.acs.com.hk
Class
INS
P1
P2
Lc
Data In (4 Bytes)
Bi-Color and
Buzzer
LED Control
FFh
00h
40h
LED
State
Control
04h
P2:
Data In:
Item
Description
Bit 0
1 = On; 0 = Off
Bit 1
1 = On; 0 = Off
Bit 2
Bit 3
Bit 4
1 = On; 0 = Off
Bit 5
1 = On; 0 = Off
Bit 6
1 = Blink
0 = Not Blink
Bit 7
1 = Blink
0 = Not Blink
Byte 1
Byte 2
Byte 3
T1 Duration
Initial Blinking State
(Unit = 100 ms)
T2 Duration
Toggle Blinking State
(Unit = 100 ms)
Number of
repetition
Link to Buzzer
Where:
Byte 3:
Link to Buzzer. Control the buzzer state during the LED Blinking.
Page 22 of 47
www.acs.com.hk
Results
SW1
SW2
Success
90h
Error
63h
00h
Meaning
The operation completed successfully.
The operation failed.
Item
Description
Bit 0
1 = On; 0 = Off
Bit 1
1 = On; 0 = Off
Bits 2 7
Reserved
Notes:
1. The LED State operation will be performed after the LED Blinking operation is completed.
2. The LED will not be changed if the corresponding LED Mask is not enabled.
3. The LED will not be blinking if the corresponding LED Blinking Mask is not enabled. Also, the
number of repetition must be greater than zero.
4. T1 and T2 duration parameters are used for controlling the duty cycle of LED blinking and
Buzzer Turn-On duration. For example, if T1=1 and T2=1, the duty cycle = 50%. #Duty Cycle
= T1/(T1 + T2).
5. To control the buzzer only, just set the P2 LED State Control to zero.
6. The make the buzzer operating, the number of repetition must greater than zero.
7. To control the LED only, just set the parameter Link to Buzzer to zero.
Page 23 of 47
www.acs.com.hk
6.3.
Class
INS
P1
P2
Le
FFh
00h
48h
00h
00h
Data Out
Result
Firmware Version
Page 24 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
Get PICC
Operating
Parameter
FFh
00h
50h
00h
00h
Data Out
Result
Page 25 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
Set PICC
Operating
Parameter
FFh
00h
51h
00h
Data Out
Result
Parameter
Description
Option
1 = Enable
0 = Disable
1 = Enable
0 = Disable
Polling Interval
1 = 250 ms
0 = 500 ms
FeliCa 424K
1 = Detect
0 = Skip
FeliCa 212K
1 = Detect
0 = Skip
Topaz
1 = Detect
0 = Skip
1 = Detect
0 = Skip
1 = Detect
0 = Skip
Page 26 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
Set Timeout
Parameter
FFh
00h
41h
Timeout Parameter
(Unit: 5 sec.)
00h
Where:
P2:
Timeout Parameter.
00h: No Timeout check
01h FEh: Timeout with 5 second unit
FFh: Wait until the contactless chip responds
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Page 27 of 47
www.acs.com.hk
Class
INS
P1
P2
Le
Set Buzzer
Output for
Card Detection
FFh
00h
52h
PollBuzzStatus
00h
Where:
P2:
PollBuzzStatus.
00h: Buzzer will NOT turn ON when a card is detected
FFh: Buzzer will turn ON when a card is detected
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Page 28 of 47
www.acs.com.hk
Notes:
1. The antenna can be switched off in order to save the power.
PICCs that use Standard APDUs: ISO14443-4 Type A and B, MIFARE .. etc
www.acs.com.hk
1. For the ACR122U PICC Interface, ISO 7816 T=1 protocol is used.
Class
INS
P1
P2
Lc
Length
of the
Data In
Data In
Le
Expected
length of the
Response
Data
Data Out
Response Data
SW1
SW2
Response Codes
Results
SW1 SW2
Meaning
Success
90 00h
Error
63 00h
Note: For ISO14443-4 Type A tags, the ATS can be obtained by using the APDU FF CA 00 00 01h
Page 30 of 47
www.acs.com.hk
Example 2: MIFARE DESFire Frame Level Chaining (ISO 7816 wrapping mode)
In this example, the application has to do the Frame Level Chaining. To get the version of the
MIFARE DESFire card.
Step 1: Send an APDU {90 60 00 00 00h} to get the first frame. INS=60
Answer: 04 01 01 00 02 18 05 91 AFh [$91AFh]
Step 2: Send an APDU {90 AF 00 00 00h} to get the second frame. INS=AF
Answer: 04 01 01 00 06 18 05 91 AFh [$91AFh]
Step 3: Send an APDU {90 AF 00 00 00h} to get the last frame. INS=AFh
Answer: 04 52 5A 19 B2 1B 80 8E 36 54 4D 40 26 04 91 00h [$9100h]
To read 8 bytes random number from an ISO 14443-4 Type A PICC (DESFire)
APDU = {0A 00h}
Answer: AF 25 9C 65 0C 87 65 1D D7h [$1DD7h]
In which, the first byte AF is the status code returned by the MIFARE DESFire Card.
The Data inside the blanket [$1DD7] can simply be ignored by the application.
Page 31 of 47
www.acs.com.hk
Note: In DESFire Native Mode, the status code [90 00h] will not be added to the response if the
response length is greater than 1. If the response length is less than 2, the status code [90 00h] will
be added in order to meet the requirement of PC/SC. The minimum response length is 2.
or
www.acs.com.hk
7.4. How to Access NFC Forum Type 1 Tags (ISO 18092), e.g.
Jewel and Topaz Tags?
Typical sequence may be:
1. Present the Topaz Tag and Connect the PICC Interface.
2. Read/Update the memory of the tag.
Step 2) Read the memory address 08h (Block 1: Byte-0) without using Pseudo APDU
<< 01 08h
>> 18h [90 00h]
In which, Response Data = 18h
or
Step 2) Read the memory address 08h (Block 1: Byte-0) using Pseudo APDU
<< FF 00 00 00 [05] D4 40 01 01 08h
In which,
[05h] is the length of the Pseudo APDU Data D4 40 01 01 08h
D4 40 01h is the DataExchange Command.
01 08h is the data to be sent to the tag.
Step 3) Update the memory address 08h (Block 1: Byte-0)with the data FFh
<< 53 08 FFh
>> FFh [90 00h]
In which, Response Data = FFh
Page 33 of 47
www.acs.com.hk
Please refer to the Jewel and Topaz specification for more detailed information.
Page 34 of 47
www.acs.com.hk
Page 35 of 47
www.acs.com.hk
The following instructions enumerate the steps to enable the PC/SC Escape command:
1. Execute the regedit in
Command Menu of Windows.
the
Run
Page 36 of 47
www.acs.com.hk
Page 37 of 47
www.acs.com.hk
Page 38 of 47
www.acs.com.hk
Reader
Tag
Sequences
USB Interface
RF Interface
(12 Mbps)
(13.56 MHz)
Tag-specific
Command Frame
1. The command
is sent.
[APDU Command]
e.g. [00 84 00 00 08] (Get
Challenge)
2. The response
is received.
[APDU Command]
embedded in
ISO14443 Frame
Tag-specific
Response Frame
[APDU Response]
e.g. [11 22 33 44 55 66
77 88] (90 00)
[APDU Response]
embedded in
ISO14443 Frame
Page 39 of 47
www.acs.com.hk
Reader
Tag
Sequences
USB Interface
RF Interface
(12Mbps)
(13.56MHz)
Tag-specific
Command Frame
1. The command
is sent
[Native Command]
e.g. [01 08] (read memory address
08)
[Native Command]
embedded in
ISO18092 Frame
or
2. The response
is received
Tag-specific
Response Frame
[Native Response]
e.g. 00 (90 00)
or
e.g. [Native
Response]
embedded in
ISO18092 Frame
Page 40 of 47
www.acs.com.hk
Error
00h
No Error
01h
02h
03h
04h
05h
06h
An abnormal bit-collision has been detected during bit wise anti-collision at 106
kbps
07h
08h
RF Buffer overflow has been detected by the contactless UART (bit BufferOvfl
of the register CL_ERROR)
0Ah
In active communication mode, the RF field has not been switched on in time
by the counterpart (as defined in NFCIP-1 standard)
0Bh
0Dh
0Eh
10h
12h
DEP Protocol: The chip configured in target mode does not support the
command received from the initiator (the command received is not one of the
following: ATR_REQ, WUP_REQ, PSL_REQ, DEP_REQ, DSL_REQ,
RLS_REQ, ref. [1]).
DEP Protocol / MIFARE / ISO/IEC 14443-4: The data format does not match to
the specification. Depending on the RF protocol used, it can be:
13h
14h
23h
25h
DEP Protocol: Invalid device state, the system is in a state which does not
allow the operation
26h
27h
This command is not acceptable due to the current context of the chip (Initiator
vs. Target, unknown target number, Target not in the good state, )
29h
2Ah
ISO/IEC 14443-3B only: the ID of the card does not match, meaning that the
expected card has been exchanged with another one.
Page 41 of 47
www.acs.com.hk
Error Code
Error
2Bh
2Ch
Mismatch between the NFCID3 initiator and the NFCID3 target in DEP
212/424 kbps passive.
2Dh
2Eh
Page 42 of 47
www.acs.com.hk
APDU = FF 00 40 00 04 00 00 00 00h
Response = 90 00h. RED and Green LEDs are OFF.
APDU = FF 00 40 0F 04 00 00 00 00h
Response = 90 03h. RED and Green LEDs are ON,
Example 3: To turn off the RED Color LED only, and leave the Green Color LED unchanged.
// Assume both Red and Green LEDs are ON initially //
// Not link to the buzzer //
APDU = FF 00 40 04 04 00 00 00 00h
Response = 90 02h. Green LED is not changed (ON); Red LED is OFF,
Red LED On
Red LED Off
Green LED On
Green LED Off
Page 43 of 47
www.acs.com.hk
Example 4: To turn on the Red LED for 2 seconds. After that, resume to the initial state.
// Assume the Red LED is initially OFF, while the Green LED is initially ON. //
// The Red LED and buzzer will turn on during the T1 duration, while the Green LED will turn off during
the T1 duration. //
Red LED On
T1 = 2000 ms
T2 = 0 ms
Buzzer Off
APDU = FF 00 40 50 04 14 00 01 01h
Response = 90 02h
Page 44 of 47
www.acs.com.hk
Example 5: To make the Red LED blink at 1 Hz, three times. After which, it resumes to initial
state.
// Assume the Red LED is initially OFF, while the Green LED is initially ON. //
// The Initial Red LED Blinking State is ON. Only the Red LED will be blinking.
// The buzzer will turn on during the T1 duration, while the Green LED will turn off during both the T1
and T2 duration.
// After the blinking, the Green LED will turn ON. The Red LED will resume to the initial state after the
blinking //
Red LED On
T2 =
500 ms
Green LED On
Green LED Off
Buzzer On
Buzzer Off
APDU = FF 00 40 50 04 05 05 03 01h
Response = 90 02h
Page 45 of 47
www.acs.com.hk
Example 6: To make the Red and Green LEDs blink at 1 Hz three times.
// Assume both the Red and Green LEDs are initially OFF. //
// Both Initial Red and Green Blinking States are ON //
// The buzzer will turn on during both the T1 and T2 duration//
Red LED On
T2 =
500m
Green LED On
APDU = FF 00 40 F0 04 05 05 03 03h
Response = 90 00h
Page 46 of 47
www.acs.com.hk
Example 7: To make Red and Green LED blink in turns at 1 Hz three times.
// Assume both Red and Green LEDs are initially OFF. //
// The Initial Red Blinking State is ON; The Initial Green Blinking States is OFF //
// The buzzer will turn on during the T1 duration//
Red LED On
Green LED On
Buzzer Off
MIFARE, MIFARE Classic, MIFARE DESFire and MIFARE Ultralight are registered trademarks of NXP B.V. and are used under license.
Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States and/or other countries.
Page 47 of 47
www.acs.com.hk