ACS ACR122U Manual

ACS ACR122U Manual

Usb nfc reader application programming interface
Hide thumbs Also See for ACR122U:
Table of Contents

Advertisement

ACR122U
USB NFC Reader
Application Programming Interface V2.04
Subject to change without prior notice
info@acs.com.hk
www.acs.com.hk

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ACR122U and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ACS ACR122U

  • Page 1 ACR122U USB NFC Reader Application Programming Interface V2.04 Subject to change without prior notice info@acs.com.hk www.acs.com.hk...
  • Page 2: Table Of Contents

    Appendix E. Sample codes for setting the LED ............45 List of Figures Figure 1 : Communication Flow Chart of ACR122U ................6 Figure 2 : Smart Card Reader Interface on the Device Manager ............7 Page 2 of 49 ACR122U –...
  • Page 3 Table 4 : MIFARE 1K Memory Map ...................... 14 Table 5 : MIFARE Classic 4K Memory Map ..................14 Table 6 : MIFARE Ultralight Memory Map .................... 15 Table 7 : Error Codes ........................... 44 Page 3 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 4: Introduction

    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 computer and the contactless tag via the USB interface.
  • Page 5: Usb Interface

    1.2. USB Interface The ACR122U is connected to a computer through USB as specified in the USB Specification 1.1. The ACR122U is working in full-speed mode, i.e. 12 Mbps. Signal Function +5 V power supply for the reader (Max. 200 mA, Normal 100 mA)
  • Page 6: Implementation

    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 computer’s 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 7: Smart Card Reader Interface Overview

    2.2. Smart Card Reader Interface Overview Go to the Device Manager to see the “ACR122U PICC Interface.” The standard Microsoft USB CCID Driver should be used. Figure 2: Smart Card Reader Interface on the Device Manager Page 7 of 49 ACR122U –...
  • Page 8: Picc Interface Description

    A0 00 00 03 06 00 01 00 00 00 00 6Ah} Initial Card Length Standard Header Name A0 00 00 00 00 03 00 01h 00 00h Page 8 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 9: Atr Format For Iso 14443 Part 4 Piccs

    The higher layer response from the ATTRIB response (ATQB). Refer to the ISO14443-3 specification. Exclusive-oring of all the bytes T0 to Tk Table 3: ATR format for ISO 14443 Part 4 PICCs Page 9 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • 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 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 11: Picc Commands For General Purposes

    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 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 12: Picc Commands (T=Cl Emulation) For Mifare Classic Memory Cards

    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 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 13: Authentication

    Load Authentication Keys Response Format (2 bytes) Response Data Out Result Response Codes Results SW1 SW2 Meaning Success 90 00h The operation completed successfully. Error 63 00h The operation failed. Page 13 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 14: Table 4: Mifare 1K Memory Map

    80h ~ 8Eh Sector 33 90h ~ 9Eh 2 KB Sector 38 E0h ~ EEh Sector 39 F0h ~ FEh Table 5: MIFARE Classic 4K Memory Map Page 14 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 15: Table 6: Mifare Ultralight Memory Map

    APDU = {FF 86 00 00 05 01 00 60 00h} Note: MIFARE Ultralight does not need to do any authentication. The memory is free to access. Page 15 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 16: Read Binary Blocks

    (MIFARE Ultralight) (Pages 4, 5, 6 and 7 will be read) APDU = {FF B0 00 10h} Note: Please add a 2-second delay when reading NDEF messages in MIFARE Classic 4K cards. Page 16 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 17: Update Binary Blocks

    10 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0Fh} 2. Update the binary block of MIFARE Ultralight with Data {00 01 02 03} APDU = {FF D6 00 04 00 01 02 03h} Page 17 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 18: Value Block Related Commands

    Example 1: Decimal –4 = {FFh, FFh, FFh, FCh} VB_Value Example 2: Decimal 1 = {00h, 00h, 00h, 01h} VB_Value Value Block Operation Response Format (2 bytes) Response Data Out Result Page 18 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 19: Read Value Block

    Example 2: Decimal 1 = {00h, 00h, 00h, 01h} Value Response Codes Results SW1 SW2 Meaning Success 90 00h The operation completed successfully. Error 63 00h The operation failed. Page 19 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 20: Restore Value Block

    APDU = {FF D7 06h} Answer: 90 00h [9000h] 4. Increment the value block by “5” APDU = {FF D7 00 00 00 05h} Answer: 90 00h [9000h] Page 20 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 21: Pseudo-Apdu Commands

    Exchanging data with non-PC/SC–compliant tags • Retrieving and setting the reader parameters • Pseudo-APDUs can be sent through the “ACR122U PICC Interface” if the tag is already connected • Pseudo-APDUs can be sent using “Escape Command” if the tag is not yet presented 6.1.
  • Page 22: Bi-Color Led And Buzzer Control

    02h: The buzzer will turn on during the T2 Duration 03h: The buzzer will turn on during the T1 and T2 Duration. Data Out SW1 SW2. Status Code returned by the reader. Page 22 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 23 7. The make the buzzer operating, the “number of repetition” must greater than zero. 8. To control the LED only, set the parameter “Link to Buzzer” to zero. Page 23 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 24: Get Firmware Version Of The Reader

    Get Firmware Version Response Format (10 bytes) Response Data Out Result Firmware Version Example: Response = 41 43 52 31 32 32 55 32 30 31h = ACR122U201 (ASCII) Page 24 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 25: Get The Picc Operating Parameter

    This command retrieves the PICC operating parameter of the reader. Command Format (5 bytes) Command Class Get PICC Operating Parameter Response Format (2 bytes) Response Data Out Result PICC Operating Parameter Page 25 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 26: Set The Picc Operating Parameter

    ISO 14443 Type A #To detect the MIFARE 1 = Detect Tags, the Auto ATS 0 = Skip Generation must be disabled first. Note: Default Value = FFh Page 26 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 27: Set Timeout Parameter

    Wait until the contactless chip responds Response Format (2 bytes) Results SW1 SW2 Meaning Success 90 00h The operation completed successfully. Error 63 00h The operation failed. Page 27 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 28: Set Buzzer Output During Card Detection

    Buzzer will turn on when a card is detected Response Format (2 bytes) Results SW1 SW2 Meaning Success 90 00h The operation completed successfully. Error 63 00h The operation failed. Page 28 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 29: Basic Program Flow For Contactless Applications

    Once the tag is found and detected, the corresponding ATR will be sent to the PC. You must make sure that the PC/SC Escape Command has been set. See Appendix A for more details. Step 1. The first thing is to connect the “ACR122U PICC Interface”. Step 2. Access the PICC by sending APDU commands.
  • Page 30 1. For the ACR122U PICC Interface, ISO 7816 T=1 protocol is used. • PC  Reader: Issue an APDU to the reader. • Reader  PC: The response data is returned. Page 30 of 49 ACR122U – Application Programming Interface info@acs.com.hk...
  • Page 31: How To Access Pc/Sc-Compliant Tags (Iso 14443-4)

    Basically, all ISO 14443-4 compliant cards (PICCs) would understand the ISO 7816-4 APDUs. The ACR122U Reader just needs to communicate with the ISO 14443-4 compliant cards through exchanging ISO 7816-4 APDUs and Responses. ACR122U will handle the ISO 14443 Parts 1-4 Protocols internally.
  • Page 32: How To Access Mifare Desfire Tags (Iso 14443-4)

    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 32 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk...
  • Page 33 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. Page 33 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk...
  • Page 34: How To Access Felica Tags (Iso 18092)

    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 34 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 35: How To Access Nfc Forum Type 1 Tags (Iso 18092)

    >> 11 48 18 26 .. 00h [90 00h] Step 3) Update the memory address (Block 1: Byte-0)with the data << 53 >> FFh [90 00h] In which, Response Data = FFh Page 35 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 36: Figure 4: Topaz Memory Map

    E.g. Memory Address 10h (hex) = 2 x 8 + 0 = Block 2: Byte-0 = Data8 Figure 4: Topaz Memory Map Please refer to the Jewel and Topaz specification for more detailed information. Page 36 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 37: Get The Current Setting Of The Contactless Interface

    00h: 106 Kbps 01h: 212 Kbps 02h: 424 Kbps [Type ]: modulation type 00h: ISO 14443 or MIFARE 10h: FeliCa 01h: Active mode 02h: Innovision Jewel tag Page 37 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 38: Appendix A. Acr122U Pc/Sc Escape Command

    Appendix A. ACR122U PC/SC Escape Command 1. Select the “ACS ACR122U PICC Interface 0” 2. Select the “Shared Mode” if the “ACR122U PICC Interface” is already connected, or “Direct Mode” if the “ACR122U PICC Interface” is not connected. 3. Press the Connect button to establish a connection between the PC and the ACR122U reader.
  • Page 39 3. Look for: VID_072F&PID_2200, then expand the node. Look under Device parameters. Page 39 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 40 4. Create a DWORD entry (32-bit) with the name: 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 40 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 41: Appendix B. Apdu Command And Response Flow For Iso 14443-Compliant Tags

    Contactless Related Response Tag-specific is received. Response Frame [APDU Response] [APDU Response] e.g. [11 22 33 44 55 66 embedded in 77 88] (90 00) ISO14443 Frame Page 41 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 42: Appendix C. Apdu Command And Response Flow For Iso 18092-Compliant Tags

    Response Frame [Native Response] e.g. [Native e.g. 00 (90 00) Response] embedded in ISO18092 Frame Pseudo APDU Response + [Native Response] e.g. D5 41 00 [00] (90 00) Page 42 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 43: Appendix D. Error Codes

    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 expected card has been exchanged with another one. Page 43 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 44: Table 7: Error Codes

    Mismatch between the NFCID3 initiator and the NFCID3 target in DEP 212/424 kbps passive. An over-current event has been detected NAD missing in DEP frame Table 7: Error Codes Page 44 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 45: Appendix E. Sample Codes For Setting The Led

    Response = “90 02h”. Green LED is not changed (ON); Red LED is OFF, High (Red LED On) (Red LED Off) High (Green LED On) (Green LED Off) Page 45 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 46 T2 Duration = 0 ms = 00h Number of repetition = 01h Link to Buzzer = 01h APDU = “FF 00 40 50 04 14 00 01 01h” Response = “90 02h” Page 46 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 47 T2 Duration = 500 ms = 05h Number of repetition = 03h Link to Buzzer = 01h APDU = “FF 00 40 50 04 05 05 03 01h” Response = “90 02h” Page 47 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 48 T2 Duration = 500 ms = 05h Number of repetition = 03h Link to Buzzer = 03h APDU = “FF 00 40 F0 04 05 05 03 03h” Response = “90 00h” Page 48 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk Version 2.04...
  • Page 49 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 49 of 49 ACR122U – Application Programming Interface info@acs.com.hk www.acs.com.hk...

Table of Contents

Save PDF