Design Specification ACR122L-ACS Advanced Card Systems Ltd. Website: www.acs.com.hk Email: info@acs.com.
ACR122L-ACS Revision History Version Date Prepared By V0.01 16.Oct.2009 Macross Ng, Kit Au V0.02 23.Nov.2009 V0.03 19.May.2010 Macross Ng Update the product photo V0.04 20.Sept.2010 Macross Ng Add the Technical Specification ACR122L-ACS Design Specification Version 0.
ACR122L-ACS Table of Contents 1.0. Introduction ............................................................................................................. 4 2.0. Feature ..................................................................................................................... 5 3.0. Hardware Interfaces ................................................................................................ 6 3.1. Serial Interface .................................................................
ACR122L-ACS 1.0. Introduction The ACR122L is a module for accessing both contact and contactless cards with LCD Display. It can support 3 SAMs access and ISO14443 Part 4 Type A & B, MIFARE, FeliCa and NFC tags. ACR122L-ACS Design Specification Version 0.
ACR122L-ACS 2.0. Feature • Serial Interface. Baud Rate = 9600 bps (default) or 115200 bps, 8-N-1. Initial Baud Rate is determined by the existence of R12. A command is also provided for changing the baud rate while the reader is running. • CCID-liked Frame Format. • Support ISO14443 Part 4 Type A & B, MIFARE, FeliCa and NFC tags. • Built-in Antenna for contactless tags access. • Support ISO7816 T=0 cards. (SAM Socket) • 3 X SAM Interface • 4 LEDs. • Buzzer.
ACR122L-ACS 3.0. Hardware Interfaces 3.1. Serial Interface The ACR122L is connected to a Host through the RS232C Serial Interface at 9600 bps and 115200 bps. 8-N-1 Pin Signal Function 1 VCC +5V power supply for the reader (Max 200mA, Normal 100mA) 2 TXD The signal from the reader to the host. 3 RXD The signal from the host to the reader. 4 GND Reference voltage level for power supply 3.2.
ACR122L-ACS 4.0. Implementation 4.1. The ACR122L is built based on the AC1038-2, AC1038s and PN5321 chips. Built-In PN5321 AC1038-2 Antenna NFC Interface Chip Controller Contactless Interface Carrier = 13.56MHz Serial Interface 115200 Kbps Contactless Tag Serial Interface 9600 bps SAM 1 - 4 x LEDs - Buzzer - LCD - I/O Ports Main Controller Host Controller AC1038 SAM 2 Controller Second SAM Controller AC1038 SAM 3 Controller Third SAM Controller Figure 1.
ACR122L-ACS 4.2. Communication between the Host and the Contactless interface, SAM and Peripherals. The Contactless interface & Peripherals are accessed through the use of Pseduo-APDUs. The SAM interface are accessed through the use of standard APDUs. Host Serial Interface (CCID-liked protocol) PCSC Layer ACR122L ISO 7816 Parts 1-3 Peripherals Contactless Interface + T=0 SAM Interfaces SAM 1 SAM 2 SAM 3 RF Interface Contactless Tag (Built-In Antenna) ACR122L-ACS Design Specification Version 0.
ACR122L-ACS 5.0. Serial Interface (CCID-liked FRAME Format) Communication setting: 9600 bps, 8-N-1 The communication protocol between the Host and ACR122L is very similar to the CCID protocol.
ACR122L-ACS RDR = ACR122L; HOST = Host Controller. HOST_to_RDR = Host Controller -> ACR122L RDR_to_HOST = ACR122L -> Host Controller Protocol Flow Examples(Use SAM Interface 1 as Example) 1) Activate a SAM HOST 1. HOST sends a frame 2. RDR sends back a positive status frame immediately RDR 02 62 00 00 [Checksum] 03 00 00 00 01 01 00 00 02 00 00 03 (positive status frame) .. After some processing delay... 3.
ACR122L-ACS 3) Activate a SAM (Incorrect Checksum, RDR) HOST 1. HOST sends a frame 2. RDR sends back a positive status frame immediately RDR 02 62 00 00 [Checksum] 03 00 00 00 01 01 00 00 02 00 00 03 (positive status frame) .. After some processing delay... 3. RDR sends back the response (corrupted) of the command 4. HOST sends a frame to get response again.
ACR122L-ACS To activate the SAM Interface ACR122L Command Frame Format STX Bulk-OUT Header Parameters Checksum ETX 0 Byte 1 Byte 1 Byte (HOST_to_RDR_IccPowerOn) 1 Byte 10 Bytes For SAM Interface 1, STX = 0x02 and ETX = 0x03 For SAM Interface 2, STX = 0x12 and ETX = 0x13 For SAM Interface 3, STX = 0x22 and ETX = 0x23 HOST_to_RDR_IccPowerOn Format Offset Field Size Value Description 0 bMessageType 1 62h 1 dDwLength 4 00000000h Message-specific data length
ACR122L-ACS RDR_to_HOST_DataBlock Format Offset Field Size Value Description 0 bMessageType 1 80h Indicates that a data block is being sent from the ACR122L 1 dwLength 4 N Size of abData field. (N Bytes) 5 bSlot 1 Same as BulkOUT Identifies the command slot number for this 6 bSeq 1 Same as BulkOUT Sequence number for corresponding command 7 bStatus 1 8 bError 1 9 bChainParameter 1 Example1.
ACR122L-ACS To deactivate the SAM Interface ACR122L Command Frame Format STX Bulk-OUT Header Parameters Checksum ETX 0 Byte 1 Byte 1 Byte (HOST_to_RDR_IccPowerOff) 1 Byte 10 Bytes For SAM Interface 1, STX = 0x02 and ETX = 0x03 For SAM Interface 2, STX = 0x12 and ETX = 0x13 For SAM Interface 3, STX = 0x22 and ETX = 0x23 HOST_to_RDR_IccPowerOff Format Offset Field Size Value Description 0 bMessageType 1 63h 1 dDwLength 4 00000000h Message-specific data length
ACR122L-ACS Example1. To deactivate the SAM Interface 1 slot 0 (default), sequence number = 2. HOST -> 02 63 00 00 00 00 00 02 00 00 00 [Checksum] 03 RDR -> 02 00 00 03 RDR -> 02 81 00 00 00 00 00 02 00 00 00 [Checksum] 03 Example2. To deactivate the SAM Interface 2 slot 0 (default), sequence number = 2. HOST -> 12 63 00 00 00 00 00 02 00 00 00 [Checksum] 13 RDR -> 12 00 00 13 RDR -> 12 81 00 00 00 00 00 02 00 00 00 [Checksum] 13 Example3.
ACR122L-ACS ACR122L Response Frame Format STX Bulk-IN Header abData Checksum ETX N Bytes 1 Byte 1 Byte (RDR_to_HOST_DataBlock) 1 Byte 10 Bytes (ATR) For SAM Interface 1, STX = 0x02 and ETX = 0x03 For SAM Interface 2, STX = 0x12 and ETX = 0x13 For SAM Interface 3, STX = 0x22 and ETX = 0x23 RDR_to_HOST_DataBlock Format Offset Field Size Value Description 0 bMessageType 1 80h Indicates that a data block is being sent from the ACR122L 1 dwLength 4 N Size of abData field.
ACR122L-ACS Example3. To send an APDU “80 84 00 00 08” to the SAM Interface 3 slot 0 (default), sequence number = 3. HOST -> 22 6F 05 00 00 00 00 03 00 00 00 80 84 00 00 08 [Checksum] 23 RDR -> 22 00 00 23 RDR -> 22 80 0A 00 00 00 00 03 00 00 00 E3 51 B0 FC 88 AA 2D 18 90 00 [Checksum] 23 Response = E3 51 B0 FC 88 AA 2D 18; SW1 SW2 = 90 00 ACR122L-ACS Design Specification Version 0.
ACR122L-ACS Pseudo APDUs for Contactless Interface and Peripherals Control ACR122L comes with two primitive commands for this purpose. **Remark: For all the Pseduo APDUs below (except Section 5.9 “GET the Firmware Version of the Reader” and “5.8 Pseduo APDU for changing the communication speed”), STX MUST EQUAL to 0x02 and ETX MUST EQUAL to 0x03 5.1. Direct Transmit To send a Pseudo APDU (PN532 and TAG Commands), and the Response Data will be returned. Table 1.
ACR122L-ACS Example 1.
ACR122L-ACS Tip: If the authentication failed, the error code [XX] will be returned. [00] = Valid, other = Error. Please refer to Error Codes Table for more details.
ACR122L-ACS MIFARE 1K Memory Map. Sectors Data Blocks Trailer Block (Total 16 sectors. Each sector consists of 4 consecutive blocks) (3 blocks, 16 bytes per block) (1 block, 16 bytes) Sector 0 0x00 ~ 0x02 0x03 Sector 1 0x04 ~ 0x06 0x07 Sector 14 0x38 ~ 0x0A 0x3B Sector 15 0x3C ~ 0x3E 0x3F Sectors Data Blocks Trailer Block (Total 32 sectors.
ACR122L-ACS Example 2. How to handle Value Blocks of MIFARE 1K/4K Tag? The value blocks are used for performing electronic purse functions. E.g. Increment, Decrement, Restore and Transfer .. etc. The value blocks have a fixed data format which permits error detection and correction and a backup management. Byte Number 0 1 2 3 4 5 6 7 8 9 10 11 12 ______ Description Value Value 13 14 ___ Value Adr Adr 15 ___ Adr Adr Value: A signed 4-Byte value.
ACR122L-ACS >> 02 6F 0A 00 00 00 00 01 00 00 00 FF 00 00 00 05 D5 41 [00] 90 00 [Checksum] 03 Tip: Restore the value of Block 05 (cancel the prior Increment or Decrement operation) << 02 6F 0A 00 00 00 00 01 00 00 00 FF 00 00 00 05 D4 40 01 C2 05 [Checksum] 03 Step 4) Read the content of Block 05 << 02 6F 0A 00 00 00 00 01 00 00 00 FF 00 00 00 05 D4 40 01 30 05 [Checksum] 03 >> 02 6F 1A 00 00 00 00 01 00 00 00 FF 00 00 00 05 D5 41 [00] 65 00 00 00 9A FF FF FF 65 00 00 00 05 FA 05 FA 90 00 [Checksum] 03 In
ACR122L-ACS 5.2. Pseudo APDU for LEDs and Buzzer Control This APDU is used to control the states of the LED_0, LED_1 and Buzzer. Table 2.0A: LED_0, LED_1 and Buzzer Control Command Format (9 Bytes) Command Class INS P1 P2 Lc Data In (4 Bytes) LEDs and Buzzer 0xFF 0x00 0x40 LED 0x04 Blinking Duration Control State Control LED Control P2: LED State Control Table 2.
ACR122L-ACS 0x02: The buzzer will turn on during the T2 Duration 0x03: The buzzer will turn on during the T1 and T2 Duration. Data Out: SW1 SW2. Status Code returned by the reader. Table 2.0D: Status Code Results SW1 SW2 Meaning Success 90 Current LED State The operation is completed successfully. Error 63 00 The operation is failed. Table 3.
ACR122L-ACS Example 1: To read the existing LED State. // Assume both LED_0 and LED_1 are OFF initially // // Not link to the buzzer // APDU = “FF 00 40 00 04 00 00 00 00” Response = “90 00”. LED_0 and LED_1 LEDs are OFF. Example 2: To turn on LED_0 and LED_1 // Assume both LED_0 and LED_1 are OFF initially // // Not link to the buzzer // APDU = “FF 00 40 0F 04 00 00 00 00” Response = “90 03”.
ACR122L-ACS Example 4: To turn on the LED_1 for 2 sec. After that, resume to the initial state // Assume the LED_1 is initially OFF, while the LED_0 is initially ON. // // The LED_1 and buzzer will turn on during the T1 duration, while the LED_0 will turn off during the T1 duration.
ACR122L-ACS LED_1 On LED_1 Off LED_0 On T1 = 500ms T2 = 500ms LED_0 Off Buzzer On Buzzer Off 1Hz = 1000ms Time Interval = 500ms ON + 500 ms OFF T1 Duration = 500ms = 0x05 T2 Duration = 500ms = 0x05 Number of repetition = 0x03 Link to Buzzer = 0x01 APDU = “FF 00 40 50 04 05 05 03 01” Response = “90 02” Example 6: To blink the LED_1 and LED_0 of 1Hz for 3 times // Assume both the LED_0 and LED_1 are initially OFF.
ACR122L-ACS T1 Duration = 500ms = 0x05 T2 Duration = 500ms = 0x05 Number of repetition = 0x03 Link to Buzzer = 0x03 APDU = “FF 00 40 F0 04 05 05 03 03” Response = “90 00” Example 7: To blink the LED_1 and LED_0 in turn of 1Hz for 3 times // Assume both LED_0 and LED_1 LEDs are initially OFF.
ACR122L-ACS 5.3. Pseudo APDU for LEDs Control Enable This APDU is used to set the LEDs Control Enable/ Disable by user. Default “Disable”, the LED perform by the firmware Table 3.0A: Clear LCD Command Format (5 Bytes) Command Class INS P1 P2 Lc LED Control 0xFF 0x00 0x43 bLEDCtrl 0x00 P2: bLEDCtrl (1 Byte) CMD Description 0x00 Disable LEDs Control by user 0xFF Enable LEDs Control by user Data Out: SW1 SW2. Table 3.
ACR122L-ACS Bit 3 LED_3 State Bits 4 – 7 Reserved 1 = On; 0 = Off Data Out: SW1 SW2. Table 4.0B: Status Code Results SW1 SW2 Meaning Success 90 00 The operation is completed successfully. Error 63 00 The operation is failed. 5.5. Pseduo APDU for Buzzer Control This APDU is used to control Buzzer Table 5.
ACR122L-ACS 5.6. Pseudo APDU for Clear LCD This APDU is used to clear all content show on the LCD Table 6.0A: Clear LCD Command Format (5 Bytes) Command Class INS P1 P2 Lc Clear LCD 0xFF 0x00 0x60 0x00 0x00 Data Out: SW1 SW2. Table 6.0B: Status Code Results SW1 SW2 Meaning Success 90 00 The operation is completed successfully. Error 63 00 The operation is failed. ACR122L-ACS Design Specification Version 0.
ACR122L-ACS 5.7. Pseudo APDU for LCD Display (ASCII Mode) This APDU is used to Display LCD Message in ASCII Mode Table 7.0A: LCD Display Command Format (5 Bytes + LCD Message Length) Command Class INS P1 P2 Lc Data In (Max.
ACR122L-ACS Data In: LCD Message The data to be sent to LCD, maximum 16 Character for each line Please follow the Fonts tables (selected by INS Bit 4 - 5) below for the LCD Character Index Remarks: Size of the Characters in Fonts Set A and Fonts Set B is 8x16, but size of the Characters in Fonts Set C is 8x8 Character Set A Character Set B Character Set C Data Out: SW1 SW2. Table 7.0B: Status Code Results SW1 SW2 Meaning Success 90 00 The operation is completed successfully.
5.8. Pseudo APDU for LCD Display (GB Mode) This APDU is used to Display LCD Message in GB Mode Table 8.0A: LCD Display Command Format (5 Bytes + LCD Message Length) Command Class INS P1 P2 Lc Data In (Max.
ACR122L-ACS 5.9. Pseudo APDU for LCD Display (Graphic Mode) This APDU is used to Display LCD Message in Graphic Mode Table 9.0A: LCD Display Command Format (5 Bytes + LCD Message Length) Command Class INS P1 P2 Lc Data In (max. 128 Bytes) LCD Display 0xFF 0x00 0x6A Pixel Data Line Index Pixel Data Length P2: Line Index To set which line to start to update the LCD Display Refer to Below LCD Display Position Lc: Pixel Data Length The length of the pixel data (max.
ACR122L-ACS 5.10. Pseudo APDU for Scrolling LCD Current Display This APDU is used to set scrolling feature of the Current LCD Display Table 10.0A: Scrolling LCD Command Format (5 Bytes + LCD Message Length) Command Class INS P1 P2 Lc Data In (6 Bytes) LCD Display 0xFF 0x00 0x6D 0x06 0x00 Scroll Ctrl Data In: Scroll Ctrl Table 10.
ACR122L-ACS 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 19 Units 21 Units 23 Units 129 Units 131 Units 133 Units 135 Units 145 Units 147 Units 149 Units 151 Units Scrolling Direction: the Scrolling Direction Bit1 0 0 1 1 Bit0 0 1 0 1 Scrolling Direction From Left to Right From Right to Left From Top to Bottom From Bottom to Top Data Out: SW1 SW2. Table 10.0C: Status Code Results SW1 SW2 Meaning Success 90 00 The operation is completed successfully.
ACR122L-ACS 5.12. Pseudo APDU for Stop LCD Scrolling This APDU is used to stop the LCD Scrolling set before, the LCD display will back to normal display position Table 12.0A: Stop Scrolling LCD Command Format (5 Bytes) Command Class INS P1 P2 Lc Clear LCD 0xFF 0x00 0x6F 0x00 0x00 Data Out: SW1 SW2. Table 12.0B: Status Code Results SW1 SW2 Meaning Success 90 00 The operation is completed successfully. Error 63 00 The operation is failed. 5.13.
ACR122L-ACS 5.14. Pseudo APDU for LCD Backlight Control This APDU is used to Control the LCD Backlight Table 14.0A: LCD Backlight Control Command Format (5 Bytes) Command Class INS P1 P2 Lc LCD Backlight Control 0xFF 0x00 0x64 Backlight Control 0x00 P2: Backlight Control Table 14.0B: Backlight Control Format (1 Byte) CMD Description 0x00 LCD Backlight Off 0xFF LCD Backlight On Data Out: SW1 SW2. Table 14.
ACR122L-ACS 5.15. Pseudo APDU for changing the communication speed This APDU is used to change the baud rate. **Remark: STX = 0x32 and ETX = 0x33 Table 15.0A: Baud Rate Control Command Format (9 Bytes) Command Class INS P1 P2 Lc Baud Rate Control 0xFF 0x00 0x44 New Baud Rate 0x00 P2: New Baud Rate 0x00: Set the new baud rate to 9600 bps. 0x01: Set the new baud rate to 115200 bps. **Remark: The feedback’s STX = 0x02 and ETX = 0x03 Data Out: SW1 SW2. Table 15.
ACR122L-ACS Example 1: To initialize a FeliCa Tag (Tag Polling) Step 1: Issue a “Direct Transmit” APDU. The APDU Command should be “FF 00 00 00 09 D4 4A 01 01 00 FF FF 01 00” #In which, Direct Transmit APDU = “FF 00 00 00” Length of the PN532_Tag Command = “09” PN532 Command (InListPassiveTarget 212Kbps) = “D4 4A 01 01” Tag Command (System Code Request) = “00 FF FF 01 00” To send an APDU to the slot 0 (default), sequence number = 1.
ACR122L-ACS Example 2: To write 16 bytes data to the FeliCa Tag (Tag Write) Step 1: Issue a “Direct Transmit” APDU.
ACR122L-ACS Example 3: To read 16 bytes data from the FeliCa Tag (Tag Write) Step 1: Issue a “Direct Transmit” APDU. 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 PN532_Tag Command = “13” PN532 Command (InDataExchange) = “D4 40 01” Tag Command (Read Data) = “10 06 01 01 05 01 86 04 02 02 01 09 01 01 80 00” To send an APDU to the slot 0 (default), sequence number = 3.
ACR122L-ACS Example 4: To initialize an ISO 14443-4 Type B Tag (Tag Polling) Step 1: Issue a “Direct Transmit” APDU. The APDU Command should be “FF 00 00 00 05 D4 4A 01 03 00” #In which, Direct Transmit APDU = “FF 00 00 00” Length of the PN532_Tag Command = “05” PN532 Command (InListPassiveTarget Type B 106Kbps) = “D4 4A 01 03 00” To send an APDU to the slot 0 (default), sequence number = 4.
ACR122L-ACS Example 5: To send an APDU to an ISO 14443-4 Type B Tag (Data Exchange) Step 1: Issue a “Direct Transmit” APDU. The USER APDU Command should be “00 84 00 00 08” The Composed APDU Command should be “FF 00 00 00 08 D4 40 01 00 84 00 00 08” #In which, Direct Transmit APDU = “FF 00 00 00” Length of the PN532_Tag Command = “08” PN532 Command (InDataExchange) = “D4 40 01” Tag Command (Get Challenge) = “00 84 00 00 08” To send an APDU to the slot 0 (default), sequence number = 5.
ACR122L-ACS 5.16. Get the Firmware Version of the reader To retrieve the firmware versions of the reader. For SAM Interface 1 controller, STX = 0x02 and ETX = 0x03 For SAM Interface 2 controller, STX = 0x12 and ETX = 0x13 For SAM Interface 3 controller, STX = 0x22 and ETX = 0x23 Table 16.
ACR122L-ACS 5.17. Basic Program Flow for FeliCa Applications Step 0. Start the application. The first thing is to activate the “SAM Interface”. The ATR of the SAM (if a SAM is inserted) or a Pseduo-ATR “3B 00” (if no SAM is inserted) will be returned. In other word, the SAM is always existed from the view of the application. Step 1. The second thing to do is to change the operating parameters of the PN531. Set the Retry Time to one. Step 2.
ACR122L-ACS 6.0. Mechanical Design ACR122L-ACS Design Specification Version 0.
7.0. Technical Specification Serial Interface Power source ....................................... 7V AC/DC Switching Power Supply Speed................................................... 9.6Kbps, 115.2Kbps (default) Supply Voltage ..................................... Regulated 5V DC Supply Current ..................................... 350mA (maximum); 200mA (normal) Contactless Smart Card Interface Standard...............................................