Datasheet

The MAD1 is stored in the Manufacturer Sector (Sector 0x00) on the Mifare Classic card.
Mifare Application Directory 2 (MAD2)
MAD2 can only be used on Mifare Classic cards with more than 1KB of storage (Mifare Classic 4K cards, etc.). It is
NOT compatible with cards containing only 1KB of memory!
The MAD2 is stored in sectors 0x00 (the Manufacturer Sector) and 0x10.
MAD Sector Access
The sectors containing the MAD1 (0x00) and MAD2 (0x00 and 0x10) are protected with a KEY A and KEY B (if you're
not familiar with this concept, consult the Mifare Classic summary elsewhere in the PN532/NFC wiki). To ensure that
these sectors can be read by any application, the following common KEY A should always be used:
The MAD sector may optionally be write-protected using KEY B if you wish to limit the ability of customers to modify
the card contents. The public KEY A will ensure that they can always read the data.
Storing NDEF Messages in Mifare Sectors
NDEF messages/records may be stored in any sector of the Mifare card, other than the sector(s) use by the MAD or
sectors beyond the 1K range if a MAD1 table is used.
When a sector is used to store NDEF records, it is referred to as an NFC Sector. As with the MAD Sector(s) described
above, these sectors must always be accessible in at least read-only mode, and as such a common public KEY A also
exists for NFC Sectors, though it is not the same KEY A used in the MAD sector(s):
In order to store an NDEF Message on the Mifare Classic card, the message needs to be wrapped inside something
called a TLV Block. The basic structure of a TLV Block is described below.
TLV Blocks
TLV is an abbreviation for three different fields: T for Tag Field, L for Length Field and V for Value Field. A TLV Block
consist of one or more bytes, depending on which of these three fields is present. Note that the TLV Block will always
be at least one byte since the T Field is mandatory in every case.
Tag Field
The Tag Field (or T Field) is the only mandatory field, and uses a single-byte to identify the type of TLV block
accordingly to a pre-determined table of values:
Public KEY A of MAD Sectors
---------------------------------------------------
BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5
0xA0 0xA1 0xA2 0xA3 0xA4 0xA5
Public KEY A of NFC Sectors
---------------------------------------------------
BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5
0xD3 0xF7 0xD3 0xF7 0xD3 0xF7
© Adafruit Industries https://learn.adafruit.com/adafruit-pn532-rfid-nfc Page 28 of 42