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 –...
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.
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)
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.
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 –...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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...
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...
Need help?
Do you have a question about the ACR122U and is the answer not in the manual?
Questions and answers