1、 1 47 FM1715 Ver 1.0 2 47 4 ISO14443A .5 2.1 .5 2.2 .5 2.2.1 REQUEST .5 2.2.2 ANTICOLL 5 2.2.3 SELECT.6 2.2.4 AUTHENTICATION6 2.2.5 HALT.6 2.2.6 READ 7 2.2.7 WRITE.7 2.2.8 INCREMENT 7 2.2.9 DECREMENT .8 2.2.10 RESTORE8 2.2.11 TRANSFER8 FM1715 .10 3.1 .10 3.2 .10 3.3 FM1715 .11 13 14 5.1 .14 5.2 .18
2、5.2.1 18 5.2.2 UID .18 5.2.3 UID .19 5.2.4 21 5.3 FM1715 .23 5.3.1 23 5.3.2 FM1715 23 5.3.3 24 5.3.4 FM1715 EEPROM 25 5.3.5 FM1715 EEPROM 26 5.3.6 FM1715 FIFO .26 5.3.7 FM1715 FIFO x 27 5.3.8 FM1715 FIFO x 27 5.4 FM1715 .29 5.4.1 HALT.29 5.4.2 LOADKEY.30 5.4.3 REQUEST .31 5.4.4 ANTICOLLISION31 3 47
3、5.4.5 SELECT.33 5.4.6 AUTHENTICATION34 5.4.7 READ 35 5.4.8 WRITE.36 5.4.9 INCREMENT 38 5.4.10 DECREMENT .39 5.4.11 RESTORE 40 5.4.12 TRANSFER42 44 6.1 .44 6.2 INITV AL V ALUE.45 6.3 .46 6.4 .46 4 47 5 47 ISO14443A 2.1 2.2 2.2.1 REQUEST 2.2.2 ANTICOLL 6 47 2.2.3 SELECT 2.2.4 AUTHENTICATION 2.2.5 HALT
4、 7 47 2.2.6 READ : 2.2.7 WRITE : 2.2.8 INCREMENT 8 47 2.2.9 DECREMENT 2.2.10 RESTORE 2.2.11 TRANSFER 9 47 10 47 FM1715 3.1 FM1712/1714/1715 3.2 / / FM1712 FM1714 FM1715 / / / / / ALE HIGH ALE HIGH AS nAStrb A2 A2 LOW A2 LOW HIGH A1 A1 HIGH A1 HIGH HIGH A0 A0 HIGH A0 LOW nWait NRD NRD NRD NDS NDS nDS
5、trb NWR NWR NWR R/NW R/NW nWrite NCS NCS NCS NCS NCS LOW D7D0 D7D0 AD7AD0 D7D0 AD7AD0 AD7AD0 11 47 3.3 FM1715 Page hex 0 Page 1 Command 2 FIFOData 64byte FIFO 3 PrimaryStatus FIFO 4 FIFOLength FIFO byte 5 SecondaryStatus 6 InterruptEn / 0 7 InterruptRq 8 Page 9 Control A ErrorFlag B CollPos C TimerV
6、alue Timer D CRCResultLSB CRC 8 E CRCResultMSB CRC 8 1 F BitFraming bit 10 Page 11 TxControl 12 CWConductance TX1 TX2 13 ModConductance 14 CoderControl 15 ModWidth 16 PreSet16 2 17 TypeBFraming ISO14443-B 18 Page 19 RXControl1 3 1A DecoderControl 12 47 1B BitPhase 1C Rxthreshold bit 1D BPSKDemContro
7、l BPSK 1E RxControl2 1F ClockQControl 20 Page 21 RxWait 22 ChannelRedundancy 23 CRCPresetLSB CRC 8 24 CRCPresetMSB CRC 8 25 PreSet25 26 MFOUTSelect MFOUT 4 27 PreSet27 28 Page 29 FIFOLevel FIFO 2A TimerClock Timer 2B TimerControl Timer / 2C TimerReload Timer 2D IRQPinConfig IRQ IRQ 2E PreSet2E 5 2F
8、PreSet2F 30 Page 31 CryptoSelect 32 RFU 33 RFU 34 RFU 35 RFU 36 RFU 6 37 RFU 38 Page 39 RFU 3A RFU 3B RFU 3C RFU 3D RFU 3E RFU 7 3F RFU 13 47 14 47 5.1 */ /* main * / /* : * / /* : */ /* : */ /* :w angw e nqi ng */ /* :2003 9 */ /*/ #ifndef _MAIN_INCLUDED_ #define _MAIN_INCLUDED_ / #define FALSE 0 #
9、define TRUE 1 /FM1715 #define Transceive 0x1E / #define Transmit 0x1a / #define ReadE2 0x03 / FM1715 EEPROM #define WriteE2 0x01 / FM1715 EEPROM #define Authent1 0x0c / 1 #define Authent2 0x14 / 2 #define LoadKeyE2 0x0b / EEPROM KEY #define LoadKey 0x19 / FIFO KEY #define RF_TimeOut 0xfff / #define
10、Req 0x01 #define Sel 0x02 / #define uchar unsigned char #define uint unsigned int / #define TYPEA_MODE 0 /TypeA #define TYPEB_MODE 1 /TypeB #define SHANGHAI_MODE 2 / #define TM0_HIGH 0xf0 / 0 ,4MS #define TM0_LOW 0x60 / 0 #define TIMEOUT 100 / 4MS100=0.4 / 15 47 #define RF_CMD_REQUEST_STD 0x26 #defi
11、ne RF_CMD_REQUEST_ALL 0x52 #define RF_CMD_ANTICOL 0x93 #define RF_CMD_SELECT 0x93 #define RF_CMD_AUTH_LA 0x60 #define RF_CMD_AUTH_LB 0x61 #define RF_CMD_READ 0x30 #define RF_CMD_WRITE 0xa0 #define RF_CMD_INC 0xc1 #define RF_CMD_DEC 0xc0 #define RF_CMD_RESTORE 0xc2 #define RF_CMD_TRANSFER 0xb0 #defin
12、e RF_CMD_HALT 0x50 /Status Values #define ALL 0x01 #define KEYB 0x04 #define KEYA 0x00 #define _AB 0x40 #define CRC_A 1 #define CRC_B 2 #define CRC_OK 0 #define CRC_ERR 1 #define BCC_OK 0 #define BCC_ERR 1 /* * #define MIFARE_8K 0 /MIFARE 8KB #define MIFARE_TOKEN 1 /MIFARE 1KB TOKEN #define SHANGHAI
13、_8K 2 / 8KB #define SHANGHAI_TOKEN 3 / 1KB TOKEN /* * #define FM1715_OK 0 / #define FM1715_NOTAGERR 1 / #define FM1715_CRCERR 2 / CRC #define FM1715_EMPTY 3 / #define FM1715_AUTHERR 4 / #define FM1715_PARITYERR 5 / #define FM1715_CODEERR 6 / (BCC ) #define FM1715_SERNRERR 8 / (anti-collision ) #defi
14、ne FM1715_SELECTERR 9 / (SELECT ) #define FM1715_NOTAUTHERR 10 / #define FM1715_BITCOUNTERR 11 / #define FM1715_BYTECOUNTERR 12 / #define FM1715_RESTERR 13 / restore #define FM1715_TRANSERR 14 / transfer #define FM1715_WRITEERR 15 / write #define FM1715_INCRERR 16 / increment #define FM1715_DECRERR
15、17 / decrement 16 47 #define FM1715_READERR 18 / read #define FM1715_LOADKEYERR 19 / LOADKEY #define FM1715_FRAMINGERR 20 /FM1715 #define FM1715_REQERR 21 / req #define FM1715_SELERR 22 / sel #define FM1715_ANTICOLLERR 23 / anticoll #define FM1715_INTIVALERR 24 / #define FM1715_READVALERR 25 / #defi
16、ne FM1715_DESELECTERR 26 #define FM1715_CMD_ERR 42 / /* FM1715 * #define Page_Sel XBYTE0x7000 / #define Command XBYTE0x7001 / #define FIFO XBYTE0x7002 /64 FIFO #define PrimaryStatus XBYTE0x7003 / FIFO 1 #define FIFO_Length XBYTE0x7004 / FIFO #define SecondaryStatus XBYTE0x7005 / 2 #define InterruptEn XBYTE0x7006 / / #define Int_Req XBYTE0x7007 / #define Control XBYTE0x7009 / #define Error