background image

 

ACR122S – Communication Protocol

 

[email protected] 

Version 2.01 

www.acs.com.hk 

Page 2 of 57

 

 

 

Table of Contents 

1.0.

 

Introduction ............................................................................................................... 4

 

2.0.

 

Features ..................................................................................................................... 5

 

2.1.

 

Serial Interface ....................................................................................................................... 5

 

2.2.

 

Bi-color LED ........................................................................................................................... 5

 

2.3.

 

Buzzer .................................................................................................................................... 6

 

2.4.

 

SAM Interface ........................................................................................................................ 6

 

2.5.

 

Built-in Antenna ..................................................................................................................... 6

 

3.0.

 

Communication between the host and contactless interface, SAM and 

peripherals ............................................................................................................................. 7

 

4.0.

 

Serial Interface (CCID-like Frame Format) .............................................................. 8

 

4.1.

 

Protocol Flow Examples ........................................................................................................ 9

 

5.0.

 

SAM Interface .......................................................................................................... 11

 

5.1.

 

Activating the SAM interface................................................................................................ 11

 

5.2.

 

Deactivating the SAM interface ........................................................................................... 12

 

5.3.

 

Exchanging data through the SAM interface ....................................................................... 13

 

6.0.

 

Pseudo-APDUs for contactless interface and peripherals control .................... 15

 

6.1.

 

Direct Transmit .................................................................................................................... 15

 

6.2.

 

Change Communication Speed ........................................................................................... 18

 

6.3.

 

Get Firmware Version .......................................................................................................... 22

 

6.4.

 

Bi-color LED and Buzzer Control ......................................................................................... 23

 

6.5.

 

Topaz512 and Jewel96 ........................................................................................................ 28

 

6.6.

 

Basic program flow for ISO 14443-4 Type A and B tags ..................................................... 35

 

6.7.

 

Basic program flow for Mifare applications .......................................................................... 37

 

6.7.1.

 

Handling the value blocks of Mifare 1K/4K tag? ......................................................... 39

 

6.7.2.

 

Accessing Mifare Ultralight tags .................................................................................. 42

 

6.7.3.

 

Accessing Mifare Ultralight C tag ................................................................................ 44

 

6.8.

 

Basic program flow for FeliCa applications ......................................................................... 49

 

6.9.

 

Basic program flow for NFC Forum Type 1 tag applications ............................................... 49

 

Appendix A.

 

Topaz ........................................................................................................... 51

 

Appendix B.

 

Topaz512 ..................................................................................................... 52

 

Appendix C.

 

Jewel64 ........................................................................................................ 54

 

Appendix D.

 

Jewel96 ........................................................................................................ 55

 

Appendix E.

 

ACR122 Error Codes .................................................................................. 56

 

 

List of Figures 

Figure 1

 : ACR122S Communication Flowchart .................................................................................... 7

 

Figure 2

 : Tag Address “ADD” .............................................................................................................. 33

 

Figure 3

 : Tag Address “ADD8” ............................................................................................................ 34

 

 

Summary of Contents for ACR122S

Page 1: ...Subject to change without prior notice info acs com hk www acs com hk Communication Protocol V2 01 ACR122S Serial NFC Reader...

Page 2: ...e and peripherals control 15 6 1 Direct Transmit 15 6 2 Change Communication Speed 18 6 3 Get Firmware Version 22 6 4 Bi color LED and Buzzer Control 23 6 5 Topaz512 and Jewel96 28 6 6 Basic program f...

Page 3: ...s com hk Version 2 01 www acs com hk Page 3 of 57 List of Tables Table 1 PIN Configuration 5 Table 2 Mifare 1K Memory Map 41 Table 3 Mifare 4K Memory Map 41 Table 4 Mifare Ultralight Memory Map 44 Tab...

Page 4: ...7 1 0 Introduction The ACR122S is a contactless smart card reader writer used for accessing ISO 14443 4 Type A and B Mifare ISO 18092 or NFC and FeliCa tags using the serial interface This document wi...

