The ACR122L-USB is a module for accessing both contact and contactless cards with LCD Display. It
can support 3 SAMs access and ISO14443 Part1 - 4 Type A & B, MIFARE, FeliCa and NFC tags.
2.0. Feature
ISO 7816 Parts 1-4 Compliant for SAM Socket.
ISO 14443 Parts 1-4 Compliant for Contactless Smart Card Interface.
Support ISO14443 Part 4 Type A & B, MIFARE, FeliCa and NFC tags.
Built-in Antenna for contactless tags access.
3 X SAM Interface
4 LEDs.
Buzzer.
CCID Compliant for both SAM and PICC interface.
PCSC Compliant for Contact and Contactless Interfaces.
USB V2.0 Interface. (12M bps)
Device Firmware Upgradeable through the USB Interface.
ACR122L
-
USB
-
ACS
3.0. Hardware Interfaces
3.1. USB Interface
The ACR122L-USB is connected to computer through USB as specified in the USB Specification 2.0.
ACR122L-USB 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 (~ 200mA)
Differential signal transmits data between ACR122L-USB and PC.
Differential signal transmits data between ACR122L-USB and PC.
Reference voltage level for power supply
3.2. LEDs
• 4 x User-controllable single color LEDs
• Can select control by firmware or by User
• From Left to right, the color of the LED is: Green, Blue, Yellow and Red
3.3. Buzzer
• User-controllable Mono-Tone buzzer.
• The default Buzzer State is OFF
3.4. SAM Interface
• 3 x SAMs socket is provided.
• Support ISO7816 Parts 1-3 T=0 ,T=1 cards
3.5. LCD
• User-controllable LCD
• User-controllable Yellow-Green Backlight
• 2 Line x 16 Character, 5 x 8 dot matrix, STN Yellow Green LCD Type
• 6 O’clock view angle
3.6. PICC Interface (Contactless Smart Card)
• 3 turns symmetric loop antenna. Center tapped.
• The estimated size = 46mm x 64mm.
• The loop inductance should be around ~ 1.6uH to 2.5uH
• Operating Distance for different Tags ~ up to 50mm (depend on the Tag)
• Only one Tag can be accessed at any one time.
ACR122L
-
USB
-
ACS
4.0. Implementation
4.1. The ACR122L-USB is built based on the ST221 and PN5321
chips.
LCD
Buzzer
&LED1
&LED2
&LED3
Built-In
Antenna
&LED4
PN532
NFC Interface
Chip
ST2211U
Host Controller
SPI
USB2.0
USB
USB
Firmware
Upgrade
PC
Windows
operating
system
PICC
Contactless Card
Contactless Interface
Carrier =13.56MHz
SAM1
ISO7816 Interface
Logic switch
SAM2SAM3
ACR122L
-
USB
-
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.
PCSC
Driver
ACR122L-USB
PCSC SAM1
Interface
ACR122L-USB
PCSC SAM2
Interface
ACR122L-USB
PCSC SAM3
Interface
PCSC Layer
ACR122L-USB
PCSC PICC
Interface
USB
Interface
(CCID)
ACR122L-USB
SAM1
(Socket)
ISO 7816 Part1-4
+
T=0,T=1 SAM Interfaces
SAM2
(Socket)
SAM3
(Socket)
T=CL &T=1
Emulation
ISO 14443 Part1-4&
FeliCa
PICC Interface
PICC
(Built-In Antenna )
Peripherals
RF
Interface
ACR122L
-
USB
-
ACS
5.0. Firmware Upgrade
5.1. With Press FW Key
Step 1: Unplug the USB Cable from the PC.
Step 2: Press and Hold the FW Key
Step3: Plug the USB Cable to the PC.
Step 4: The USB Mass Storage Device can be found in Device Manager, release the FW Key
Step 5: Execute the Firmware Upgrade Program:
“
Step 6: Pressing the “Load BIN” Button.
Select the “Firmware” file for Upload to the Reader
FW Upgrade Tool.exe”
ACR122L
-
USB
-
ACS
Step 7: Pressing the “Start Program” Button.
The firmware is being uploaded to the reader
The firmware upgrade is completed.
Step 8: Close the plastic covers. After that, reconnect the USB cord.
Noted:
If the upgrade firmware “fail”, please repeat do from steps 3 to 7.
ACR122L
-
USB
-
ACS
5.2. Without Press FW Key
Step 1: Plug the USB Cable from the PC.
Step 2: Send EscapeCommand for Enter FW upgrade mode
Command = {E0 00 00 E0 00}.
Response = {E1 00 00 00 01 “Status”}
Step 3: The USB Mass Storage Device can be found in Device Manager, release the FW Key
Step 4: Execute the Firmware Upgrade Program:
“
Step 5: Pressing the “Load BIN” Button.
Select the “Firmware” file for Upload to the Reader
FW Upgrade Tool.exe”
ACR122L
-
USB
-
ACS
Step 6: Pressing the “Start Program” Button.
The firmware is being uploaded to the reader
The firmware upgrade is completed.
Step 7: Close the plastic covers. After that, reconnect the USB cord.
Noted:
If the upgrade firmware “fails”, please using “5.1 With Press FW Key” Steps to do the upgrade
ACR122L
-
USB
-
ACS
Pseudo APDUs for Contactless Interface and Peripherals Control
6.0. PICC Interface Description
6.1. ATR Generation
If the reader detects a PICC, an ATR will be sent to the PCSC driver for identifying the PICC.
1.1 ATR format for ISO 14443 Part 3 PICCs.
Byte
0 3B Initial Header
1 8N T0 Higher nibble 8 means: no TA1, TB1, TC1 only
2 80 TD1 Higher nibble 8 means: no TA2, TB2, TC2 only
3 01 TD2 Higher nibble 0 means no TA3, TB3, TC3, TD3
1 8N T0 Higher nibble 8 means: no TA1, TB1, TC1 only
2 80 TD1 Higher nibble 8 means: no TA2, TB2, TC2 only
3 01 TD2 Higher nibble 0 means no TA3, TB3, TC3, TD3
to
3 + N
Value
(Hex)
XX T1 4
XX
XX
XX
Designation Description
TD1 is following.
Lower nibble N is the number of historical bytes
(HistByte 0 to HistByte N-1)
TD2 is following.
Lower nibble 0 means T = 0
following.
Lower nibble 1 means T = 1
Historical Bytes:
Tk
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
E.g 1. ATR for DESFire = { 3B 81 80 01 80 80 } // 6 bytes of ATR
ACR122L
-
USB
-
ACS
Hint: Use the APDU “FF CA 01 00 00” to distinguish the ISO14443A-4 and ISO14443B-4 PICCs, and
retrieve the full ATS if available. ISO14443A-3 or ISO14443B-3/4 PICCs do have ATS returned.
2nd LINE 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
3rd LINE 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
4th LINE 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
POSITION
LCD XY
POSITION
Lc: LCD Message Length
The length of the LCD message (max. 0x10); If the message length is longer than the number of
character that the LCD screen’s can be shown, then the redundant character will not be shown on the
LCD
ACR122L
-
USB
-
ACS
Data In:
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
LCD Message
Character Set A Character Set B Character Set C
Data Out: SW1 SW2.
Table 7.0B: Status Code
Results
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
SW1 SW2 Meaning
6.3.7. Pseudo APDU for LCD Display (GB Mode)
This APDU is used to Display LCD Message in GB Mode
The Character to be displayed on the LCD position specified by DDRAM Address
ACR122L
-
USB
-
ACS
Please follow the DDRAM table below for the LCD character position’s representation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 DISPLAY
FIRST LINE 00 01 02 03 04 05 06 07
SECOND LINE 40 41 42 43 44 45 46 47
POSITION
LCD XY
POSITION
Lc: LCD Message Length
The length of the LCD message (max. 0x10); If the message length is longer than the number of
character that the LCD screen’s can be shown, then the redundant character will not be shown on the
LCD
The length of the LCD message should multiple of 2 because each Chinese Character (GB code)
should be contain two bytes
Data In:
LCD Message
The data to be sent to LCD, maximum 8(2 x 8bit each character) Character for each line
Please follow the Fonts table of GB Coding
Data Out: SW1 SW2.
Table 8.0B: Status Code
Results
SW1 SW2 Meaning
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
6.3.8. Pseudo APDU for LCD Display (Graphic Mode)
This APDU is used to Display LCD Message in Graphic Mode
2nd LINE 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
3rd LINE 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
4th LINE 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
POSITION
LCD XY
POSITION
Lc: LCD Message Length
The length of the LCD message (max. 0x10); If the message length is longer than the number of
character that the LCD screen’s can be shown, then the redundant character will not be shown on the
LCD
Data In:
LCD Message
The data to be sent to LCD, maximum 16 Character for each line
ACR122L
-
USB
-
ACS
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
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
SW1 SW2 Meaning
6.4.11. Escape APDU for LCD Display (GB Mode)
This APDU is used to Display LCD Message in GB Mode
The Character to be displayed on the LCD position specified by DDRAM Address
Please follow the DDRAM table below for the LCD character position’s representation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 DISPLAY
FIRST LINE 00 01 02 03 04 05 06 07
SECOND LINE 40 41 42 43 44 45 46 47
POSITION
LCD XY
POSITION
Lc: LCD Message Length
The length of the LCD message (max. 0x10); If the message length is longer than the number of character
that the LCD screen’s can be shown, then the redundant character will not be shown on the LCD
The length of the LCD message should multiple of 2 because each Chinese Character (GB code) should be
contain two bytes
Data In:
LCD Message
The data to be sent to LCD, maximum 8(2 x 8bit each character) Character for each line
Please follow the Fonts table of GB Coding
Data Out: SW1 SW2.
Table 8.0B: Status Code
Results
SW1 SW2 Meaning
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
6.4.12. Escape APDU for LCD Display (Graphic Mode)
This APDU is used to Display LCD Message in Graphic Mode
The “Get Data command” will return the serial number or ATS of the “connected PICC”.
Table 1.1-1a: Get UID APDU Format (5 Bytes)
Command
Get Data FF CA 00
Table 2.1-1b: Get UID Response Format (UID + 2 Bytes) if P1 = 0x00
Response
Result
Table 2.1-1c: Get ATS of a ISO 14443 A card (ATS + 2 Bytes) if P1 = 0x01
UID
(LSB)
Class INS P1 P2 Le
00 00
01
Data Out
UID
(MSB)
SW1 SW2
(Max
Length)
Response
Result
Data Out
ATS SW1 SW2
ACR122L
-
USB
-
ACS
Table 2.1-1d: Response Codes
Results
Success 90 00 The operation is completed successfully.
Warning 62 82 End of UID/ATS reached before Le bytes (Le
Error 6C XX Wrong length (wrong number Le: ‘XX’
Error 63 00 The operation is failed.
Error 6A 81 Function not supported
Examples:
// To get the serial number of the “connected PICC”
UINT8 GET_UID[5]={0xFF, 0xCA, 0x00, 0x00, 0x00};
// To get the ATS of the “connected ISO 14443 A PICC”
UINT8 GET_ATS[5]={0xFF, 0xCA, 0x01, 0x00, 0x00};
SW1 SW2 Meaning
is greater than UID Length).
encodes the exact number) if Le is less than
the available UID length.
6.7. PICC Commands (T=CL Emulation) for MIFare 1K/4K MEMORY
Cards
6.7.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.
Table 2.1-1a: Load Authentication Keys APDU Format (11 Bytes)
Command
Load
Authentication
Keys
Key Structure (1 Byte):
0x00 = Key is loaded into the reader volatile memory.
Class INS P1 P2 Lc Data In
FF 82 Key
Structure
Key
Number
06 Key
(6 bytes)
Other = Reserved.
Key Number (1 Byte):
0x00 ~ 0x01 = Key Location. The keys will be disappeared once the reader is disconnected from the PC.
ACR122L
-
USB
-
ACS
Key (6 Bytes):
The key value loaded into the reader. E.g. {FF FF FF FF FF FF}
Table 2.1-1b: Load Authentication Keys Response Format (2 Bytes)
Success 90 00 The operation is completed successfully.
Error
Examples:
// 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}
Data Out
SW1 SW2
SW1 SW2 Meaning
63 00 The operation is failed.
6.7.2. Authentication for MIFARE 1K/4K
The “Authentication command” uses the keys stored in the reader to do authentication with the MIFARE
1K/4K card (PICC). Two types of authentication keys are used, TYPE_A and TYPE_B respectively.
Table 2.2-1a: Load Authentication Keys APDU Format (6 Bytes) #Obsolete
Command
Authentication
Table 2.2-1b: Load Authentication Keys APDU Format (10 Bytes)
Command
Authentication
Authenticate Data Bytes (5 Byte):
Class INS P1 P2 P3 Data In
FF 88 00 Block
Number
Class INS P1 P2 Lc Data In
FF 86 00 00 05 Authenticate Data
Key
Type
Key Number
Bytes
Byte1
Version
0x01
Byte 2 Byte 3 Byte 4 Byte 5
0x00 Block
Number
Key
Type
Key
Number
ACR122L
-
USB
-
ACS
Bytes
Block Number (1 Byte):
The memory block to be authenticated.
For MIFARE 1K Card, it has totally 16 sectors and each sector consists of 4 consecutive blocks. E.g. Sector
0x00 consists of Blocks {0x00, 0x01, 0x02 and 0x03}; Sector 0x01 consists of Blocks {0x04, 0x05, 0x06 and
0x07}; the last sector 0x0F consists of Blocks {0x3C, 0x3D, 0x3E and 0x3F}. Once the authentication is
done successfully, there is no need to do the authentication again provided that the blocks to be accessed
are belonging to the same sector. Please refer to the MIFARE 1K/4K specification for more details.
#Once the block is authenticated successfully, all the blocks belonging to the same sector are accessible.
Key Type (1 Byte):
0x60 = Key is used as a TYPE A key for authentication.
0x61 = Key is used as a TYPE B key for authentication.
0x00 ~ 0x01 = Key Location.
Table 2.2-1b: Load Authentication Keys Response Format (2 Bytes)
Success 90 00 The operation is completed successfully.
Error
MIFARE 1K Memory Map.
(Total 16 sectors. Each sector
consists of 4 consecutive
Data Out
SW1 SW2
SW1 SW2 Meaning
63 00 The operation is failed.
Sectors
blocks)
Data Blocks
(3 blocks, 16 bytes per
block)
(1 block, 16 bytes)
Trailer Block
Sector 0 0x00 ~ 0x02 0x03
Sector 1 0x04 ~ 0x06 0x07
Sector 14 0x38 ~ 0x0A 0x3B
Sector 15 0x3C ~ 0x3E 0x3F
MIFARE 4K Memory Map.
1K
..
..
ACR122L
-
USB
-
ACS
Bytes
Bytes
Sectors
(Total 32 sectors. Each sector
consists of 4 consecutive
blocks)
Sector 0 0x00 ~ 0x02 0x03
Sector 1 0x04 ~ 0x06 0x07
..
..
Sector 30 0x78 ~ 0x7A 0x7B
Sector 31 0x7C ~ 0x7E 0x7F
Sectors
(Total 8 sectors. Each sector
consists of 16 consecutive
blocks)
Sector 32 0x80 ~ 0x8E 0x8F
Sector 33 0x90 ~ 0x9E 0x9F
..
Data Blocks
(3 blocks, 16 bytes per
block)
Data Blocks
(15 blocks, 16 bytes per
block)
Trailer Block
(1 block, 16 bytes)
2K
Trailer Block
(1 block, 16 bytes)
2K
..
Sector 38 0xE0 ~ 0xEE 0xEF
Sector 39 0xF0 ~ 0xFE 0xFF
Examples:
// To authenticate the Block 0x04 with a {TYPE A, key number 0x00}.
// PC/SC V2.01, Obsolete
APDU = {FF 88 00 04 60 00};
<Similarly>
// To authenticate the Block 0x04 with a {TYPE A, key number 0x00}.
// PC/SC V2.07
APDU = {FF 86 00 00 05 01 00 04 60 00}
Hints:
MIFARE Ultralight does not need to do any authentication. The memory is free to access.
MIFARE Ultralight Memory Map.
Byte Number
Serial Number SN0 SN1 SN2 BCC0 0
0 1 2 3 Page
ACR122L
-
USB
-
ACS
Serial Number SN3 SN4 SN5 SN6 1
Internal / Lock BCC1 Internal Lock0 Lock1 2
OTP OPT0 OPT1 OTP2 OTP3 3
Data read/write Data0 Data1 Data2 Data3 4
Data read/write Data4 Data5 Data6 Data7 5
Data read/write Data8 Data9 Data10 Data11 6
Data read/write Data12 Data13 Data14 Data15 7
Data read/write Data16 Data17 Data18 Data19 8
Data read/write Data20 Data21 Data22 Data23 9
Data read/write Data24 Data25 Data26 Data27 10
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/write Data44 Data45 Data46 Data47 15
512 bits
Or
6.7.3. Read Binary Blocks
The “Read Binary Blocks command” is used for retrieving a multiple of “data blocks” from the PICC. The
data block/trailer block must be authenticated first before executing the “Read Binary Blocks command”.
Table 2.3-1a: Read Binary APDU Format (5 Bytes)
Command
Read Binary
Blocks
Block Number (1 Byte):
The starting block.
Number of Bytes to Read (1 Byte):
Multiply of 16 bytes for MIFARE 1K/4K or Multiply of 4 bytes for MIFARE Ultralight
• Maximum 16 bytes for MIFARE Ultralight.
• Maximum 48 bytes for MIFARE 1K. (Multiple Blocks Mode; 3 consecutive blocks)
• Maximum 240 bytes for MIFARE 4K. (Multiple Blocks Mode; 15 consecutive blocks)
Example 1: 0x10 (16 bytes). The starting block only. (Single Block Mode)
Example 2: 0x40 (64 bytes). From the starting block to starting block+3. (Multiple Blocks Mode)
#For safety reason, the Multiple Block Mode is used for accessing Data Blocks only. The Trailer Block is not
supposed to be accessed in Multiple Blocks Mode. Please use Single Block Mode to access the Trailer
Block.
Class INS P1 P2 Le
FF B0 00 Block
Number
Number
of Bytes
to Read
Table 2.3-1b: Read Binary Block Response Format (Multiply of 4/16 + 2 Bytes)
Response
Result
Table 2.3-1c: Read Binary Block Response Codes
Results
Success 90 00 The operation is completed successfully.
Error
Examples:
// Read 16 bytes from the binary block 0x04 (MIFARE 1K or 4K)
APDU = {FF B0 00 04 10}
Data (Multiply of 4/16 Bytes)
SW1 SW2 Meaning
63 00 The operation is failed.
Data Out
SW1 SW2
ACR122L
-
USB
-
ACS
// Read 240 bytes starting from the binary block 0x80 (MIFARE 4K)
// Block 0x80 to Block 0x8E (15 blocks)
APDU = {FF B0 00 80 F0}
6.7.4. Update Binary Blocks
The “Update Binary Blocks command” is used for writing a multiple of “data blocks” into the PICC. The data
block/trailer block must be authenticated first before executing the “Update Binary Blocks command”.
Table 2.3-1a: Update Binary APDU Format (Multiple of 16 + 5 Bytes)
Command
Update Binary
Blocks
Block Number (1 Byte):
The starting block to be updated.
Number of Bytes to Update (1 Byte):
• Multiply of 16 bytes for MIFARE 1K/4K or 4 bytes for MIFARE Ultralight.
• Maximum 48 bytes for MIFARE 1K. (Multiple Blocks Mode; 3 consecutive blocks)
• Maximum 240 bytes for MIFARE 4K. (Multiple Blocks Mode; 15 consecutive blocks)
Example 1: 0x10 (16 bytes). The starting block only. (Single Block Mode)
Example 2: 0x30 (48 bytes). From the starting block to starting block+2. (Multiple Blocks Mode)
#For safety reason, the Multiple Block Mode is used for accessing Data Blocks only. The Trailer Block is not
supposed to be accessed in Multiple Blocks Mode. Please use Single Block Mode to access the Trailer
Block.
Class INS P1 P2 Lc Data In
FF D6 00 Block
Number
Number
of Bytes
to Update
Block Data
(Multiple of 16 Bytes)
Block Data (Multiply of 16 + 2 Bytes, or 6 bytes):
The data to be written into the binary block/blocks.
// Update the binary block 0x04 of MIFARE Ultralight with Data {00 01 02 03}
APDU = {FF D6 00 04 04 00 01 02 03}
SW1 SW2 Meaning
63 00 The operation is failed.
6.7.5. Value Block Related Commands
The data block can be used as value block for implementing value-based applications.
6.7.5.1. Value Block Operation
The “Value Block Operation command” is used for manipulating value-based transactions. E.g. Increment a
value of the value block etc.
Table 2.5.1-1a: Value Block Operation APDU Format (10 Bytes)
Command
Value Block
Operation
Block Number (1 Byte):
The value block to be manipulated.
VB_OP (1 Byte):
0x00 = Store the VB_Value into the block. The block will then be converted to a value block.
0x01 = Increment the value of the value block by the VB_Value. This command is only valid for value block.
0x02 = Decrement the value of the value block by the VB_Value. This command is only valid for value block.
VB_Value (4 Bytes):
The value used for value manipulation. The value is a signed long integer (4 bytes).
Class INS P1 P2 Lc Data In
FF D7 00 Block
Number
05 VB_OP
VB_Value
(4 Bytes)
{MSB .. LSB}
E.g. 1: Decimal –4 = {0xFF, 0xFF, 0xFF, 0xFC}
VB_Value
MSB LSB
FF FF FF FC
E.g. 2: Decimal 1 = {0x00, 0x00, 0x00, 0x01}
VB_Value
MSB LSB
00 00 00 01
Table 2.5.1-1b: Value Block Operation Response Format (2 Bytes)
Response
Result SW1 SW2
Table 2.5.1-1c: Value Block Operation Response Codes
Results SW1 SW2 Meaning
Data Out
ACR122L
-
USB
-
ACS
Success 90 00 The operation is completed
successfully.
Error
63 00 The operation is failed.
6.7.5.2. Read Value Block
The “Read Value Block command” is used for retrieving the value from the value block. This command is
only valid for value block.
Table 2.5.2-1a: Read Value Block APDU Format (5 Bytes)
Command
Read Value
Block
Block Number (1 Byte):
The value block to be accessed.
Table 2.5.2-1b: Read Value Block Response Format (4 + 2 Bytes)
Response
Class INS P1 P2 Le
FF B1 00 Block
Number
Data Out
00
Result
Value (4 Bytes):
The value returned from the card. The value is a signed long integer (4 bytes).
E.g. 1: Decimal –4 = {0xFF, 0xFF, 0xFF, 0xFC}
Value
MSB LSB
FF FF FF FC
E.g. 2: Decimal 1 = {0x00, 0x00, 0x00, 0x01}
Value
MSB LSB
00 00 00 01
Table 2.5.3-1c: Read Value Block Response Codes
Value
{MSB .. LSB}
SW1 SW2
Results
Success 90 00 The operation is completed successfully.
Error
SW1 SW2 Meaning
63 00 The operation is failed.
ACR122L
-
USB
-
ACS
6.7.5.3. Restore Value Block
The “Restore Value Block command” is used to copy a value from a value block to another value block.
Table 2.5.3-1a: Restore Value Block APDU Format (7 Bytes)
Command
Value Block
Operation
Source Block Number (1 Byte): The value of the source value block will be copied to the target value
Target Block Number (1 Byte): The value block to be restored. The source and target value blocks must
Table 2.5.3-1b: Restore Value Block Response Format (2 Bytes)
Response
Result
Class INS P1 P2 Lc Data In
FF D7 00 Source
Block
Number
block.
be in the same sector.
Data Out
SW1 SW2
02 03 Target
Number
Block
Table 2.5.3-1c: Restore Value Block Response Codes
Results
Success 90 00 The operation is completed successfully.
Error
Examples:
// Store a value “1” into block 0x05
APDU = {FF D7 00 05 05 00 00 00 00 01}
// Read the value block 0x05
APDU = {FF B1 00 05 00}
// Copy the value from value block 0x05 to value block 0x06
APDU = {FF D7 00 05 02 0306}
SW1 SW2 Meaning
63 00 The operation is failed.
// Increment the value block 0x05 by “5”
APDU = {FF D7 00 05 05 01 00 00 00 05}
ACR122L
-
USB
-
ACS
ACR122L
-
USB
-
ACS
7.0. Basic Program Flow for Contactless Applications
Step 0. Start the application. The reader will do the PICC Polling and scan for tags continuously.
Once the tag is found and detected, the corresponding ATR will be sent to the PC.
Step 1. Connect the “ACR122L PICC Interface” with T=1 protocol.
Step 2. Access the PICC by exchanging APDUs.
..
Step N. Disconnect the “ACR122L PICC Interface”. Shut down the application.
ACR122L
-
USB
-
ACS
7.1. How to access PCSC Compliant Tags (ISO14443-4)?
Basically, all ISO 14443-4 complaint cards (PICCs) would understand the ISO 7816-4 APDUs. The
ACR122L-USB Reader just has to communicate with the ISO 14443-4 complaint cards through exchanging
ISO 7816-4 APDUs and Responses. ACR122L-USB will handle the ISO 14443 Parts 1-4 Protocols
internally.
MIFARE 1K, 4K, MINI and Ultralight tags are supported through the T=CL emulation. Just simply treat the
MIFARE tags as standard ISO14443-4 tags. For more information, please refer to topic “PICC Commands
for MIFARE Classic Memory Tags”
Table 3.1-1a: ISO 7816-4 APDU Format
Command Class INS P1 P2 Lc Data In Le
ISO 7816 Part
4 Command
Table 3.1-1b: ISO 7816-4 Response Format (Data + 2 Bytes)
Response
Result
Table 3.1-1c: Common ISO 7816-4 Response Codes
Results
Success 90 00 The operation is completed successfully.
Error
Length of
the Data
In
Data Out
Response Data SW1 SW2
SW1 SW2 Meaning
63 00 The operation is failed.
Expected
length of
the
Response
Data
Email:
info@acs.com.hk
Typical sequence may be:
- Present the Tag and Connect the PICC Interface
- Read / Update the memory of the tag
Step 1) Connect the Tag
The ATR of the tag is 3B 8C 80 01 50 57 26 34 D9 1C 2D 94 11 F7 71 85 76
In which,
The ATQB = 50 57 26 34 D9 1C 2D 94 11 F7 71 85. It is an ISO14443-4 Type B tag.
Step 2) Send an APDU, Get Challenge.
<< 00 84 00 00 08
>> 44 70 3D A2 6C DA 43 D5 [90 00]
Hint:
For ISO14443-4 Type A tags, the ATS can be obtained by using the APDU “FF CA 01 00 00”
Website: www.acs.com.hk
Email:
info@acs.com.hk
For Example: ISO7816-4 APDU
// To read 8 bytes from an ISO 14443-4 TypeA PICC
APDU ={80 B2 80 00 08}
Class = 0x80
INS = 0xB2
P1 = 0x80
P2 = 0x00
Lc = None
Data In = None
Le = 0x08
Answer: 01 02 03 04 05 06 07 08 [90 00]
Website: www.acs.com.hk
Email:
info@acs.com.hk
7.2. How to access DESFIRE Tags (ISO14443-4)?
The DESFIRE supports ISO7816-4 APDU Wrapping and Native modes. Once the DESFire Tag is
activated, the first APDU sent to the DESFire Tag will determine the “Command Mode”. If the first
APDU is “Native Mode”, the rest of the APDUs must be in “Native Mode” format. Similarly, If the first
APDU is “ISO7816-4 APDU Wrapping Mode”, the rest of the APDUs must be in “ISO7816-4 APDU
Wrapping Mode” format.
Example 1: DESFIRE ISO7816-4 APDU Wrapping.
// To read 8 bytes random number from an ISO 14443-4 Type A PICC (DESFIRE)
APDU = {90 0A 00 00 01 00 00}
Class = 0x90; INS = 0x0A (DESFire Instruction); P1 = 0x00; P2 = 0x00
Lc = 0x01; Data In = 0x00; Le = 0x00 (Le = 0x00 for maximum length)
Answer: F2 84 A2 42 E1 3B C4 66 91 AF[$91AF]
# Status Code{91 AF} is defined in DESFIRE specification. Please refer to the DESFIRE specification
for more details.
Example 2: DESFIRE Frame Level Chaining (ISO 7816 wrapping mode)
// In this example, the application has to do the “Frame Level Chaining”.
Website: www.acs.com.hk
ACR122L
-
USB
-
ACS
// To get the version of the DESFIRE card.
Step 1: Send an APDU {90 60 00 00 00} to get the first frame. INS=0x60
Answer: 04 01 01 01 00 1A 05 91 AF[$91AF]
Step 2: Send an APDU {90 AF 00 00 00} to get the second frame. INS=0xAF
Answer: 04 01 01 01 00 1A 05 91 AF[$91AF]
Step 3: Send an APDU {90 AF 00 00 00} to get the last frame. INS=0xAF
In DESFIRE Native Mode, the status code [90 00] will not be added to the response if the response
length is greater than 1. If the response length is less than 2, the status code [90 00] will be added in
order to meet the requirement of PCSC. The minimum response length is 2.
7.3. How to access FeliCa Tags (ISO18092)?
Typical sequence may be:
- Present the FeliCa Tag and Connect the PICC Interface
OEM-Logo possible, customer-specific colors, casing, and card connector
FCC Caution:
Any Changes or modifications not expressly approved by the party responsible for complianc e
could void the user’s authority to operate the equipment.
This device complies with part 15 of the FCC Rules. Operation is subject to the following
two conditions:
(1) This device may not cause harmful interference, and (2) this device must accept any
interference received, including interference that may cause undesired operation.
Note: This equipment has been tested and found to comply with the limits for a Class B digital
device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasona ble
protection against harmful interference in a residential installation. This equipment generates,
uses and can radiate radio frequency energy and, if not installed and used in accordance with
the instructions, may cause harmful interference to radio communications. However, there is
no guarantee that interference will not occur in a particular installation. If this equipment does
cause harmful interference to radio or television recept ion, which can be determined by turning
the equipment off and on, the user is encouraged to try to correct the interference by one or
more of the following measures:
—Reorient or relocate the receiving antenna.
—Increase the separation between the equipment and receiver.
—Connect the equipment into an outlet on a circuit different from that to which the receiver is
connected.
—Consult the dealer or an experienced radio/TV technician for help.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.