Appendix E. Sample Codes for Setting the LED ............41 List of Figures Figure 1 : Communication Flow Chart of ACR122T ................6 Figure 2 : Smart Card Reader Interface on the Device Manager ............7 Figure 3 : Basic Program Flow for Contactless Applications ............... 27 Figure 4 : Topaz Memory Map ......................
Page 3
Table 7 : Bi-color LED and Buzzer Control Format (1 Byte) ..............22 Table 8 : Current LED State (1 Byte) ....................23 Table 9 : PICC Operating Parameter (Default Value = FFh) ..............26 Page 3 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
The ACR122T is an NFC contactless smart card reader/writer token used for accessing ISO 14443-4 Type A and B, Mifare, ISO 18092 or NFC, and FeliCa tags. The ACR122T is PCSC-compliant so it is compatible with existing PCSC applications. Furthermore, the standard Microsoft CCID driver is used to simplify driver installation.
1.2. USB Interface The ACR122T is connected to a computer through USB as specified in the USB Specification 1.1. The ACR122T is working in Full speed mode, i.e. 12 Mbps. Signal Function +5V power supply for the reader (Max 200 mA, Normal 100 mA) Differential signal transmits data between ACR122T and PC.
Windows operating system. You also have to modify your computer’s registry settings to be able to use the full capabilities of the ACR122T NFC Reader. See Appendix A for more details.
2.2. Smart Card Reader Interface Overview Just click the “Device Manager” to find out the “ACR122T PICC Interface”. The standard Microsoft USB CCID Driver is used. Figure 2: Smart Card Reader Interface on the Device Manager Page 7 of 45 ACR122T –...
Table 3: ATR Format for ISO 14443 Part 4 PICCs We take for example, an ATR for DESFire, which is: DESFire (ATR) = 3B 86 80 01 06 75 77 81 02 80 00h Page 9 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 10
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 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
1. To get the serial number of the “connected PICC” UINT8 GET_UID[5]={0xFFh, 0xCAh, 0x00h, 0x00h, 0x04h}; 2. To get the ATS of the “connected ISO 14443 A PICC” UINT8 GET_ATS[5]={0xFFh, 0xCAh, 0x01h, 0x00h, 0x04h}; Page 11 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Data Out Result Load Authentication Keys Response Codes Results SW1 SW2 Meaning Success 90 00h The operation is completed successfully. Error 63 00h The operation is failed. Page 13 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
= {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 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Example 2: Decimal 1 = {0x00h, 0x00h, 0x00h, 0x01h} VB_Value Value Block Operation Response Format (2 Bytes) Response Data Out Result Response Codes Results SW1 SW2 Meaning Success 90 00h The operation completed successfully. Page 18 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
63 00h The operation failed. 5.5.3. Restore Value Block The “Restore Value Block command” is used to copy a value from a value block to another value Page 19 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 20
{FF D7 06h} Answer: 90 00h [9000h] 4. Increment the value block 0x05h by “5” APDU = {FF D7 00 00 00 05h} Answer: 90 00h [9000h] Page 20 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
• Retrieving and setting the reader parameters. • The Pseudo APDUs can be sent through the “ACR122T PICC Interface” if the tag is already connected. • Or the Pseudo APDUs can be sent by using “Escape Command” if the tag is not presented yet.
0x01h: The buzzer will turn on during the T1 Duration 0x02h: The buzzer will turn on during the T2 Duration 0x03h: The buzzer will turn on during the T1 and T2 Duration. Page 22 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
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 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk...
Response Format (10 Bytes) Response Data Out Result Firmware Version E.g. Response = 41 43 52 31 32 32 55 32 30 31h (Hex) = ACR122T201 (ASCII) Page 24 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
This is used to retrieve the PICC Operating Parameter of the reader. Command Format (5 Bytes) Command Class Get PICC Operating 0xFFh 0x00h 0x50h 0x00h 0x00h Parameter Response Format (1Byte) Response Data Out Result PICC Operating Parameter Page 25 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Once the tag is found and detected, the corresponding ATR will be sent to the PC. You must make sure that the PCSC Escape Command has been set. See Appendix A for more details. Step 1. The first thing is to connect the “ACR122T PICC Interface”. Step 2. Access the PICC by sending APDU commands.
Basically, all ISO 14443-4 compliant cards (PICCs) would understand the ISO 7816-4 APDUs. The ACR122T Reader just has to communicate with the ISO 14443-4 compliant cards through exchanging ISO 7816-4 APDUs and Responses. ACR122T will handle the ISO 14443 Parts 1-4 Protocols internally.
Example 4: DESFire Frame Level Chaining (Native Mode) In this example, the application has to do the “Frame Level Chaining”. To get the version of the DESFire card. Page 29 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Data Exchange Response Note: The NFC ID can be obtained by using the APDU “FF CA 00 00 00h” Please refer to the FeliCa specification for more detailed information. Page 30 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Appendix A. ACR122T PC/SC Escape Command 1. Select the “ACS ACR122T PICC Interface 0”. 2. Select the “Shared Mode” if the “ACR122T PICC Interface” is already connected or “Direct Mode” if the “ACR122T PICC Interface” is not connected. 3. Press the button “Connect” to establish a connection between the PC and the ACR122T reader.
Page 35
1. Execute the “regedit” in the “Run Command Menu” of Windows 2. Add a DWORD “EscapeCommandEnable” under HKLM\SYSTEM\CCS\Enum\USB\Vid_07 2F&Pid_2200\Device Parameters For Vista, the path is: Computer\HKEY_LOCAL_MACHINE\SYS TEMS\CurrentControlSet\Enum\USB Page 35 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 36
EscapeCommandEnable 5. To modify the value of the EscapeCommandEnable double click on the entry and input 1 in the Value data with the base set in Hexadecimal. Page 36 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
The chip configured as target has been released by its initiator ISO/IEC 14443-3B only: the ID of the card does not match, meaning that the 0x2Ah expected card has been exchanged with another one. Page 39 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 40
Mismatch between the NFCID3 initiator and the NFCID3 target in DEP 0x2Ch 212/424 kbps passive. 0x2Dh An over-current event has been detected 0x2Eh NAD missing in DEP frame Page 40 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
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 41 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 42
T2 Duration = 0 ms = 0x00h Number of repetition = 0x01h Link to Buzzer = 0x01h APDU = “FF 00 40 50 04 14 00 01 01h” Response = “90 02h” Page 42 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 43
T2 Duration = 500 ms = 0x05h Number of repetition = 0x03h Link to Buzzer = 0x01h APDU = “FF 00 40 50 04 05 05 03 01h” Response = “90 02h” Page 43 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 44
T2 Duration = 500 ms = 0x05h Number of repetition = 0x03h Link to Buzzer = 0x03h APDU = “FF 00 40 F0 04 05 05 03 03h” Response = “90 00h” Page 44 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Page 45
T2 Duration = 500 ms = 0x05h Number of repetition = 0x03h Link to Buzzer = 0x01h APDU = “FF 00 40 D0 04 05 05 03 01h”; Response = “90 00h” Page 45 of 45 ACR122T – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.02...
Need help?
Do you have a question about the ACR122T and is the answer not in the manual?
Questions and answers