13.56MHz MIFARE Reader Module

What happens, if somebody pulls the card out of the field during a transaction?

Modifying memory content of a MIFARE® card is an EEPROM write operation internally. It requires a sufficient energy supply to execute properly. If a card leaves the field during an EEPROM write, corrupted data may be left. However, a sophisticated transaction scheme inside the MIFARE® tag reduces the chance of this happening significantly, maybe you will never encounter it in your tests. Incrementing or decrementing is safer than doing read-write explicitly. In addition to that the application can be designed in a way, that each value block is mirrored in a backup block. This allows for automatic recovery of lost data resulting in very reliable systems. However, carefully designing and testing the application is recommended.

What type of MIFARE® card should I use ?

MIFARE® Light was designed as a lean solution for a single application environment. It contains only one sector with 2 keys, access condition, 2 data blocks and one value block.

MIFARE® Standard was designed for a multiapplication environment. It contains 16 sectors each with 2 individual keys, access conditions, 3 data or value blocks. Some applications use the 1 kByte of the MIFARE® Standard Card Memory just as a storage.

How should MIFARE® cards be personalized ?

It depends on the application. Each sector of the Standard MIFARE® card can be devoted to a specific application.

Identification, access control, data storage applications

MIFARE® cards are delivered with transport keys (see section 2.2) and can be used already with those keys. Also the access conditions need not to be changed.

Cashless payment, ticketing, metering

Cashless payment is based on value blocks that can be incremented and decremented. Value blocks are generated easily using the Write Value command. A sector containing a value block should also contains a backup block to restore values after a write crash. After each transaction the value block should be copied into the backup using the copy command. Care has to be taken, that a sector with a value block does not contain other value blocks. Otherwise a security gap arises from the possibility of copying value blocks within a sector.

In security sensitive applications it is recommended to change the access conditions and keys. Keys can be modified using the write command. It is strongly recommended to modify the sector trailer containing access conditions and keys (block 3, 7, 11, …) in a stable environment with good reading only. Otherwise sectors with badly formatted keys or access conditions never can be accessed again.

For a cashless payment block the recommended access conditions are:

08 77 8F xx Which means, that key B (master key) can write values, access conditions and keys and key A (field key) can read and decrement values only.

  How should the MIFARE® reader be personalized ?

In ASCII protocol applications no personalization is necessary.

For bus applications which are using the binary protocol mode a personalization procedure is required.

To configure the reader for binary protocol mode the following instruction flow is recommended.

  • Start HyperTerminal
  • Connect your reader to the PC and turn on the supply voltage
  • The reader transmit the Version String (i.e. “MIFARE V0.14”) after initialization
  • Type ‘we00xx’ (where xx denotes the Station ID for the reader) to set the ID
  • Wait until the reader replies with ‘Wxx’. Now the Station ID is set. You may read it by typing ‘re00’
  • To set the reader into binary protocol mode type ‘we0102’. It is stored nonvolatile in the binary mode flag (Protocol Configuration Byte).
  • Until you reset the reader (turn off the supply voltage or type ‘x’) the reader stays in ASCII protocol mode
  • By typing ‘x’ the reader execute a reset. In binary mode the reader does not transmit the version string at start up any more and does not respond to the ASCII command set.

To restore the ASCII protocol mode you have to transmit the write EEPROM command (in binary mode: >02h FFh 04h 77h 65h 01h 01h E8h 03h<) which resets the binary mode flag.

How to implement a device driver?

For the implementation of device drivers using the Mifare® OEM module a separated Applications Note is available including source code examples.

Major Differences between Version 0.13 and 0.14

  • Support of multiple cards. The continuous read does an anticollision that delivers a list of all cards in the field at he cost of repetition speed. The new “m” command does a select out of several cards in the field.
  • Open interface to all ISO14443A cards through the transfer command.
  • Bug fix: Lockup on serial receive buffer overflow is fixed.
  • Bug fix: pon, poff working properly. V014 also supports enable pin function.
  • Bug fix GetID instruction, timing is now optimized for each baud rate.
  • RS485/422 interface (DEN pin) is now faster.
  • Frame timeout in binary mode can be activated by parameter setting.
  • Continuous read mode can be used as SingleTag read (as always) or as new MultiTag read by setting the Protocol Configuration register.
  • MIFARE Light is not fully supported any more.

 Pin Out 
All distances are listed in mm.
RS485 operation:
Rx A with Tx A to RS485 – A
Rx B with Tx B to RS485 – B
GND to RS485 – GND.

 Mifare 4k Contactless Smart Cards For Access Control systems,RFID Contactless Smart Cards,NXP Mifare 4k Offset Printing Cards,

  ISO/IEC 14443 Part 1-4, Identification Cards – Contactless integrated circuit(s) cards – Proximity cards