ACS AET62 User Manual

AET62 NFC Reader
Reference Manual
Subject to change without prior notice
info@acs.com.hk
www.acs.com.hk
Table of Contents
2.0. ..................................................................6AET62 Contactless Smart Card Reader
2.1. ........................................................................................................................6USB Interface
3.0. ..........................................................................................................7Implementation
3.1. ...................................................................................7Communication Flow Chart of AET62
................................................................................7Smart Card Reader Interface Overview
3.2.
4.0. .......................................................................................8PICC Interface Description
4.1. .....................................................................................................................8ATR Generation
......................................................................8ATR format for ISO 14443 Part 3 PICCs
4.1.1.
......................................................................9ATR format for ISO 14443 Part 4 PICCs
4.1.2.
5.0. ................................................................10PICC Commands for General Purposes
5.1. ...............................................................................................................................10Get Data
6.0. .............11PICC Commands (T=CL Emulation) for Mifare Classic Memory Cards
6.1. ....................................................................................................11Load Authentication Keys
......................................................................................................................12Authentication
6.2.
.............................................................................................................15Read Binary Blocks
6.3.
..........................................................................................................16Update Binary Blocks
6.4.
.........................................................................................16Value Block Related Commands
6.5.
................................................................................................16Value Block Operation
6.5.1.
........................................................................................................17Read Value Block
6.5.2.
....................................................................................................18Restore Value Block
6.5.3.
7.0. ........................................................................................................19Pseudo-APDUs
7.1. ....................................................................................................................19Direct Transmit
...........................................................................................................19Bi-Color LED Control
7.2.
..............................................................................20Get the Firmware Version of the reader
7.3.
.....................................................................................20Get the PICC Operating Parameter
7.4.
.....................................................................................21Set the PICC Operating Parameter
7.5.
8.0. ..............................................22Basic Program Flow for Contactless Applications
8.1. .....................................................23How to Access PCSC-Compliant Tags (ISO 14443-4)?
...................................................................24How to Access DESFire Tags (ISO 14443-4)?
8.2.
..........................................................................25How to Access FeliCa Tags (ISO 18092)?
8.3.
........25How to Access NFC Forum Type 1 Tags (ISO 18092), e.g. Jewel and Topaz Tags?
8.4.
...........................................................27Get the Current Setting of the Contactless Interface
8.5.
Appendix A. ...............................................................28AET62 PCSC Escape Command
Appendix B. ..31APDU Command and Response Flow for ISO 14443-Compliant Tags Appendix C. ..32APDU Command and Response Flow for ISO 18092-Compliant Tags
Appendix D. .................................................................................................33Error Codes
Appendix E. ...........................................................34Sample Codes for Setting the LED
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 2 of 35
info@acs.com.hk
www.acs.com.hk
Figures
Figure 1: ..........................................................................................5AET62 System Block Diagram
Figure 2: Figure 3:
...............................................................................7Communication Flow Chart of AET62
...........................................................22 Basic Program Flow for Contactless Applications
Tables
Table 1: ........................................................................................................................6USB Interface
Table 2: Table 3: Table 4: Table 5: Table 6: Table 7: Table 8: Table 9: Table 10: Table 11: Table 12: Table 13:
..............................................................................8ATR format for ISO 14443 Part 3 PICCs
..............................................................................9ATR format for ISO 14443 Part 4 PICCs
........................................................................................10Get UID APDU Format (5 Bytes)
...................................................10Get UID Response Format (UID + 2 Bytes) if P1 = 0x00
...........................................10Get ATS of a ISO 14443 A card (ATS + 2 Bytes) if P1 = 0x01
.................................................................................................................10Response Codes
..........................................................11 Load Authentication Keys APDU Format (11 Bytes)
......................................................11 Load Authentication Keys Response Format (2 Bytes)
...................................................................11Load Authentication Keys Response Codes
.......................................12 Load Authentication Keys APDU Format (6 Bytes) [Obsolete]
.......................................................12 Load Authentication Keys APDU Format (10 Bytes)
....................................................................................12Authenticate Data Bytes (5 Byte)
Table 14: Table 15: Table 16: Table 17: Table 18: Table 19: Table 20: Table 21: Table 22: Table 23: Table 24: Table 25: Table 26: Table 27: Table 28: Table 29: Table 30:
..................................................12Load Authentication Keys Response Format (2 Bytes)
...................................................................12Load Authentication Keys Response Codes
..............................................................................15Read Binary APDU Format (5 Bytes)
.......................................................15 Read Binary Block Response Format ( N + 2 Bytes)
..............................................................................15Read Binary Block Response Codes
...........................................................16 Update Binary APDU Format (4 or 16 + 5 Bytes)
............................................................16 Update Binary Block Response Codes (2 Bytes)
............................................................16 Value Block Operation APDU Format (10 Bytes)
.......................................................17 Value Block Operation Response Format (2 Bytes)
........................................................................17Value Block Operation Response Codes
.....................................................................17Read Value Block APDU Format (5 Bytes)
........................................................17 Read Value Block Response Format (4 + 2 B ytes)
...............................................................................18Read Value Block Response Codes
.................................................................18Restore Value Block APDU Format (7 Bytes)
...........................................................18 Restore Value Block Response Format (2 Bytes)
..........................................................................18Restore Value Block Response Codes
...........................19Direct Transmit Command Format (Length of the Payload + 5 Bytes)
Table 31: Table 32: Table 33:
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
..................................................................................19Direct Transmit Response Format
.........................................................19 Bi-Color LED Control Command Format (9 Bytes)
.............................................................................19Bi-Color LED Control Format (1 Byte)
Document Title Here
Page 3 of 35
info@acs.com.hk
www.acs.com.hk
Table 34: ..............................................20Bi-Color LED Blinking Duration Control Format (4 Bytes)
Table 35: Table 36: Table 37: Table 38: Table 39: Table 40: Table 41: Table 42: Table 43: Table 44: Table 45: Table 46:
.....................................................................................................................20Status Code
.............................................................................................20Current LED State (1 Byte)
............................................................................................20Command Format (5 Bytes)
...........................................................................................20Response Format (10 bytes)
............................................................................................20Command Format (5 Bytes)
...............................................................................................21Response Format (1 byte)
............................................................................................21Command Format (5 Bytes)
...............................................................................................21Response Format (1 byte)
.............................................................21PICC Operating Parameter. Default Value = FF
...............................................................................................23ISO 7816-4 APDU Format
.............................................................23ISO 7816-4 Response Format (Data + 2 Bytes)
..........................................................................23Common ISO 7816-4 Response Codes
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 4 of 35
info@acs.com.hk
www.acs.com.hk

