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.03 19/05/2010
Page
5
of
50
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 Design Specification
Version 0.03 19/05/2010
Page
6
of
50
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
2 TXD
3 RXD
4 GND
+5V power supply for the reader (Max 200mA, Normal 100mA)
The signal from the reader to the host.
The signal from the host to the reader.
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 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. Built-in Antenna
• 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-ACS Design Specification
Version 0.03 19/05/2010
Page
7
of
50
ACR122L
-
ACS
Second SAM
4.0. Implementation
4.1. The ACR122L is built based on the AC1038-2, AC1038s and
PN5321 chips.
Built-In
Antenna
Contactless Interface
Carrier = 13.56MHz
Contactless
Tag
PN5321
NFC Interface
Chip
Serial Interface
115200 Kbps
<Peripherals>
- 4 x LEDs
- Buzzer
- LCD
- I/O Ports
SAM 2
AC1038-2
Controller
SAM 1
Main
Controller
AC1038
Controller
Serial
Interface
9600 bps
Host
Controller
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Controller
AC1038
SAM 3
Controller
Third SAM
Controller
Figure 1.ACR122L System Block Diagram
Page
8
of
50
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)
ACR122L
Peripherals
SAM 1
PCSC Layer
ISO 7816 Parts 1-3
+
T=0 SAM Interfaces
Contactless
Interface
SAM 3 SAM 2
RF
Interface
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Contactless Tag
(Built-In Antenna)
Page
9
of
50
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 Command Frame Format
STX Bulk-OUT Header APDU Command
Or
Parameters
1 Byte 10 Bytes M Bytes
(If applicable)
ACR122L Status Frame Format
STX Status Checksun ETX
1 Byte 1 Byte 1 Byte 1 Byte
ACR122L Response Frame Format
STX Bulk-IN Header APDU Response
Or
abData
1 Byte 10 Bytes N Bytes
(If applicable)
Checksum = XOR {Bulk-OUT Header, APDU Command or Parameters}
Checksum = XOR {Bulk-IN Header, APDU Response or abData}
Checksum
1 Byte 1 Byte
Checksun
1 Byte 1 Byte
ETX
ETX
For control SAM Socket 1, the STX must be equal to 0x02 and ETX must be equal to 0x03.
For control SAM Socket 2, the STX must be equal to 0x12 and ETX must be equal to 0x13.
For control SAM Socket 3, the STX must be equal to 0x22 and ETX must be equal to 0x23.
For control access contactless interface, peripherals (i.e. LEDs, LCD and Buzzer), the STX must be
equal to 0x02 and ETX must be equal to 0x03, which is the same with control SAM Socket1.
In general, we would make use of three types of Bulk-OUT Header.
• HOST_to_RDR_IccPowerOn: To activate the SAM interface. The ATR of the SAM will be
returned if available.
• HOST_to_RDR_IccPowerOff: To deactivate the SAM interface.
• HOST_to_RDR_XfrBlock: To exchange APDUs between the Host and ACR122L.
#The SAM1 interface must be activated in order to use the Contactless interface and Peripherals. In
short, all the APDUs are exchanged through the SAM1 Interface.
Similarly, two types of Bulk-IN Header are used.
• RDR_to_HOST_DataBlock: In response to the “HOST_to_RDR_IccPowerOn” and
“HOST_to_RDR_XfrBlock” Frames.
• RDR_to_HOST_SlotStatus: In response to the “HOST_to_RDR_IccPowerOff” Frame.
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
10
of
50
ACR122L
-
ACS
62 00 00 00 00 00 01 01 00 00
2. RDR sends back a
positive status frame
3. RDR sends back the
00 00 00 01 00 00 00 3B 2A 00
80 65 24 B0 00 02 00 82 90 00 [Checksum]
1. HOST sends a
02 62 00 00 00 00 00 01 01 00 00
ack a
negative status frame
3. HOST sends the frame
02 62 00 00 00 00 00 01 01 00 00
4. RDR sends back a
positive status frame
5. RDR sends back the
02 80 0D 00 00 00 00 01 00 00 00 3B 2A 00
80 65 24 B0 00 02 00 82 90 00 [Checksum]
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
1. HOST sends a frame
immediately
.. After some processing delay...
response of the command
HOST
02
[Checksum] 03
02 00 00 03 (positive status frame)
02 80 0D 00
03
RDR
2) Activate a SAM (Incorrect Checksum, HOST)
corrupted frame
2. RDR sends b
immediately
again.
immediately
.. After some processing delay...
response of the command
HOST
[Incorrect Checksum] 03
02 FF FF 03 (negative status frame)
[Checksum] 03
02 00 00 03 (positive status frame)
03
RDR
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
11
of
50
ACR122L
-
ACS
02 62 00 00 00 00 00 01 01 00 00
2. RDR sends back a
positive status frame
3. RDR sends back the
response (corrupted) of
4. HOST sends a NAK
frame to get the
5. RDR sends back the
02 80 0D 00 00 00 00 01 00 00 00 3B 2A 00
80 65 24 B0 00 02 00 82 90 00 [Incorrect
02 00 00 00 00 00 00 00 00 00 00 00 03
02 80 0D 00 00 00 00 01 00 00 00 3B 2A 00
80 65 24 B0 00 02 00 82 90 00 [Checksum]
3) Activate a SAM (Incorrect Checksum, RDR)
1. HOST sends a frame
immediately
.. After some processing delay...
the command
response again.
response of the command
HOST
[Checksum] 03
02 00 00 03 (positive status frame)
Checksum] 03
(NAK)
RDR
03
Remarks:
If the frame sent by 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 response of the command. The RDR will not receive any more frames while
the command is being processed.
In case of errors, a negative status frame will be sent to the HOST to indicate the frame is either
corrupted or wrong formatted.
- CheckSum Error Frame = {02 FF FF 03}
- Length Error Frame = {02 FE FE 03}. The length “dDwLength” is greater than 0x0105 bytes.
- ETX Error Frame = {02 FD FD 03}. The last byte is not equal to ETX “0x03”.
- TimeOut Error Frame = {02 FC FC 03}. Not Complete Package Received.
The NAK Frame is only used by the HOST to get the last response.
Response = E3 51 B0 FC 88 AA 2D 18; SW1 SW2 = 90 00
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
18
of
50
ACR122L
-
ACS
Pseudo APDUs for Contactless Interface and Peripherals Control
ACR122L comes with two primitive commands for this purpose. <Class 0xFF>
**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.0A: Direct Transmit Command Format (Length of the PN532_TAG Command + 5 Bytes)
Command
Direct
Transmit
Lc: Number of Bytes to Send (1 Byte)
Maximum 255 bytes
Data In: PN532_TAG Command
The data to be sent to the PN532 and Tag.
Table 1.0B: Direct Transmit Response Format (Response Length + 2 Bytes)
Response
Result
Data Out: PN532_TAG Response
PN532_TAG Response returned by the reader.
Data Out: SW1 SW2
Class INS P1 P2 Lc Data In
0xFF 0x00 0x00 0x00 Number
of Bytes
to send
Data Out
PN532_TAG
Response
SW1 SW2
PN532_TAG
Command
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Status Code returned by the reader.
Table 1.0C: Status Code
Results
Success 90 00 The operation is completed successfully.
Error
Time Out Error 63 01 The PN532 does not response.
Checksum Error
Parameter Error 63 7F The PN532_TAG Command is wrong.
SW1 SW2 Meaning
63 00 The operation is failed.
63 27 The checksum of the Response is
wrong.
Page
19
of
50
ACR122L
-
ACS
Example 1. How to access MIFARE Classic Tags?
Typical sequence may be:
- Scanning the tags in the field (Polling)
- Authentication
- Read / Write the memory of the tag
- Halt the tag (optional)
Step 1) Polling for the MIFARE 1K/4K Tags, 106 kbps
Tip: Once the authentication is done, all the data blocks of the same
sector are free to access. For example, once the data block 0x04 is
successfully authenticated (Sector 1), the data blocks 0x04 ~ 0x07 are free
to access.
Data Blocks
(15 blocks, 16 bytes per
block)
Trailer Block
(1 block, 16 bytes)
2K
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
22
of
50
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 13 14 15
Description
Value: A signed 4-Byte value. The lowest significant byte off a value is stored in the lowest address
byte. Negative values are stored in standard 2’s complement format.
Adr: 1-Byte address, which can be used to save the storage address of a block. (optional)
e.g. Value 100 (decimal) = 64 (Hex), assume Block = 0x05
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)
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
Page
34
of
50
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.
Error 63 00 The operation is failed.
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Email:
info@acs.com.hk
5.8. 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
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.
Advanced Card Systems Ltd.
Website: www.acs.com.hk
Page
36
of
50
ACR122L
-
ACS
X
5.9. Pseudo APDU for LCD Display (Graphic Mode)
This APDU is used to Display LCD Message in Graphic Mode
Scrolling Range (Horizontal): How many 8 pixels in Horizontal after X position will be scrolled
Scrolling Range (vertical): How many pixels in Vertical after Y position will be scrolled
Refresh Speed Ctrl:
Bit0~Bit3 – how many pixel move pre scrolling
Bit4~Bit7 – Scrolling period
Bit7 Bit6 Bit5 Bit4 Scrolling period
0 0 0 0 1 Unit
0 0 0 1 3 Units
0 0 1 0 5 Units
0 0 1 1 7 Units
0 1 0 0 17 Units
Page
38
of
50
ACR122L
-
ACS
0 1 0 1 19 Units
0 1 1 0 21 Units
0 1 1 1 23 Units
1 0 0 0 129 Units
1 0 0 1 131 Units
1 0 1 0 133 Units
1 0 1 1 135 Units
1 1 0 0 145 Units
1 1 0 1 147 Units
1 1 1 0 149 Units
1 1 1 1 151 Units
Scrolling Direction: the Scrolling Direction
Bit1 Bit0 Scrolling Direction
0 0 From Left to Right
0 1 From Right to Left
1 0 From Top to Bottom
1 1 From Bottom to Top
Data Out: SW1 SW2.
Table 10.0C: Status Code
Results
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
SW1 SW2 Meaning
5.11. Pseudo APDU for Pause LCD Scrolling
This APDU is used to Pause the LCD Scrolling set before
To resume the scrolling, send again the scrolling LCD command (5.10) to perform
Table 11.0A: Pause Scrolling Command Format (5 Bytes)
Command
Clear LCD 0xFF 0x00 0x6E 0x00 0x00
Data Out: SW1 SW2.
Class INS P1 P2 Lc
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Table 11.0B: Status Code
Results
Success 90 00 The operation is completed successfully.
Error
SW1 SW2 Meaning
63 00 The operation is failed.
Page
39
of
50
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
Clear LCD 0xFF 0x00 0x6F 0x00 0x00
Data Out: SW1 SW2.
Table 12.0B: Status Code
Results
Success 90 00 The operation is completed successfully.
Error
Class INS P1 P2 Lc
SW1 SW2 Meaning
63 00 The operation is failed.
5.13. Pseudo APDU for LCD Contrast Control
This APDU is used to Control the LCD Contrast
Table 13.0A: LCD Contrast Control Command Format (5 Bytes)
Command
Class INS P1 P2 Lc
LCD Contrast
Control
P2: Contrast Control
The value range is between 0x00 to 0x0F. It is as large as brighten on contrast. Otherwise the
contrast will been darken.
Data Out: SW1 SW2.
Table 13.0B: Status Code
Results
Success 90 00 The operation is completed successfully.
Error 63 00 The operation is failed.
0xFF 0x00 0x6C Contrast Control 0x00
SW1 SW2 Meaning
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
40
of
50
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
LCD Backlight
Control
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.0C: Status Code
Results
Success 90 00 The operation is completed successfully.
Error
Class INS P1 P2 Lc
0xFF 0x00 0x64 Backlight
Control
SW1 SW2 Meaning
63 00 The operation is failed.
0x00
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
41
of
50
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
Baud Rate
Control
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.0B: Status Code
Results
Success 90 Current Baud Rate The operation is completed successfully.
Error
Class INS P1 P2 Lc
0xFF 0x00 0x44 New Baud Rate 0x00
SW1 SW2 Meaning
63 00 The operation is failed.
SW2: Current Baud Rate
0x00: The current baud rate is 9600 bps.
0x01: The current baud rate is 115200 bps.
Remark:
After the communication speed is changed successfully, the program has to adjust its communication
speed so as to continue the rest of the data exchanges.
The initial communication speed is determined by the existence of R12 (0 ohm).
• With R12 = 115200 bps
• Without R12 = 9600 bps (default)
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Page
42
of
50
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”
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. Poll a FeliCa Tag by sending “Direct Transmit” and “Get Response” APDUs (Tag
Polling).
Step 3. If no tag is found, go back to Step 2 until a FeliCa Tag is found.
Step 4. Access the FeliCa Tag by sending APDUs (Tag Read or Write)
Step 5. If there is no any operation with the FeliCa Tag, then go back to Step 2 to poll the other
FeliCa Tag.
..
Step N. Deactivate the “SAM Interface”. Shut down the application.
Remark:
1. The default Retry Time of the PN532 command “InListPassiveTarget” is infinity. Send the APDU
“FF 00 00 00 06 D4 32 05 00 00 00” to change the Retry Time to one.
2. It is recommended to turn off the Antenna if there is no contactless access.
APDU for turning on the Antenna Power = APDU “FF 00 00 00 04 D4 32 01 03”
APDU for turning off the Antenna Power = APDU “FF 00 00 00 04 D4 32 01 02”
FCC Warning:
Any Changes or modifications not expressly approved by the party responsible for compliance
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.
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
48
50
Page
49
of
50
ACR122L
-
ACS
6.0. Mechanical Design
ACR122L-ACS Design Specification
Version 0.03 19/05/2010
Email:
info@acs.com.hk
7.0. Technical Specification
Serial Interface
Power source ....................................... 7V AC/DC Switching Power Supply