Elatec GmbH 1. Introduction ® This document is the reference guide for the transponder reader family TWN3 Mifare NFC and Mini ® Reader Mifare NFC. The readers are using the same reading technology, so this document is applicable for both devices.
Elatec GmbH ® 2. Installation of Mini Reader Mifare ® This chapter covers the installation of Mini Reader Mifare NFC in an embedded environment. 2.1 Mechanical Outline All dimensions are in mm. Component side shown, Pin spacing: 2.54mm 2.2 Pinning...
Elatec GmbH 2.3 Electrical Characteristics Frequency 13.56 MHz Power supply 3.15V - 5.5V DC Current consumption RF field off: 10mA RF field on: Typically 80mA Power Down: < 2µA 2.4 Asynchronous Serial Connection (UART) ® Because Mini Reader Mifare NFC is transmitting and receiving TTL levels, it can be directly connected to a microcontroller.
Elatec GmbH 2.5 Synchronous Serial Connection (SPI) ® Mini Reader Mifare NFC also offers synchronous data transfer via a 4-line SPI. In this case, the reader is always slave, it cannot initiate any data transfer by itself. All data transfer is initiated by the master by pulling the pin SS ¯¯...
Page 9
Elatec GmbH After sending the command frame, the master polls the reader for the response. This is done by cyclically sending 0x00 frames: Every command requires its individual processing time until a response is available. This response time also depends on the response polling frequency of the master, so it might be useful to slow down polling in order to increase processing speed of the reader.
Elatec GmbH The previous image shows the response of the reader, in this case it is the ASCII-representation of the version string “MifareNFC 1.02<CR><LF>” (with leading length-byte 0x10). 2.5.1 SPI Timing SPI Interface: Timing requirements. Drawing is not for scale!
Elatec GmbH 2.5.2 SPI Software Implementation The following code demonstrates how to implement SPI communication in software for the host system, e.g. for a microcontroller: byte SPI_ReadWrite(byte Data) byte (i=0; i<8; i++) (Data & 0x80) MOSI_HIGH; else MOSI_LOW; SCK_HIGH; Data <<= 1;...
Elatec GmbH 2.6 Usage of GPIOs The reader provides four general purpose I/Os that can be configured individually. These I/Os can be read and written by commands. Please consider, that the GPIOs have limited current source and sink capability of max. 25mA. An overcharge of GPIO-pins can damage the module! 2.7 Asynchronous Reset...
Elatec GmbH 5. Register Set The reader has several system flags customizing its behavior. The flags are stored non-volatile in its EEPROM. It is recommended to keep all bits and bytes labeled RFU at their default state to guarantee further compatibility.
Elatec GmbH 5.2 Station ID (0Ah) In ASCII mode, the Station ID has principally no influence on the functional behavior of the reader. Nevertheless it can be used to identify a reader in a multi-reader environment. In Binary mode, the Station ID is used to address the reader in protocol header. The Station ID has the range 01h to FEh and can be set freely.
Elatec GmbH 5.3.5 ExtendID If set, the unique serial number (UID) of the transponder is extended by a single prefix byte. This bit has only effect for ISO14443A transponders. This setting affects the commands continuous reading („c‟), single tag select („s‟) and multi tag select („m‟).
Elatec GmbH 5.5 Operation Mode Register 1 (0Eh) The Operation Mode Register 1 defines which tag types the reader shall support. Including or excluding transponder types has direct influence in the transponder detection speed of the reader. Operation Mode Register 1...
Elatec GmbH 5.7 Reset Off Time (14h) The Reset Off Time register represents the time in milliseconds, the RF-field is switched off before and after a reading attempt. This register is used for the continuous read mode („c‟). The higher the value of the register, the more energy can be saved. Keep in mind that increased saving of energy results in decreased detection speeds.
Elatec GmbH 5.8 Reset Recovery Time (15h) The Reset Recovery Time register represents the recovery time in milliseconds after the RF-field is turned on. This register is used for the continuous read mode („c‟), single tag select („s‟) and multi tag select („m‟) commands.
Elatec GmbH 5.9.2 TagInfo If set, the reader extends the UID by a single byte. The value of the byte gives information about the tag type. Default value: 0 Refer to the table below for tag types: Byte value Corresponding transponder type Mifare®...
Elatec GmbH 6. Communication Protocol 6.1 ASCII Protocol The ASCII protocol has been designed for easy handling. Data is always transmitted in hexadecimal notation, i.e. 5E. Every time the reader is powered up, a startup message is displayed. On the terminal screen this should look like this: MifareNFC 1.02<CR><LF>...
Elatec GmbH 6.2.7 Example This example shows how to log into sector 0 of a Mifare card, using transport key FFh: ® Station ID Length Data 6C 00 FF 0D 6.2.8 Remarks If an invalid instruction frame is received (e.g. BCC is wrong) or if the requested Station ID does not match the internal ID of the reader, the command is not executed.
Elatec GmbH 7.3 Transponder Serial Number Related Commands 7.3.1 Continuous read mode „c‟ The reader reads and displays serial numbers continuously while one or more tags remain in the field. This command stops as soon as any character is sent to the reader.
Elatec GmbH 7.3.3 MultiTag Selection / Tag List „m‟ This command detects several tags at the same time. It replaces the fast select command („s‟) in multiple tag surroundings. The MultiTag list command lists all present tags with their serial numbers.
Elatec GmbH 7.3.4 Mifare® PLUS Virtual Card Select „nvcs‟ Use this command to retrieve the „real‟ UID of the transponder in a virtual card environment. If a card is configured to show random IDs, the virtual card select command offers the possibility to retrieve the UID in a fast and secure way.
Elatec GmbH 7.4 Data-Transaction Related Commands 7.4.1 Authenticate Tag 7.4.1.1 Mifare® Classic Login ‘l’ This command performs an authentication into a specific sector of a Mifare® Classic transponder. Only one transponder and only one sector can be accessed at the same time. Prior access, the transponder must be selected by either single tag or MultiTag selection commands.
Elatec GmbH 7.4.1.2 Mifare® Ultralight C Login ‘l’ This command performs an authentication into a Mifare® Ultralight C transponder. The authentication scheme into this transponder type is different to Mifare® Classic due to the fact, that Ultralight C uses Triple-DES cryptography.
Elatec GmbH 7.4.1.3 Mifare® PLUS Login ‘nl’ Mifare® PLUS offers various authentication features to the user. Depending on the desired transaction or configured security level of the transponder, the appropriate authentication procedure must be chosen by the user. The reader always demands an AES key for authentication; if the transponder is configured to security level 2, optionally a Crypto1 key can be passed to the reader.
Elatec GmbH Examples Command Description ‘nl00AA50<CR>’ Authenticate to sector 00 using EEPROM AES key 00, type A ‘nl02BB51<CR>’ Authenticate to sector 02 using EEPROM AES key 01, type B ‘nl28AA52<CR>’ Authenticate with card master key using EEPROM AES key 02, KeyType is ignored but has to be transmitted to the reader.
Elatec GmbH 7.4.2 Read Data Block „r‟ / „rb‟ This command reads an entire data block from a transponder. The range of valid block addresses depends on the used transponder. If you are working with Mifare® cards, keep in mind that any read- or write access requires a successful login into the respective sector.
Elatec GmbH 7.4.3 Write Data Block „w‟ / „wb‟ This command writes an entire data block to the transponder. The range of valid block addresses depends on the used transponder. A read after write is done automatically to ensure data integrity. If you are working with Mifare®...
Elatec GmbH 7.4.4 Mifare® Value Block Related commands A sector of a Mifare® transponder may contain so-called „value blocks‟. A value block is a usual data block, where the information is stored in a certain format. Special Mifare® commands like increment or decrement may be applied to such a block, e.g.
Elatec GmbH 7.4.4.1 Create Value Block ‘wv’ Use this command to format a common data block as a value block. The range of valid block addresses depends on the used transponder type. You must log into the respective sector before this command can be executed.
Elatec GmbH 7.4.4.3 Increment Value Block ‘+’ Use this command to increment a value block by a defined value. A read after increment is performed automatically. The command fails if the specified block is not formatted as value block. You must log into the respective sector before this command can be executed.
Elatec GmbH 7.4.4.5 Copy Value Block ‘=’ Use this command to copy a value block to another value block of the same sector. A read after copy is performed automatically. The command fails if one of the specified blocks is not in value format. You must log into the respective sector before this command can be executed.
Elatec GmbH 7.4.5 Mifare® PLUS Related Commands 7.4.5.1 Write Personalization Data ‘nwp’ Use this command to transmit personalization data to the transponder in SL0. At least Card Master key, Card configuration key, Level 2 switch key (Mifare® PLUS X only) and Level 3 switch key must be written in order to personalize the transponder.
Elatec GmbH 7.4.5.2 Commit Personalization ‘ncp’ Use this command to finish personalization and to switch the transponder from SL0 to SL1. If the personalized transponder is a so-called „L3‟-card, the transponder is switched to SL3. This command is only supported if the transponder is in SL0.
Elatec GmbH Answer Answer Description Data<CR><LF> Written data ‘F<CR><LF>’ Error: General failure ‘R<CR><LF>’ Error: Parameter out of range Examples Command Description nw00AA001122334455 Change AES sector key, sector 00, key type A to 00112233445566778899AABBCCDDEEFFh 66778899AABBCCDDEEFF nw01BB000000000000 Change AES sector key, sector 01, key type B to 00000000000000000000000000000000h...
Elatec GmbH 7.5 Setup Related Commands of the Reader 7.5.1 Read Byte from EEPROM „rp‟ Use this command to read a byte from the internal reader EEPROM. Only the configuration bank is accessible by the user, it is not possible to read any stored keys. The address byte ranges from 00h to FFh.
Elatec GmbH 7.5.3 Set Configuration Flags „of‟ Use this command to set or clear the Configuration Flags of the reader. In contrast to the EEPROM registers, the settings of the „of‟ command are volatile, this means, they are taking effect on the behavior of the reader at once and they are lost, when a reset occurs or the reader is powered down.
Elatec GmbH 7.5.5 Set Tag Type „oa‟ / „ob‟ / „oj‟ / „op‟ / „os‟ / „ot‟ Use this command to search for only one specific transponder type (e.g. only ISO14443A). In contrast to the EEPROM registers, the settings of the „o‟ command are volatile, this means they are taking effect on the behavior of the reader at once and they are lost when a reset occurs or the reader is powered down.
Elatec GmbH 7.5.8 Key Management 7.5.8.1 Write Mifare® Classic Key ‘wm’ Use this command to store a Mifare® Classic authentication key into the EEPROM of the reader. The reader is able to store up 32 keys. The key locations are write-only, so the keys can‟t be read back.
Elatec GmbH 7.5.9 SAM related Commands The reader supports the connection of an ISO7816 compatible SAM card (Secure Access Module). The SAM card is driven by the reader via an ISO7816 compatible UART, using the following default parameters: f = 1.1 MHz; F = 372;...
Elatec GmbH 7.6 Miscellaneous Commands 7.6.1 Get Station ID „g‟ Use this command to retrieve the station ID of the reader. Command: ‘g’ Answer Description Data<CR><LF> Station ID of the reader (1 byte) 7.6.2 Antenna Power Off „poff‟ Use this command to turn off the RF-field and save energy. All present tags in the antenna field are powered down and reset.
Elatec GmbH 7.6.7 Read GPIO „ir‟ Use this command to read a specified GPIO. The GPIO is switched to input prior reading. Command: ‘ir[GPIONumber]’ Answer Answer Description Data<CR><LF> Status of specified GPIO: 00 means Low; 01 means High. Example Command Description ‘ir02’...
Elatec GmbH 8. Typical Data Transaction Procedures 8.1 Mifare® Classic / Mifare® PLUS The following diagram shows the typical command-flow in order to access the data area of a Mifare® Classic / PLUS transponder: Select transponder ‚s‟ / ‚m‟ Transponder...
Elatec GmbH 8.3 Mifare® Ultralight C Accessing the EEPROM depends on the settings of the transponder, e.g. if an authentication is required. The following diagram shows the typical command-flow in order to access the data area of a Mifare® Ultralight C transponder:...
Elatec GmbH 9. Memory Organization of Mifare® Transponders 9.1 Mifare® Classic 1k A Mifare® Classic 1k transponder consists of 16 sectors. Each sector is organized in four data blocks. A data block stores 16 bytes of data. The following table shows the memory organization of a Mifare®...
Elatec GmbH 9.2 Mifare® Classic 4k A Mifare® Classic 4k transponder consists of 40 sectors. In contrast to the Mifare® standard 1k transponder, the 4k version has a different memory organization, shown in the following table: Sector Block addresses Login sector...
Elatec GmbH 9.3 Mifare® PLUS Mifare® PLUS 2K/4K transponders have a similar memory organization like Mifare® Classic 4K. However, a 2Kbyte card only has the lower 32 Sectors built-in: Bytes Sector Block addresses Sector Block addresses 00h...03h 40h...43h 04h...07h 44h...47h 08h...0Bh...
Elatec GmbH 9.4 Mifare® Ultralight A Mifare® Ultralight transponder consists of 16 pages with 4 bytes each. The UID is read-only and is also mapped into the memory area. Page Byte 0 Byte 1 Byte 2 Byte 3 Access rights...
Elatec GmbH 9.5 Mifare® Ultralight C A Mifare® Ultralight C transponder consists of 48 pages with 4 bytes each. The UID is read-only and is also mapped into the memory area. The 16 bytes Triple-DES key is stored in the last 4 pages of the transponder.
Elatec GmbH 9.5.1 Example: Writing the Triple-DES Key This chapter shows how to write the Triple-DES key into the transponder. On example of Key1 = 0001020304050607h and Key2 = 08090A0B0C0D0E0Fh the command sequence shown in the table below has to be executed for writing the key. The following preconditions...
Elatec GmbH 10. Mifare® PLUS 10.1 Security Levels Mifare® PLUS supports four security levels. The initial delivery configuration is SL0. Within this level, cards must be personalized. After that, the card is switched to a higher security level. Once a card has been switched to a higher level, it cannot be switched back to a lower level.
Elatec GmbH 10.2 Application Hints Have a look at the following hints when developing your Mifare® PLUS application. They will help you choosing the correct transponder and reader in order to satisfy your needs: In SL3, value formats are only supported by Mifare® PLUS X cards ...
Elatec GmbH 11. Firmware Update The reader contains a bootloader program which makes firmware updates possible. Complete the following steps to update the firmware: Power up the reader Ensure that the reader runs at 9600 bps Start the application WinFlash.exe, you should see the following window ...
Elatec GmbH 13. Trademarks All referenced brands, product names, service names and trademarks mentioned in this document are the property of their respective owners. Page 61 of 61...
Need help?
Do you have a question about the TWN3 Mini Reader Mifare NFC and is the answer not in the manual?
Questions and answers