Page 5: ...o Two user controllable LEDs o User controllable buzzer Compliant with the following standards o ISO 14443 o CE o FCC o KC o VCCI o RoHS 2 1 Serial Interface The ACR122S is connected to a Host through...

Page 6: ...of OFF is provided 2 4 SAM Interface One SAM socket is provided 2 5 Built in Antenna A 3 turn symmetric loop antenna center tapped is provided Estimated size is 60 mm x 48 mm Loop inductance is appro...

Page 7: ...7 of 57 3 0 Communication between the host and contactless interface SAM and peripherals The contactless interface and peripherals are accessed through the use of pseudo APDUs The SAM interface is acc...

Page 8: ...ader APDU Command or Parameters Checksum XOR Bulk IN Header APDU Response or abData In general we would make use of three types of Bulk OUT Header HOST_to_RDR_IccPowerOn To activate the SAM interface...

Page 9: ...RDR 1 HOST sends a corrupted frame 02 62 00 00 00 00 00 01 01 00 00 Incorrect Checksum 03 2 RDR sends back a negative status frame immediately 02 FF FF 03 negative status frame 3 HOST sends the frame...

Page 10: ...the HOST is correctly received by the RDR a positive status frame 02 00 00 03 will be sent to the HOST immediately to inform the HOST the frame is correctly received The HOST has to wait for the resp...

Page 11: ...bSeq 1 00 FFh Sequence number for command 7 bPowerSelect 1 00h 01h 02h 03h Voltage that is applied to the ICC 00h Automatic Voltage Selection 01h 5 V 02h 3 V 03h 1 8 V 8 abRFU 2 Reserved for Future U...

Page 12: ...m ETX 03h 1 Byte 10 Bytes 0 Byte 1 Byte 1 Byte HOST_to_RDR_IccPowerOff Format Offset Field Size Value Description 0 bMessageType 1 63h 1 dDwLength LSB MSB 4 00000000h Message specific data length 5 bS...

Page 13: ...ST_to_RDR_XfrBlock Parameters Checksum ETX 03h 1 Byte 10 Bytes M Byte 1 Byte 1 Byte HOST_to_RDR_XfrBlock Format Offset Field Size Value Description 0 bMessageType 1 6Fh 1 dDwLength LSB MSB 4 M Message...

Page 14: ...t number for this command 6 bSeq 1 Same as Bulk OUT Sequence number for corresponding command 7 bStatus 1 8 bError 1 9 bChainParameter 1 Example To send an APDU 80 84 00 00 08 to the slot 0 default se...

Page 15: ...ling Where Tg A byte containing the logical number of the relevant target This byte also contains the More Information MI bit bit 6 When the MI bit is set to 1 this indicates that the host controller...

Page 16: ...resents the type of application targeted by the device IC and is used to preselect the PICCs before the ATQB This field is mandatory Polling Method This field is optional It indicates the approach to...

Page 17: ...targets and depends on the baud rate selected The following information is given for one target it is repeated for each target initialized NbTg times 106 kbps Type A Tg SENS_RES10 2 bytes SEL_RES 1 by...

Page 18: ...Success 90 Current Baud Rate The operation is completed successfully Error 63 00h The operation is failed Where SW2 Current Baud Rate 00h The current baud rate is 9600 bps 01h The current baud rate i...

Page 19: ...02 03 00 4B 02 4F 49 8A 8A 80 08 NFCID2t of the FeliCa Tag 01 01 05 01 86 04 02 02 Status Code returned by the reader 90 00 Example 2 To write 16 bytes data to the FeliCa Tag Tag Write Step 1 Issue a...

Page 20: ...U The APDU Command should be FF 00 00 00 13 D4 40 01 10 06 01 01 05 01 86 04 02 02 01 09 01 01 80 00 In which Direct Transmit APDU FF 00 00 00 Length of the Tag Command 13 Tag Command InDataExchange D...

Page 21: ...ype B 106Kbps D4 4A 01 03 00 To send an APDU to the slot 0 default sequence number 4 HOST 02 6F 0A 00 00 00 00 04 00 00 00 FF 00 00 00 05 D4 4A 01 03 00 Checksum 03 RDR 02 00 00 03 RDR 02 81 14 00 00...

