单片机与Internet网络的通信应用研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着计算机通信技术、电子信息技术和多媒体技术的飞速发展,Internet网络日益成为人们日常生活中必不可少的工具。信息家电、智能化仪表等需要与Internet网络连接的非PC设备越来越多。就目前来看,在非PC设备中,大约有50%左右的是8位的微处理器。若想实现这些设备与Internet网络的通信,必须扩展8位微处理器的网络功能。本文提出了单片机与Internet网络通信的一种具体实现方案。鉴于8位小型微型单片机系统的广泛应用,在深入学习了解了高性能的32位单片微处理器与Internet网络的通信应用之后,选择目前较为流行的八位单片机和以太网控制芯片构成单片机网络通信系统,并在此基础上成功的将经过裁剪的TCP/IP协议移植到系统中,在此基础上设计并实现了嵌入式webserver应用:客户端通过浏览器中的网页实时操纵单片机应用系统LED小灯的亮灭。
     由于8位单片机的内部资源有限,根据其自身特点和实际应用的需要,必须对TCP/IP协议进行适当的裁剪。本系统在设计过程中,选择了TCP/IP协议各层最具代表性的协议,并对其进行裁剪,将裁减后的协议移植到系统中后,经实验证明系统运行良好,达到了预期的目的。
     论文首先根据需要,设计以太网接口电路,编写以太网驱动程序;对TCP/IP协议进行适当裁减,以适应8位单片机内部资源,并进行移植;实现了webserver应用,通过对HTTP协议分析,在单片机内部实现了HTTP协议,并用HTML语言编写web页面,把网页保存到单片机内部的ROM中,通过Internet explorer浏览器可以远程访问网页,并实现对系统的实时监控、操纵。
     根据webserver应用在单片机中实现的具体需求,设计摒弃了嵌入式实施操作系统,直接实现了TCP/IP协议,大大缩短了开发的时间;本文最大的特点是在8位单片机中实现了webserver应用,对单片机系统的控制和监测变得简便、直观。使用HTML语言编写了网页,并将源代码以字符数组的形式存储在单片机的EEPROM中,读取时可以以访问数组的形式访问代码,巧妙地绕过了操作系统对文件读取的限制,并且提高了系统的运行效率。
     以单片机为核心的小型微型嵌入式系统必将在教育领域得到广泛应用。目前,高校信息资源建设正如火如荼,软件信息资源的共享,使得教育极大的便利化,教育投资的效益迅速提高。但是,硬件资源难以共享。有了嵌入式技术的支持,在精密仪器中植入小型的嵌入式芯片,就可以通过操作嵌入到单片机内部的web页面的按钮,远程实时操纵仪器,并通过单片机采集数据,传输到本地计算机,并且用浏览器将信息图文并茂的显示,可以方便的得到实验数据。实现校园硬件设备的共享,可以大大节省人力物力,具有极大的经济效益,对教育信息化发展具有积极的推动作用。
With the rapid development of computer communication technology, electronics and information technology and multimedia technology, internet increasingly becoming an essential tool for people's daily life. More and more non-PC equipment, such as intelligent instruments and information appliance, need to connect to the Internet.Judging from the present situation, about 50% of the non-PC equipment is the 8-bit microprocessor. If we wish to achieve these communications between equipment and the internet, we must expand the network functions of 8-bit microprocessor.
     This thesis point out a concrete realization program of the communication between the internet and the MCU. In view of the wide application of 8-bit MCU , by the in-depth study and understanding of high-performance 32-bit single-chip microprocessor and the communication to the Internet, choosing the best and most popular ethernet controller chip and the 8-bit MCU to make network communication system, successful transplant the tailored TCP/IP agreement to the system, and implement the embedded webserver applications on the basis of the design: through the browser, client could real-time manipulate the small LED lights based on the MCU application system.
     Due to the limited resource of 8-bit MCU, according to its own characteristics and application needs, we must tailor the TCP agreement properly. In the system design process, select the most representative protocol of each layer of TCP agreement and tailor it for need and transplant the agreement to the system, the experiment proves that the system operates well and achieves the desired results.
     Firstly, design the ethernet interface circuit and compile the ethernet driver program; tailor the TCP/IP agreement appropriately to meet the 8-bit MCU internal resources and transplant it to the system; achieve the web server application, realize the HTTP protocol based on the analysis of it and write the web page using HTML, save it to the internal ROM of the MCU. Then we can remote browse the homepage via Internet Explorer and realize the real-time monitoring and control.
     According to the specific needs of the achieve of web server application to microprocessor, abandon the Embedded operating system and direct realize the TCP/IP protocol what greatly shorten the development time; The greatest feature of this thesis is to achieve the web server application in 8-bit microcontroller. So the control and monitoring of the MCU system becomes simple and intuitive. Compile the web page using HTML language. store the source code in the form of array characters to the EEPROM, and can visit in the form of array cleverly circumvented the restrictions of reading the document of the retrieval system and enhance the operational efficiency of the system.
     Embedded microprocessor systems with the core of MCU will be widely applied in the field of education. At present, the University's Information Resources Construction is in full swing, and the sharing of software information resources enables great facilitation and rapidly improves the efficiency of investment in education. However, the sharing of hardware resources is difficult. With embedded technology, implant the small embedded chips to the precision instruments ,through the operate of the buttons on the website planted in the MCU and remote operate the equipment, then get data by the MCU and transport it to the local computer and show the information on the browser via many methods. Experimental data can be got conveniently. Share the hardware equipment can greatly reduce the human and material resources and has great economic benefit, has a positive role in promoting the information technology in the field of education.