1.0. Introduction

The AET62 is a composite device, consisting ACS’ ACR122U NFC Reader’s core and UPEK’s swipe fingerprint sensor. The NFC contactless smart card reader and the fingerprint sensor can be used independently, but combining the two technologies provide a higher level of security in applications. The AET62’s system diagram is shown below:
Figure 1: AET62 System Block Diagram
The purpose of this document is to describe the architecture and interface of AET62’s contactless smart card reader module, which is based on the ACR122U core. For information on the architecture and programming interface of the fingerprint module, please refer to the AET62 Fingerprint Reader Application Programming Interface document (API_AET62_v1.0).
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 5 of 35
info@acs.com.hk
www.acs.com.hk

2.0. AET62 Contactless Smart Card Reader

The AET62 is a PC-linked contactless smart card reader/writer used for accessing ISO14443-4 Type A and B, Mifare, ISO 18092 or NFC, and FeliCa tags. The AET62 Smart Card Reader is PCSC­compliant so it is compatible with existing PCSC applications. Furthermore, the standard Microsoft CCID driver is used to simplify driver installation.
The AET62 serves as the mediating device between the personal computer and the contactless tag via the USB interface. The reader carries out the command issued from the PC, whether the command is used in order to communicate with a contactless tag or control the device peripherals (i.e. bi-color LED).
The AET62 uses the PCSC APDUs for contactless tags following the PCSC Specification and makes use of pseudo APDUs in sending commands for ISO 18092 tags and controlling the device peripherals. This document will discuss how you can use the AET62 in your smart card system.

2.1. USB Interface

