• 大小: 227KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-08
  • 语言: 其他
  • 标签: M1卡  CPU卡  

资源简介

M1卡和CPU卡读卡机芯片FM1702SL源程序, 两种程序都有, 非常适合开发测试, 找了好长时间才找到, 献给大家

资源截图

代码片段和文件信息

#include “at89x52.h“
#include “intrins.h“
#include “pin.h“
#include “fm17xx.h“
void ISO15693_init(void);
unsigned char ISO15693_iventory(void);
unsigned char ISO15693_read(unsigned char block);
unsigned char ISO15693_select(void);
unsigned char ISO15693_Write(unsigned char block unsigned char wdata[8]);
void ISO15693_init(void)
{
SPIWrite(0x260x02);
SPIWrite(0x140x2f);
SPIWrite(0x150x3f);
SPIWrite(0x190x8b);
SPIWrite(0x1a0x14);
SPIWrite(0x1c0xf8);
SPIWrite(0x1e0x41);
SPIWrite(0x220x2c);
SPIWrite(0x230xff);
SPIWrite(0x240xff);
}

unsigned char ISO15693_iventory(void)
{
unsigned char iuid[8];
SPIWrite(0x110x58);
delay_100us(100);
SPIWrite(0x110x5b);
delay_100us(100);
SPIWrite(0x010x00);
SPIWrite(0x090x01);
SPIWrite(0x020x06);
SPIWrite(0x020x01);
SPIWrite(0x020x00);
SPIWrite(0x010x1e);
for( i=0;i<=15;i++)
        {
        SPIWrite(0x140x2f);
        delay_100us(100);
        if((SPIRead(0x01)==0)&&((SPIRead(0x0a)&0x0f)==0x00))
                {
                for( i=0;i<2;i++)
                        SPIRead(0x02);
                for( i=0;i<8;i++)
                        {
                        uid[i]=SPIRead(0x02);
                        }
                return 0;
                }
        if(i<15)
                {
                SPIWrite(0x140xaf);
                SPIWrite(0x010x1e);
                }
        }
return 1;
}

unsigned char ISO15693_select(void)
{unsigned char tag_typeuid[8]i;
SPIWrite(0x010x00);
SPIWrite(0x090x01);
SPIWrite(0x020x22);
SPIWrite(0x020x25);
for( i=0;i<8;i++)
        SPIWrite(0x02uid[i]);
SPIWrite(0x010x1e);
     
        if((SPIRead(0x01)==0)&&((SPIRead(0x0a)&0x0f)==0x00))
                {
                tag_type=SPIRead(0x02);
                return 0;
                }
return 1;
}

unsigned char ISO15693_read(unsigned char block)
{
unsigned char irec_data[9];
SPIWrite(0x010x00);
SPIWrite(0x090x01);
SPIWrite(0x020x12);
SPIWrite(0x020xa0);
SPIWrite(0x020x05);
SPIWrite(0x020x10);
SPIWrite(0x02block);
SPIWrite(0x020x00);
SPIWrite(0x010x1e);

if((SPIRead(0x01)==0)&&((SPIRead(0x0a)&0x0f)==0x00))
        {
        for( i=0;i<9;i++)
rec_data[i]=SPIRead(0x02);
        return 0;
        }
return 1;
}

unsigned char ISO15693_Write(unsigned char block unsigned char wdata[8])
{
unsigned char tag_typei;
SPIWrite(0x010x00);
SPIWrite(0x090x01);
SPIWrite(0x020x12);
SPIWrite(0x020xa0);
SPIWrite(0x020x05);
SPIWrite(0x020x30);
SPIWrite(0x02block);
SPIWrite(0x020x00);
for( i=0;i<8;i++)
        SPIWrite(0x02wdata[i]);
SPIWrite(0x010x1e);

if((SPIRead(0x01)==0)&&((SPIRead(0x0a)&0x0f)==0x00))
                {
tag_type=SPIRead(0x02);
                return 0;
                }
return 1;
}



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2835  2011-03-09 15:53  1702_test\15693.c

     文件       5545  2011-03-09 16:03  1702_test\15693.LST

     文件      18794  2011-03-09 16:03  1702_test\15693.OBJ

     文件     177685  2011-03-09 16:03  1702_test\1715

     文件      46176  2011-03-09 16:03  1702_test\1715.hex

     文件        107  2011-03-09 16:03  1702_test\1715.lnp

     文件     148493  2011-03-09 16:03  1702_test\1715.M51

     文件        291  2012-09-28 17:05  1702_test\1715.plg

     文件      34488  2010-06-11 10:20  1702_test\17XX

     文件         80  2010-06-11 10:20  1702_test\17XX.lnp

     文件     116003  2010-06-11 10:20  1702_test\17XX.M51

     文件       1622  2012-09-07 14:55  1702_test\17XX.opt.bak

     文件        532  2010-06-11 10:21  1702_test\17XX.plg

     文件       2330  2012-09-07 14:55  1702_test\17XX.Uv2.bak

    .......     60017  2012-09-28 17:05  1702_test\17XX.uvopt

     文件      14086  2012-09-07 15:46  1702_test\17XX.uvproj

     文件       1863  2011-05-18 15:18  1702_test\17XX_Opt.Bak

     文件       1893  2011-05-18 15:18  1702_test\17XX_Uv2.Bak

    .......     60023  2012-09-28 17:05  1702_test\17XX_uvopt.bak

     文件       1215  2001-12-06 07:59  1702_test\ABSACC.H

     文件       6983  2010-01-27 10:11  1702_test\AT89X52.H

     文件      19641  2010-09-26 10:31  1702_test\des.c

     文件      33482  2011-03-09 16:03  1702_test\des.LST

     文件      43059  2011-03-09 16:03  1702_test\des.OBJ

     文件      37463  2011-03-09 16:00  1702_test\fm17xx.c

     文件       7741  2011-03-09 15:53  1702_test\fm17xx.h

     文件      58889  2011-03-09 16:03  1702_test\fm17xx.LST

     文件      59139  2011-03-09 16:03  1702_test\fm17xx.OBJ

     文件        797  2001-02-05 15:32  1702_test\INTRINS.H

     文件      10851  2010-11-03 09:22  1702_test\main.c

............此处省略22个文件信息

评论

共有 条评论