RFID cards


Back to main doc.


Mifare EEPROM format.

Link to a table of our EEPROM system.

We're using the Mifare 1k classic cards. A card has 16 sectors with 4 blocks each, only 3 of which can be used for our data. Each block contains 16 bytes. We don't write to sector 0 which has some important information on it. We use sector-1 block-0 to hold the last record number and the most recent record. In other blocks, we store our records. Each record is 5 bytes, 1 byte for the control number and 4 bytes for the timestamp. So earch block holds 3 records plus one unused byte at the end.

For our records... We only use 2 blocks in sector 1. We use 3 blocks in each of the other 14 sectors. So we have (2 + 3 * 14) = 44 blocks available. Each one holds 3 records. So we have (44 * 3) = 132 possible records. These are numbered 0 to 131 (0x00 to 0x83).

We use sector-1 block-1 in a special way. In that location we record the record number of the last record (or the current number of recorded records, I can't remember what we decided) and a copy of that record. In this way, we only need to read sector-1 block-1 to get this info rather than having to scan the card to find the last record.