Page 22: ...08 90 00 90 00 Checksum 03 The APDU Response is D5 41 00 0B 01 02 03 04 05 06 07 08 90 00 In which Response returned by the contactless chip D5 41 00 Response from the Type B Tag 01 02 03 04 05 06 07...

Page 23: ...he State 0 No change Bit 3 Green LED State Mask 1 Update the State 0 No change Bit 4 Initial Red LED Blinking State 1 On 0 Off Bit 5 Initial Green LED Blinking State 1 On 0 Off Bit 6 Red LED Blinking...

Page 24: ...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...

Page 25: ...esponse 90 02 Green LED is not changed ON Red LED is OFF 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 i...

Page 26: ...e 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 1 Hz 10...

Page 27: ...2 Duration 500 ms 05h Number of repetition 03h Link to Buzzer 03h APDU FF 00 40 F0 04 05 05 03 03 Response 90 00 Example 7 To make the Red and Green LEDs in turn of 1 Hz blink for 3 times Assume both...

Page 28: ...esponse 90 00 6 5 Topaz512 and Jewel96 Note This section only applies to ACR122S with firmware version 1 03 This command is used to Write with erase 8 Bytes Write no erase 8 Bytes Read 8 Bytes and Rea...

Page 29: ...paz512 Jewel96 tag Step 1 Issue a Direct Transmit APDU The APDU Command should be FF 00 00 00 0D D4 40 01 54 05 01 23 45 67 89 AB CD EF In which Direct Transmit APDU FF 00 00 00 Length of the Tag Comm...

Page 30: ...FF 00 00 00 Length of the Tag Command 0D Tag Command InDataExchange D4 40 01 Tag Command Write no erase 8Bytes 1B Tag Address 00 3F hex 05 Tag Data FF FF FF FF FF FF FF FF To send an APDU to the slot...

Page 31: ...quence number 1 HOST 02 6F 12 00 00 00 00 01 00 00 00 FF 00 00 00 0D D4 40 01 02 05 00 00 00 00 00 00 00 00 Checksum 03 RDR 02 00 00 03 RDR 02 80 0D 00 00 00 00 01 01 00 00 D5 09 05 01 23 45 67 89 AB...

Page 32: ...se returned by the contactless chip D5 41 00 128 bytes data 90 00 Read Tag Segment Data 128 bytes data Status Code returned by the reader 90 00 Example 5 To Write Multi Data at Topaz Jewel Tag Note Th...

Page 33: ...esponse is D5 41 00 90 00 In which Response returned by the contactless chip D5 41 00 90 00 Write Tag Data 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30...

Page 34: ...0 00 00 00 01 00 00 00 FF 00 00 00 36 D4 40 01 5A 04 30 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47...

Page 35: ...Step 2 Polling for the ISO 14443 4 Type A Tag 106 kbps HOST 02 6F 09 00 00 00 00 01 00 00 00 HOST_to_RDR_XfrBlock Format HOST FF 00 00 00 04 D4 4A 01 00 Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR...

Page 36: ...ted Step 4 Perform T CL command Get Challenge APDU 00 84 00 00 08 HOST 02 6F 0D 00 00 00 00 01 00 00 00 HOST_to_RDR_XfrBlock Format HOST FF 00 00 00 08 D4 40 01 00 84 00 00 08 Checksum 03 RDR 02 00 00...

Page 37: ...4K tags 106 kbps HOST 02 6F 09 00 00 00 00 01 00 00 00 FF 00 00 00 04 D4 4A 01 00 Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR 02 80 0E 00 00 00 00 01 01 00 00 RDR D5 4B 01 01 00 02 18 04 F6 8E 2A...

Page 38: ...Block 04 HOST 02 6F 0A 00 00 00 00 01 00 00 00 FF 00 00 00 05 D4 40 01 30 04 Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR 02 80 15 00 00 00 00 01 01 00 00 RDR D5 41 00 01 02 03 04 05 06 07 08 09 1...

Page 39: ...a block optional Example Value 100 decimal 64 Hex assume Block 05h The formatted value block 64 00 00 00 9B FF FF FF 64 00 00 00 05 FA 05 FA Step 1 Update the content of Block 05 with a value 100 dec...

