非接触及接触式RFID读卡器的协议研究与软件实现

 2022-08-08 09:34:31

论文总字数:29830字

摘 要

射频识别技术从20世纪90年代发展到现在,已经十分成熟。我国对于RFID的研究要晚于国外,所以技术还不够成熟,有些部分仍然依赖于国外技术,并且中国目前还没有自己的协议标准。但是,每个人都会或多或少的使用智能卡,庞大的人口使得智能卡在中国的市场十分广阔,因此发展迅速。几年前,对于非接触CPU卡的使用还较少,由于M1卡的安全问题和接触式卡的局限性,使得政府正在不断推进非接触CPU卡走进市场。

基于此背景与目的我们开展了本课题研究。本文首先介绍研究背景及意义,对RFID进行宏观介绍,并调研了目前主流读卡器所能支持的三种主要类型卡片,之后设计并实现了读卡器的各类卡片的操作功能,以及一些辅助功能。最后展示了本系统的测试结果。本文设计的读卡器通过UART通讯与计算机进行通信获得已被定义的指令码。利用定义好的规则,在单片机的主要函数中将指令码翻译成读卡器所支持的指令。再通过SPI通信将指令存入FM17520中的FIFO寄存器中。通过对FM17520的控制寄存器合理配置,将FIFO寄存器中的指令发送给卡片,并准备接收来自卡片的数据,从而完成与卡片的通信。发送频率使用13.56MHz,ISO14443的协议通过单片机的控制完成。SAM卡内嵌在读卡器中,不需要FM17520进行射频通信。只需要在引脚上严格按照时序发送正确的指令就可以与SAM卡进行通信。

本文主要工作为对单片机进行编程实现功能,编程制作上位机指令程序。本系统与非接触式卡可完成基本的寻卡、防止卡片冲突、选卡操作,进行协议协商,对卡片进行读、写、加值减值操作。此外,在CPU卡中可以进行外部认证、建立文件、建立目录等操作。可对SAM卡实现冷激活、热激活、去电、外部认证等操作。兼容了M1卡,CPU卡以及SAM卡,当CPU卡完全普及后,可在单片机中关闭M1卡接口,达到M1卡向CPU卡的平滑升级的目的,SAM内嵌于读卡器中,可管理CPU卡和M1卡的密钥,增加系统的安全性。

关键词:射频识别,非接触智能卡,通信,协议,防冲突。

Abstract

Radio frequency identification technology has been mature since its development in the 1990s. China's research on RFID is later than abroad, so the technology is not mature enough, and some parts still rely on foreign technology, and China currently does not have its own protocol standards. However, everyone will use smart cards more or less, and the huge population makes the smart card market in China very broad, so it is growing rapidly. A few years ago, the use of non-contact CPU cards was still relatively small. Due to the security issues of M1 cards and the limitations of contact cards, the government is continuously pushing non-contact CPU cards into the market.

Based on this background and purpose, we carried out research on this topic. This article first introduces the research background and significance, introduces the RFID macroscopically, and investigates the three main types of cards that can be supported by the current mainstream card readers. After that, the card reader's operating functions of various types of cards are designed and implemented, and some Accessibility features. Finally, the test results of this system are shown. The reader designed in this paper communicates with the computer through UART communication to obtain the defined instruction code. Using the defined rules, the instruction code is translated into the instructions supported by the reader in the main functions of the microcontroller. Then through SPI communication, the instruction is stored in the FIFO register in the FM17520. By properly configuring the control register of the FM17520, the instructions in the FIFO register are sent to the card and ready to receive data from the card, thereby completing the communication with the card. The transmission frequency is 13.56MHz, and the ISO14443 protocol is controlled by the microcontroller. The SAM card is embedded in the card reader and does not require FM17520 for RF communication. Just communicate with the SAM card by sending the correct instruction on the pin in strict accordance with the timing.

The system and contactless cards can complete basic card searching, card conflict prevention and card selection operations, negotiate protocols, read, write, and add value. In addition, operations such as external authentication, file creation, and directory creation can be performed on the CPU card. The SAM card can be cold-activated, hot-activated, outgoing, and externally authenticated. Compatible with M1 card, CPU card and SAM card. When the CPU card is completely popular, the M1 card interface can be closed in the SCM to achieve the purpose of smooth upgrade of the M1 card to the CPU card. SAM is embedded in the card reader and can be managed. The key of the CPU card and M1 card increases the security of the system.

Keywords: Radio frequency identification, contactless smart card, communication, protocol, anti-collision

目 录

摘要 3

Abstract 4

第一章 绪论 1

1.1研究背景与意义 1

1.2本文的主要工作和组织结构 2

第二章 系统的理论研究 3

2.1 RFID技术 3

2.2 非接触式逻辑加密卡 4

2.2.3 M1卡的通信流程 4

2.3 CPU卡 5

2.3.1 与M1卡的异同 5

2.3.2 CPU卡的安全系统 6

2.3.3 CPU卡的通信流程 6

2.4 SAM卡 7

2.4.1 SAM卡的电气接口 7

2.4.2 SAM卡的通信流程 8

2.5 本章小结 8

第三章 系统的实现方式 9

3.1 硬件实现 9

3.2 软件实现 12

3.2.1 初始化实现 13

3.2.2 计算机与单片机的通信 14

3.2.3 单片机与FM17520的通信 15

3.2.4 FM17520与卡片的通信 16

3.2.5 单片机与SAM卡的通信 16

3.3 激活操作 17

3.3.1  CPU卡的激活操作 17

3.3.2 M1卡的激活操作 21

3.3.3 SAM卡的激活操作 22

3.4 ISO14443协议的实现 24

3.5 本章小结 25

第四章 辅助功能 26

4.1 CRC校验实现 26

4.2 DES加密的实现 26

4.3显示模块的实现 27

4.4 时钟模块 29

4.5本章小结 29

第五章 测试 30

5.1协议测试方法 30

5.2测试demo 32

5.3本章小结 33

第六章 总结 34

致 谢 35

参考文献 36

附录A 37

  1. 绪论

1.1研究背景与意义

在上世纪九十年代,已经开始出现了规模化商用的RFID设备。射频识别发展到今天,技术已经相当成熟,从低频,到高频,到超高频。识别范围愈来愈大,可同时操作的卡片也越来越多[1]。其安全性和广泛性都得到了提升,早已成为人们日常生活中的一部分。

二十一世纪开始,人们对于RFID有了更加正确的认识,不再神话其功能,但是它在民用方面的快捷方便等优点进一步得到了世界各国的关注和认可,使得它的发展依然迅速。在西方国家,射频识别技术已经被广泛成熟的运用于各种场合:身份认证、门禁系统、ETC、商场货物管理等等,射频识别技术在物联网领域也具有举足轻重的地位。但是,RFID技术不只具有有利的一面。虽然它具有一定的安全系统,但总会有漏洞,尤其是数据需要进行无线传播,很可能使得犯罪分子能够读取用户隐秘信息,使得这项技术暗藏忧患。

剩余内容已隐藏,请支付后下载全文,论文总字数:29830字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;