The AET62 is connected to a computer through USB as specified in the USB Specification 1.1. The AET62 is working in Full speed mode, i.e. 12 Mbps.
Pin Signal Function 1 V 2 D­3 D+ 4 GND
BUS
+5V power supply for the reader (Max 200 mA, Normal 100 mA) Differential signal transmits data between AET62 and PC. Differential signal transmits data between AET62 and PC. Reference voltage level for power supply
Table 1: USB Interface
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 6 of 35
info@acs.com.hk
www.acs.com.hk

3.0. Implementation

3.1. Communication Flow Chart of AET62

The Standard Microsoft CCID and PCSC drivers are used. Therefore, no ACS drivers are required because the drivers are already built inside the windows operating system. You need to modify your computer’s registry settings to be able to use the full capabilities of the AET62 NFC Reader. See AET62 PCSC Escape
Command for more details.

3.2. Smart Card Reader Interface Overview

Just click the “Device Manager” to find out the “AET62 PICC Interface”. The standard Microsoft USB CCID Driver is used.
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Figure 2: Communication Flow Chart of AET62
Document Title Here
Page 7 of 35
info@acs.com.hk
www.acs.com.hk
4.0. PICC Interface Description

4.1. ATR Generation

If the reader detects a PICC, an ATR will be sent to the PCSC driver to identify the PICC.

4.1.1. ATR format for ISO 14443 Part 3 PICCs

Byte
Value
(Hex)
Designation Description
0 3B Initial Header 1 8N T0 Higher nibble 8 means: no TA1, TB1, TC1
only TD1 is following. Lower nibble N is the number of historical bytes (HistByte 0 to HistByte N-1)
2 80 TD1 Higher nibble 8 means: no TA2, TB2, TC2
only TD2 is following. Lower nibble 0 means T = 0
3 01 TD2 Higher nibble 0 means no TA3, TB3, TC3,
TD3 following. Lower nibble 1 means T = 1
4
To
3+N
80 T1 Category indicator byte, 80 means A status
indicator may be present in an optional COMPACT-TLV data object
4F Application identifier Presence Indicator
Tk
0C Length
RID Registered Application Provider Identifier
(RID) # A0 00 00 03 06
SS Byte for standard
C0 .. C1
Bytes for card name
00 00 00 00 RFU RFU # 00 00 00 00
4+N UU TCK Exclusive-oring of all the bytes T0 to Tk
Table 2: ATR format for ISO 14443 Part 3 PICCs
Example: ATR for MIfare 1K = {3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A}
Initial Header 3B 8F 80 01 80 4F 0C A0 00 00
ATR
T0 TD1 TD2 T1 Tk Length RID Standard Card
03 00 01 00 00 00
03 06
Where: Length (YY) = 0C
RID = A0 00 00 03 06 (PC/SC Workgroup) Standard (SS) = 03 (ISO14443A, Part 3) Card Name (C0 .. C1) = [00 01] (Mifare 1K)
Where, Card Name (C0 .. C1)
00 01: Mifare 1K 00 02: Mifare 4K 00 03: Mifare Ultralight 00 26: Mifare Mini …. F0 04: Topaz and Jewel F0 11: FeliCa 212K F0 12: FeliCa 424K
… FF [SAK]: Undefined
RFU TCK
Name
00
6A
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 8 of 35
info@acs.com.hk
www.acs.com.hk

4.1.2. ATR format for ISO 14443 Part 4 PICCs

