Summary: Describes the Philips corporate Mifare 1 non-contact IC card reader chip MCM200 main characteristics, pin function, internal physical function registers and basic instruction set.
Focuses on the Mifare 1 non-contact IC card and MCM200 some important data communication module programming ideas and programming method for two programming example.Keywords: non-contact IC card MCM200 reader
Mifare 1 IC card intelligent (RF) is the core of the company Philips Mifare 1 IC S50 (-01,-02, 03, 04--) series modules (micro-chip).
Its corresponding reader module for Philips company MCM200 and MCM500. Of these, MCM200 module mainly applies to operation distance 25 card reader; MCM500 module mainly applies to operation distance 100 mm of card reader. 1 main characteristics MCM200 moduleMCM200 reader module's main characteristics are as follows:
¡Ñ standard dual in-line 32 pin package;
• Operating frequency as 13.56MHz, uses a standard + 5V supply, typical current consumption to 40mA;
• Read and write to the card distance of up to 25mm above;
• Communication with cards rate can reach 106kbps;
● Each sector contains three sets of passwords that contain authentication password storage;
● Have overlapping functionality; preventing card
● With 16 byte FIFO (first in, first out) queue receive/send buffer register;
• Communicate with the card module can automatically detect errors in the data flow analysis can be automatically;
● For RF (radio frequency) channel for automatic monitoring;
● Built-in 8-bit/16 bit CRC coprocessor can provide CRC checksum, PARITY, etc data;
● Supports a wide variety of activities in the antenna and no antenna control system to adjust the antenna for compensation;
● With standard Mifare parallel interface directly from standard MCU interface signal control.
2 MCM200 module pin description
MCM200 pins are arranged as shown in Figure 1.
The PIN function is as follows:D0 to D7: 8-bit bi-directional data bus;
A0-A3: 4 bits of the address lines;
BP: backup battery input, password used to protect the MCM internal RAM;
NPAUSE1: serial data output for driving RF unit, the PIN must be connected to the TP-RF unit.
NWR: write signal enable;
NRD: read signal enable;
NCS: the foot to low level select MCM;
KOMP1: RF comparer, use the input must be connected to the RF cell RX-end;
NIRQ: MCU data processing control client.
When the end to low, MCU will use MCM status register of content on MCM data processing;ALE: address latch enable;
USEALE: choose from internal address latches or A0-A3 pin fetch address;
DGND: grounding-end digital circuits;
DVDD: + 5V power supply side.
MODE: the mode pin parallel agreement, available high level driver.
AVDD: + 5V analog power supply input pin for RF unit;
AGND: RF module (analog circuits) grounding Terminal;
NANT, ANT: antenna connection port.
3 special function register MCM200 internal
MCM200 device internal has 16 special function register, table 1 is the 16 special function register address and read-write.
In fact, MCU, primarily through the MCM register read/write to control the work of the MCM. MCM is MCU and non-contact IC card to exchange information between the interfaces, system data on the card for any reading and writing are required to pass through the MCM.Table 1 physical function MCU200 registers
Register name address reading (READ) and write (WRITE)
DATA 00H READ-BYTE WRITE-BYTE
STACON 01H DV TE PE CE BE AE - - - - SOR RFS - - - - 1 1 NRF AC
ENABLE 02H N/A 1 PR CE CR - - - - - - - -
BCNTS 03H N/A BIT-COUNT-SEND
BCNTR 04H N/A BIT-COUNT-RECEIVE
BAUDRATE 05H N/A - - - - - - - - 1 1 1 BR
TOC 06H N/A TIMEOUT-COUNTER
MODE 07H N/A
1 1 0 0 0 P2 P1 P0 P0CRCDATA 08H CRC-BYTE-READ CRC-BYTE-WRITE
CRCSTACON 09H CV - - - - - - - - - - - - CZ C8 - - - - - - - - - - - - CR
KEYDATA 0AH N/A KEY-BYTE-WRITE
KEYSTACON 0BH - - - - - - - - - - - - - - - - AL 0 - - - - - - - - KS1 KS0
KEYADDR 0CH N/A AL AB A5 A4 A3 A2 A1 A0
0DH
RCODE 0EH N/A - - - - - - - - 0 0 RC1 RC0
Table 2 MCM2000 basic instruction set
Directive directive code (hex) related error flag receive card data
Answer to Request (Request-response) TE, BE Tagtype
Request std 26
Request all 52
AntiCollision (non-overlapping) 93 TE, BE Serial Number
Select Tag (selected cards) 93 TE, PE, BE, CE Size
Authentication (authentication), TE, BE, CE/PE
Auth-1a 60
Auth-1b 61
Load KEY (access password)/AE
Read (read) 30 TE, PE, BE, CE Data
Write (write) TE, BE/A0
Increment (value-added) C1 TE, BE/
Decrement (decrease) C0 TE, BE/
Restore (to reserve) TE BE/C2,
Transfer (transfer) TE, BE/B0
Halt (downtime) 50 TE, BE/
4 MCM200 instructions and software design
MCU through special instruction to start MCM200 and run at the same time these instructions transmitted to Mifare 1 card.
MCM200 basic instructions that are listed in table 2. Mifare 1 IC card and communicate using MCM200 handshaking half duplex communication protocol, cards with high CRC coprocessor meets the CCITT standard. The card's ROM has its run in curing the necessary program instructions, it can make a card and card reader in an orderly fashion for data communication. But the MCU to MCM200 instructions usually is not a simple one instruction, but a program sequence to finish, including MCM200 hardware kernel register setting. MCM on IC card operation process as shown in Figure 2. Now the main sub modules programming method for a description.
4.1 Request action subroutine
Request instruction is used to notify MCM200 in antenna effective working distances looking for Mifare 1 card.
If the card Mifare 1 exist, and Mifare 1 communication, and reads the card type, the TAGTYPE (2 bytes), then the distinction by the TAGTYPE MCU based on different types of cards. Request instruction divided into Request std instruction and Re-quest all directives. Request std instruction is the continuity of the card. Request all instruction is continuity of card instructions, read-only once. Request all instruction in successfully read a card, will be waiting users take a card until you have a card to enter the MCM's antenna effective work. Request operation of Assembly language program is as follows:Request: MOV A, # 0CH; sets MCM in STACON registers as 0CH
MOV R0,#01H
MOVX @R0,A
MOV A, # 0EH; sets MCM in BAU-DRATE registers as 0EH
MOV R0,#05H
MOVX @R0,A
MOV A, # 0C0H; settings ENABLE registers in the MCM to 0C0H
MOV R0,#02H
MOVX @R0,A
MOV A, # 0C6H; setting the MODE register MCM to 0C6H
MOV R0#07H
MOVX @R0A
MOV A
# 02H; sets MCM in RCODERegister for 02H
MOV R0#0EH
MOVX @R0A
# 07H MOV A, sets MCM in BCNT [1] [2] [3]
No comments:
Post a Comment