毕业设计(单片机的以太网接入设计)

黑龙江*****

毕 业 论 文 (设 计)

题目:单片机的以太网接入设计

学生姓名 赫东

学 号 084

专 业 电子信息工程

班 级 2008级2班

指导教师 王 琢

学 部 计算机科学与电气工程

答辩日期 2012年5月19日

黑龙江东方学院本科生毕业论文(设计)任务书

姓名 赫东 学号 0 专业班级 电子信息工程08级2班 毕业论文(设计)题目:单片机的以太网接入设计 毕业论文(设计)的立题依据 随着以太网控制芯片的性价比的提高,利用专用的芯片完成单片机与网关之间的协议转换成为单片机应用系统接入Internet网络的一大研究热点。因此,除了传统的便携、低功耗等性能,网络接入能力正逐渐成为嵌入式系统所关注的重点。 主要内容及要求 本论文内容包括绪论、单片机接入以太网络的最小系统、TCP/IP协议栈、硬件电路设计、软件设计实现以及结论。本论文要求详细地阐述单片机以太网的接入设计开发过程。 进度安排 12月12日 12月13日~12月29日 12月30 日~1 月17日 1 月18日~2 月26日 2 月27日~3 月27日 3 月28日~4 月8 日 4 月9 日~4 月17日 4 月18日~4 月22日 4 月23日~5 月3 日 5 月4 日~5 月9 日 5 月10 日~5 月18日 5 月19日 选题 接受指导老师的指导 拟定论文大纲 搜集、查阅、整理相关资料 初稿形成 初稿审定 第一次修改 第一次审定 第二次修改 定稿 论文评阅小组评审论文(设计) 毕业论文(设计)答辩 学生签字: 指导教师签字: 年 月 日

黑龙江东方学院本科毕业论文(设计)

单片机的以太网接入设计

摘 要

资随着互联网的日益普及,TCP/IP协议族已经成为因特网上事实的通信标准。与此同时,无论是在家中、办公室或者其他地方,都能方便地连接到网络上。接入因特网的便捷性大大增加,而成本却越来越低,如果能实现“每一设备都接入因特网”,则可方便、低廉地将信息传送到几乎任何一地,实现全球化信息。因此,除了传统的便携、低功耗等性能,网络接入能力正逐渐成为嵌入式系统所关注的重点。本设计介绍了一种基于单片机的以太网接入设计,单片机接入以太网的最小系统构成,以及以太网控制器RTL8019AS的工作原理。主要提出了将精简TCP/IP协议栈嵌入单片机系统中,通过RTL8019AS实现了UDP数据在以太网数据传输的方案。设计中给出系统硬件原理图和有关实现TCP/IP协议的转换和程序代码,对系统的软、硬件设计做出了阐述,并给出了设计实验结果。结果表明这种通过软件嵌入TCP/IP协议的单片机系统,具有成本低、硬件少、传输速度快、使用方便等优点,特别适用于现有的网络传输系统,在数据采集、数据传输等领域有广泛的应用前景。

关键词:单片机;TCP/IP协议;以太网控制器;以太网数据

-I- 黑龙江东方学院本科毕业论文(设计)

The Design of Ethernet Access Based on MCU

Abstract

With the increasing popularity of Internet, TCP / IP protocol suite has become the fact that the Internet communications standards. At the same time, whether at home, office or elsewhere, you can easily connect to the Internet. The convenience of Internet access is greatly increased, and costs are getting lower and lower, if they can achieve \device access Internet \convenient, inexpensive way to transmit the information to almost any one place, globalization of information. Therefore, in addition to the traditional portable, low power consumption, such as performance, network access ability which is increasingly becoming the focus of embedded system. This design introduces a design based on MCU Ethernet access, Ethernet access to the smallest single chip system structure, and the Ethernet controller RTL8019AS works. Mainly proposed to streamline the TCP / IP protocol stack embedded microcontroller system is achieved through the RTL8019AS UDP data in the Ethernet data transmission. Given system hardware design schematics and the realization of TCP / IP protocol conversion, and program code, hardware and software designed to make the system are described, and gives the design results. The results show that the software embedded TCP / IP protocol of the SCM system with low cost, less hardware, transmission speed, ease of use, especially for the existing network transmission system, data acquisition, data transmission and other areas wide range of applications.

Keywords: MCU ;TCP/IP Protocol ; Ethernet Controller ; Ethernet Data

-II-

目 录

摘 要 ....................................................................................................................................... I Abstract.........................................................................................................................................II 第1章 绪 论 ........................................................................................................................ 1 1.1 研究目的和意义............................................................................................................... 1 1.2 国内外研究状况............................................................................................................... 2 第2章 单片机接入以太网的最小系统 .................................................................................... 5 2.1 单片机的基本结构........................................................................................................... 5 2.2 以太网控制器的选择及工作原理................................................................................... 6 2.2.1 以太网控制器的选择 ............................................................................................... 6 2.2.2 RTL8019AS控制器的介绍 ....................................................................................... 7 2.2.3 RTL8019AS的工作原理 ........................................................................................... 7 2.3 TCP/IP协议栈................................................................................................................... 9 2.3.1 TCP/IP协议的分层结构 ........................................................................................... 9 2.3.2 TCP/IP协议数据的处理 ..........................................................................................11 2.3.3 相关协议报文的格式 ............................................................................................. 12 2.4 本章小结......................................................................................................................... 15 第3章 硬件电路设计 .............................................................................................................. 16 3.1 单片机系统扩展电路..................................................................................................... 16 3.2

RTL8019AS和单片机的接口电路............................................................................. 17

3.2 本章小结......................................................................................................................... 19 第4章 软件设计 ...................................................................................................................... 20 4.1 串行口控制程序的设计................................................................................................. 20 4.2 RTL8019AS控制程序的设计 ........................................................................................ 21 4.3 精简TCP/IP协议栈的现实意义及其工作流程........................................................... 24 4.4 以太网串行口数据转换模块工作实例......................................................................... 27 4.5 本章小结......................................................................................................................... 30 结 论 .................................................................................................................................... 31 参考文献 .................................................................................................................................... 32

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4