Byte Value
Designation Description
(Hex)
0 3B Initial Header 1 8N T0 Higher nibble 8 means: no TA1, TB1, TC1
only TD1 is following. Lower nibble N is the number of historical bytes (HistByte 0 to HistByte N-1)
2 80 TD1 Higher nibble 8 means: no TA2, TB2, TC2
only TD2 is following. Lower nibble 0 means T = 0
3 01 TD2 Higher nibble 0 means no TA3, TB3, TC3,
TD3 following. Lower nibble 1 means T = 1
to
3 + N
XX T1 4 XX XX XX
Tk
Historical Bytes: ISO14443A:
The historical bytes from ATS response. Refer to the ISO14443-4 specification.
ISO14443B: The higher layer response from the ATTRIB response (ATQB). Refer to the ISO14443-3 specification.
4+N UU TCK Exclusive-oring of all the bytes T0 to Tk
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 00
ATR Initial Header T0 TD1 TD2 3B 86 80 01 06 75 77 81 02 80 00
ATS T1 Tk TCK
This ATR has 6 bytes of ATS which is: [06 75 77 81 02 80]
Note: Use the APDU “FF CA 01 00 00” to distinguish the ISO14443A-4 and ISO14443B-4 PICCs, and retrieve the full ATS if available. The ATS is returned for ISO14443A-3 or ISO14443B-3/4 PICCs.
Another example would be the ATR for ST19XRC8E which is: ST19XRC8E (ATR) = 3B 8C 80 01 50 12 23 45 56 12 53 54 4E 33 81 C3 55
ATR Initial Header T0 TD1 TD2 3B 86 80 01 50 12 23 45 56 12 53 54 4E 33 81 C3 55
ATQB T1 Tk TCK
Since this card follows ISO 14443 Type B, the response would be ATQB which is 50 12 23 45 56 12
53 54 4E 33 81 C3 is 12 bytes long with no CRC-B
Note: You can refer to the ISO7816, ISO14443 and PCSC standards for more details.
Page 9 of 35
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
info@acs.com.hk
www.acs.com.hk

5.0. PICC Commands for General Purposes

5.1. Get Data

The “Get Data command” will return the serial number or ATS of the “connected PICC”.
Command Class INS P1 P2 Le
Get Data FF CA
Table 4: Get UID APDU Format (5 Bytes)
Response Data Out
Result UID
(LSB)
Table 5: Get UID Response Format (UID + 2 Bytes) if P1 = 0x00
Response Data Out
Result ATS SW1 SW2
00 01
00
UID
(MSB)
(Full Length)
SW1 SW2
00
Table 6: Get ATS of a ISO 14443 A card (ATS + 2 Bytes) if P1 = 0x01
Results SW1 SW2 Meaning
Success 90 00 Error 63 00 Error 6A 81
Example:
1. To get the serial number of the “connected PICC” UINT8 GET_UID[5]={0xFF, 0xCA, 0x00, 0x00, 0x04};
2. To get the ATS of the “connected ISO 14443 A PICC” UINT8 GET_ATS[5]={0xFF, 0xCA, 0x01, 0x00, 0x04};
The operation is completed successfully. The operation is failed. Function not supported.
Table 7: Response Codes
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 10 of 35
info@acs.com.hk
www.acs.com.hk
6.0. PICC Commands (T=CL Emulation) for Mifare Classic
Memory Cards

6.1. Load Authentication Keys

The “Load Authentication Keys command” will load the authentication keys into the reader. The authentication keys are used to authenticate the particular sector of the Mifare 1K/4K Memory Card. Two kinds of authentication key locations are provided, volatile and non-volatile key locations respectively.
Command Class INS P1 P2 Lc Data In
Load
Authentication
Keys
Table 8: Load Authentication Keys APDU Format (11 Bytes)
Key Structure (1 Byte):
0x00 = Key is loaded into the reader volatile memory. Other = Reserved.
Key Number (1 Byte):
0x00 ~ 0x01 = Key Location. The keys will disappear once the reader is disconnected from the
PC.
Key (6 Bytes):
The key value loaded into the reader. E.g. {FF FF FF FF FF FF}
Table 9: Load Authentication Keys Response Format (2 Bytes)
Results SW1 SW2 Meaning
Success 90 00 Error 63 00
Table 10: Load Authentication Keys Response Codes
Example:
Load a key {FF FF FF FF FF FF} into the key location 0x00. APDU = {FF 82 00 00 06 FF FF FF FF FF FF}
FF 82
Response Data Out
Result SW1 SW2
The operation is completed successfully. The operation is failed.
Key
Structure
Key
Number
06
Key
(6
bytes)
AET62 Reference Manual
Document Title Here
Document Title Here
Version 1.00
Document Title Here
Page 11 of 35
info@acs.com.hk
www.acs.com.hk
Loading...
+ 25 hidden pages