ACR122S – Communication Protocol
Version 2.01
www.acs.com.hk
Page 39 of 57
6.7.1.
Handling the value blocks of Mifare 1K/4K tag?
The value blocks are used for performing electronic purse functions (Increment, Decrement, Restore,
Transfer, etc). These 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
______
Value
Value
Adr
___
Adr
Adr
___
Adr
Where:
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).
Example:
Value 100 (decimal) = 64 (Hex), assume Block = 05h
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)
.
HOST -> 02 6F 1A 00 00 00 00 01 00 00 00
HOST -> FF 00 00 00 15 D4 40
01
A0
05
64 00 00 00 9B FF FF FF 64 00 00 00 05 FA 05 FA
[Checksum] 03
RDR -> 02 00 00 03 (Waiting the Tag)
RDR -> 02 80 05 00 00 00 00 01 01 00 00
RDR -> D5 41 [00] 90 00 [Checksum] 03
Step 2. Increment the value of Block
05 by
1 (dec)
.
HOST -> 02 6F 0E 00 00 00 00 01 00 00 00
HOST -> FF 00 00 00 09 D4 40
01
C1
05
01 00 00 00
[Checksum] 03
RDR -> 02 00 00 03 (Waiting the Tag)
RDR -> 02 80 05 00 00 00 00 01 01 00 00
RDR -> D5 41 [00] 90 00 [Checksum] 03
Note:
Decrement the value of Block
05 by
1 (dec)
.
HOST -> FF 00 00 00 09 D4 40
01
C0
05
01 00 00 00
Step 3. Transfer the prior calculated value of Block
05
(dec)
.
HOST -> 02 6F 0A 00 00 00 00 01 00 00 00
HOST -> FF 00 00 00 05 D4 40
01
B0
05
[Checksum] 03