引文
[1] Douglas E.comer.Internetworking with TCP/IP(VOL I~III)[M].北京:电子工业出版社,2002.
    [2] WRichard stevens.TCP/IP Illstuated(VOL I~III)[M].北京:机械工业出版社,2001.
    [3] Heather Osterloh.TCP/IP Primer Plus[M].北京:人民邮电出版社,2002.
    [4] Larry L.peterson.Computer Networks,A system Apporach[M].北京:机械工业出版社,2005
    [5] Andrew S.Tanenbaum.Computer Network[M].北京:清华大学出版社,2004.
    [6] C.L.Stephens.TCP/IP-An Introduction for 8&16 bit Microcnotroller Engineers.2002.
    [7] M.Tim Jones.TCP/IP Application Layer Protocols for Embedded Systems[M].北京:电子工业出版社,2003.
    [8] Cygnal Integrated Products, Inc.Embedded Ethernet Referance Design.2002.
    [9] Doxygen.uIP 0.9 Reference Manual.2003.
    [10]Adam Dunkels.Full TCP/IP for 8 bit Architetures.
    [11] Adam Dunkels.uIP-A free Small TCP/IP Stack.2002.
    [12] Jeremy Bentham.TCP/IP Lean-Webservers for Embeded Systems,Second Edition[M].Berkely:Publishers Group West.2002.
    [13] Glen Mann. Using Linux to Implement 8- and 16- Bit Device Networking Solutions.
    [14] Realtek Semiconductor CO., LTD.Realtek Full-Duplex Ethernet Controller with Plug and Play Fuction.2005.
    [15] Winbond Electronics Corp. W78E58B Data Sheet.2005.
    [16] 赵海.嵌入式 Internet-21 世纪的一场信息技术革命[M].北京:清华大学出版社,2001.
    [17] 严蔚敏,吴伟民.数据结构[M]. 北京:清华大学出版社,1997.
    [18] 徐祥宣等.计算机算法基础[M].武昌:华中科技大学出版社,1998.
    [19] 杨金岩等.8051 单片机数据传输接口扩展技术与应用实例[M].北京:人民邮电出版社,2005.
    [20] 求是科技.单片机通信技术与工程实践[M].北京:人民邮电出版社,2005.
    [21] 慧民等.单片微型计算机原理、接口及应用[M].北京:人民邮电大学出版社,2000.
    [22] 史东海.单片机数据通信技术从入门到精通[M].西安:西安电子科技大学出版社,2003.
    [23] 黄容怀.信息技术与教育.北京:北京师范大学出版社,2002.
    [24] 马利等.实现电子设备网络化解决方案[J].单片机与嵌入式系统应用,2002,(2).
    [25] 闫保中等.基于 AVR 高速单片机的 Webserver 研究[J].应用科技,2006,(3).
    [26] 林雪梅,彭佳红.单片机多机通信协议的设计[J]. 微计算机信息,2006,(5).
    [27] 尚晨旭等.用单片机实现以太网卡通信的设计[J].电子工程师,2006,(2).
    [28] 黄训诚.基于 RTL8019AS 的单片机 TCP/IP 网络通信[J].微电子学与计算机,2005,(3).
    [29] 刘海峰.基于 DSP 的 TCP/IP 协议的应用研究[J].微电子学与计算机,2006,(2).
    [30] 周晓峰等.单片机上简单 TCP/IP 协议的实现[J].微电子学与计算机,2004,(2).
    [31] 黄国刚等.基于 CS8900A 的工业级嵌入式网络接口实现[J].计测技术,2005,(1).
    [32] 谢小竹等.基于 TCP/IP 的网络单片机应用[J].计算机工程,2003,(9).
    [33] 蒋巧文等.基于单片机的嵌入式系统网络接入方案[J].电子产品世界,2004,(7).
    [34] 刘康等.嵌入了 TCP/IP 协议的单片机数据通信系统的设计与实现[J].电测与仪表,2003,(6).
    [35] 王峰等. 嵌入式 internet 技术及其实现方案[J]. 微计算机信息,2003,(12).
    [36] 曹宇等. 用 51 单片机控制 RTL8019AS 实现以太网通讯[J].电子技术应用,2003,(1).
    [37] 徐功文等.TCP/IP 协议栈在 MSP430 单片机上的实现[J].信息技术与信息化,2005,(3).
    [38] 伍洲凯等.基于 8 位微处理器的嵌入式 TCP/IP 协议栈剖析[J].微计算机与应用,2004,(5).
    [39] 杜长河等.一种小型嵌入式 tcp/ip 协议栈的设计与实现[J].微电子学与计算机,2003,(6).
    [40] 李立清等.一种嵌入式 TCP/IP 的实现[J].信息与电子工程,2003,(12).
    [41] 李明等. 嵌入式 tcp/ip 协议栈的研究与开发[J].计算机工程与应用,2002,(16).

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700