Page 40: ...Block 05 to Block 06 dec HOST 02 6F 0A 00 00 00 00 01 00 00 00 HOST FF 00 00 00 05 D4 40 01 C2 05 Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR 02 80 05 00 00 00 00 01 01 00 00 RDR D5 41 00 90 00 Ch...

Page 41: ...16 bytes per block Trailer Block 1 block 16 bytes Sector 0 00h 02h 03h Sector 1 04h 06h 07h Sector 30 78h 7Ah 7Bh Sector 31 7Ch 7Eh 7Fh Sectors Total 8 sectors Each sector consists of 16 consecutive...

Page 42: ...00 HOST FF 00 00 00 04 D4 4A 01 00 Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR 02 80 11 00 00 00 00 01 01 00 00 RDR D5 4B 01 01 00 44 00 07 04 6E 0C A1 BF 02 84 90 00 Checksum 03 In which Number...

Page 43: ...K 4K infrastructure We have to assemble the data into a 16 bytes frame The first 4 bytes are for data the rest of the bytes 12 ZEROS are for padding Only the page 4 4 bytes is updated even though the...

Page 44: ...00 00 01 00 00 00 HOST FF 00 00 00 04 D4 4A 01 00 Checksum 03 RDR 02 00 00 03 Waiting the Tag Byte Number 0 1 2 3 Page Serial Number SN0 SN1 SN2 BCC0 0 Serial Number SN3 SN4 SN5 SN6 1 Internal Lock B...

Page 45: ...4 77 64 89 99 74 24 67 h 90 00 HOST 02 6F 18 00 00 00 00 01 00 00 00 HOST FF 00 00 00 13 D4 42 AF 88 68 45 07 65 86 99 67 00 53 77 56 98 65 49 67 Checksum 03 In which 3DES reply to the card 88 68 45 0...

Page 46: ...Checksum 03 RDR 02 00 00 03 Waiting the Tag RDR 02 80 05 00 00 00 00 01 01 00 00 RDR D5 41 00 90 00 Checksum 03 Note This command is implemented to accommodate the established Mifare 1K 4K infrastruct...

Page 47: ...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 wr...

Page 48: ...ter 16 bit counter 16 bit counter 41 Authentication configuration Authentication configuration Authentication configuration Authentication configuration Authentication configuration 42 Authentication...

Page 49: ...s 1 The default Retry Time of the Tag command InListPassiveTarget is infinity Send the APDU FF 00 00 00 06 D4 32 05 00 00 01 to change the Retry Time to two 2 It is recommended to turn off the Antenna...

Page 50: ...1 00 11 48 RDR show all data 90 00 Checksum 03 Step 4 Update the memory address 08 Block 1 Byte 0 with the data FF HOST 2 6F 0B 00 00 00 00 01 00 00 00 FF 00 00 00 06 D4 40 01 53 08 FF Checksum 03 RDR...

Page 51: ...ACR122S Communication Protocol info acs com hk Version 2 01 www acs com hk Page 51 of 57 Appendix A Topaz...

Page 52: ...ACR122S Communication Protocol info acs com hk Version 2 01 www acs com hk Page 52 of 57 Appendix B Topaz512...

Page 53: ...ACR122S Communication Protocol info acs com hk Version 2 01 www acs com hk Page 53 of 57...

Page 54: ...ACR122S Communication Protocol info acs com hk Version 2 01 www acs com hk Page 54 of 57 Appendix C Jewel64...

Page 55: ...ACR122S Communication Protocol info acs com hk Version 2 01 www acs com hk Page 55 of 57 Appendix D Jewel96...

Page 56: ...nna drivers 0Eh Internal buffer overflow 10h Invalid parameter range format etc 12h DEP Protocol The chip configured in target mode does not support the command received from the initiator the command...

Page 57: ...acs com hk Version 2 01 www acs com hk Page 57 of 57 Error Code Error 2Ch Mismatch between the NFCID3 initiator and the NFCID3 target in DEP 212 424 kbps passive 2Dh An over current event has been de...

Reviews: