Terminal for ACR122U & PN532

MTools App brings Terminal functions for ACR122U and PN532 via USB. Also bluetooth connection to PN532 with SPP module. You can run raw commands easily and debug PN532 or ACR122U with Android devices.

Terminal for ACR122U

The connection of ACR122U is USB. If you’re connecting it with your Android phone, an OTG adapter is necessary.

Get Presented Tag info

Before running on the command, the tag needs to be put on the reader. To get the UID of the connected PICC.

> FF CA 00 00 
<  

To get the ATS of the connected ISO 14443 A PICC.

> FF CA 01 00 00
<  00

Load Mifare Key

ACR122U allows loading 2 Mifare Keys(6 Bytes) in 2 locations.

> FF 82 00     //Load key FFFFFFFFFFFF to 00 location
< 90 00

Verify Mifare Block

> FF 86 00 00 05 01 00   
< 90 00

Note: The MIFARE Classic 1K Card, has a total of 16 sectors and each sector consists of 4 consecutive blocks. E.g. Sector 00h consists of Blocks {00h, 01h, 02h and 03h}; Sector 01h consists of Blocks {04h, 05h, 06h and 07h}; the last sector 0F consists of Blocks {3Ch, 3Dh, 3Eh and 3Fh}. Once the authentication is done successfully, there is no need to authenticate again if the blocks to be accessed belong to the same sector. Please refer to the MIFARE Classic 1K/4K specification for more details.

Note: MIFARE Ultralight does not need to do any authentication. The memory is free to access.

Read Mifare Block

Once the sector is successfully authenticated, the commands to read or write the block can be executed with the problem.

  1. Read Mifare Classic Block (16 Bytes)

    > FF B0 00  
    < 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 90 00
  2. Read Mifare Ultralight Page (4 Bytes)

    > FF B0 00  
    < 00 01 02 03 90 00
  3. Read Mifare Ultralight 4 Pages (16 Bytes)

    > FF B0 00  
    < 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 90 00

Write Mifare Block

  1. Write Mifare Classic Block

    > FF D6 00   
    < 90 00
  2. Write Mifare Ultralight Page

    > FF D6 00   
    < 90 00

Set Buzzer and LED

The bi-color LED and Buzzer all can be configured with commands. This command makes ACR122U much more cool and flexible to use.

ClassINSP1P2LcData In(4 B)

FF

00

01

LED

State Control (Bit 7 --- Bit 0)

04

Blinking Duration Control

LED State Control

Bi-Color LED and Buzzer Control Format (1 byte)

CMDItemDescription

Bit 0

Final State : Red LED

1 = On ; 0 = Off

Bit 1

Final State : Green LED

1 = On ; 0 = Off

Bit 2

State Mask : Red LED

1 = Update the State 0 = No change

Bit 3

State Mask : Green LED

1 = Update the State 0 = No change

Bit 4

Initial Blinking State : Red LED

1 = On ; 0 = Off

Bit 5

Initial Blinking State : Green LED

1 = On ; 0 = Off

Bit 6

Blinking Mask : Red LED

1 = Blink 0 = Not Blink

Bit 7

Blinking Mask : Green LED

1 = Blink 0 = Not Blink

Blinking Duration Control

Bi-Color LED Blinking Duration Control Format (4 Bytes)

Byte 0Byte 1Byte 2Byte 3

T1 Duration Initial Blinking State ( Unit = 100 ms )

T2 Duration Toggle Blinking State ( Unit = 100 ms )

Number of repetition

Link to Buzzer

Byte 3 Options

Link to the Buzzer and control the buzzer state during the LED Blinking.

00h: The buzzer will not turn on 
01h: The buzzer will turn on during the T1 Duration 
02h: The buzzer will turn on during the T2 Duration 
03h: The buzzer will turn on during the T1 and T2 Duration.

Response

 < 90 
 < 63 00

Buzzer and LED Notes

1. LED Blinking will take effect only if the corresponding LED Blinking Mask is enabled and the 
number of repetitions is greater than zero. 
2. The term Initial Blinking State means that the LED of the chosen color will either be turned 
ON or OFF during the first blink in the duty cycle. For example, if the Initial Blinking State is 
turned ON for the Green LED and OFF for the Red LED, then the blinking will start with Green, 
followed by Red, and so on. 
3. The change in LED State will take effect only if the corresponding LED State Mask is enabled.
4. If controlled at the same time, the LED State operation will be performed after the LED 
The blinking operation has been completed.
5. Under Blinking Duration Control, Both 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%. #Duty Cycle = T1/(T1 + T2).
6. To control the buzzer only, set the P2 “LED State Control” to 00.
7. To make the buzzer operate, the “number of repetitions” must be greater than zero.
8. To control the LED only, set the parameter “Link to Buzzer” to 00.

Direct Transmit to PN532

This is the payload to be sent to the tag or reader with a specific command ahead.

 > FF 00 00 00  
 < [ResponseData] 90 00

Check the checkbox of Direct Transmit and send the command of PN532. The command of PN532 is listed in the next section.

Terminal for PN532

Coming soon

Last updated