基于嵌入式的以太网与CAN总线的网关设计
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着信息与网络技术的发展,嵌入式系统得到广泛的应用。在工业控制领域中,单个设备独立性强、设备间依赖性弱的特点将被取代,而设备资源的有效利用、设备间协同工作及远程传输、监控越来越多地被关注。
     CAN总线集多种优越性于一身,其应用不再局限于汽车工业,而且发展到过程控制、纺织机械、农用机械、机器人、医疗器械和传感器等领域,越来越多的工业设备采用CAN总线联网,组成分布式控制系统。以TCP/IP协议为基础的以太网具有远距离传输、通讯和方便快捷的特点,不仅广泛地应用在商业领域中,还进入了工业设备领域。工业设备接入以太网在很大程度上提高了控制系统的分布性。因此,本文提出CAN总线与以太网互联的课题。
     本文在深入研究以太网和CAN总线的网关理论的基础上,以ARM9为硬件平台,以Linux为软件平台,经过硬件连接和软件设计,对CAN总线协议和TCP/IP协议进行转换,实现以太网与CAN总线的互联,允许上层以太网用户对现场任一节点进行访问和控制,实现对生产现场的远程监控。
     本文的内容主要包括两点:硬件设计和软件设计。
     硬件设计:CUP选择三星公司ARM9芯片S3C2410,其它电路包括电源电路、复位电路、串口电路、CAN模块电路和以太网模块电路等。
     软件设计:采用嵌入式Linux为软件平台,将Linux安装、下载、移植到目标板上。在Linux环境下,编写CAN的驱动程序、应用程序以及CAN总线和以太网相互转换的应用程序,实现以太网与CAN总线的通讯。
     本文设计的嵌入式以太网和CAN总线网关在测试中具有较好的稳定性,以太网能够对现场CAN总线进行实时检测、查询和控制,实现了上层以太网对现场CAN总线的监控。
With the development of information and network technology, the embedded system is used widely in all kinds of fields. In the field of industrial control, the phenomena will be replaced, which is the stronger independence of the individual equipment and the weaker dependence between the equipments. More and more attention is paid on the effective of equipment, coordinated work among equipments, long-distance transmission and remote supervisory.
     As an outstanding field bus, CAN bus has more advantages. It can not only be used in motorcar industry, but also process control, textile machinery, farm machinery, automaton, medical apparatus and instruments, transducer, and so on. More and more industry equipments adopt CAN bus to make up the distributed control system. Ethernet has been widely used in business field. It can be facilityly transmit and communication. Ethernet based on TCP/IP begins to enter the industry equipment field besides its popularization on PC. The equipment accessing to Ethernet will greatly improve the distributed characteristic of the control system. The interconnection between CAN bus and Ethernet is discussed.
     The article has studied the protocol transition gateway between CAN bus and Ethernet based on Linux operating system. Taking Linux as the software platform and ARM as the hardware platform, and by the design of the software and hardware, it realized the protocol transition between CAN protocol and Ethernet protocol. And it realized interconnection between the CAN bus and Ethernet, permitted every authorization upper user on Ethernet visiting and controlling production layer and monitoring equipments in production layer.
     The article has two points: the design of hardware and the design of software.
     Hardware design section: selecting the S3C2410X as the core, and finishing the design of the power circuit、the restoration circuit、the serial interface circuit、the CAN module circuit and the Ethernet module circuit and so on.
     Software design section: taking Linux as the software platform, finishing the Linux install、the download, transplant on the ARM core board. Under the Linux operating system, it compiles the CAN application and controller driver, the protocol transition application. Realized the communication between the CAN bus and the Ehernet.
     Its stability is satisfied, which is the design of the embedded CAN and Ethernet gateway. And it has realized monitoring the CAN bus via Ethernet, and realized networks interconnection between the CAN bus and the Ethernet.
引文
[1]武永梅.基于嵌入式的以太网与现场总线协议网关的设计[D].山西:太原理工大学,2006.4
    [2]王廷尧.以太网技术与应用[M].北京:人民邮电出版社,2005
    [3]赵金刚.现场总线及其发展现状[J].自动化与仪表,1996.4.
    [4]梁合庆.当今嵌入式系统综述与新的投资机遇[J].测控技术.2000,19(4)
    [5]王田苗.嵌入式系统设计与实例开发[M].北京清华大学出版社,2002.9:1-5
    [6]杨波,徐成.嵌入式ChN2Ethernet网关的设计与实现[J].计算机应用,2005.2:273-275
    [7]尹叶丹.基于嵌入式Linux的CAN-TCP/IP网关的研究与实现[D].武汉理工大学,2004.10
    [8]李正军.现场总线与工业以太网及其应用系统设计[M].北京:人民邮电出版社,2006
    [9]张大鹏.CAN总线与以太网互联关键技术的研究[D].南京航空航天大学,2006.2
    [10]李正军编著.现场总线及其应用技术[M].北京:机械工业出版社,2005.1
    [11]赵金钢.现场总线及其发展现状[J].自动化与仪表,1996,4.
    [12]郭苗刚,施建军.现场总线控制系统浅谈[J].山西长治:山西冶金,2004(1)
    [13]陈积明等.工业以太网德研究现状及展望[J].化工自动化及仪表,2001.6.
    [14]张满怀.嵌入式TCP/IP协议研究与实现[J].广东工业大学,2001.4.
    [15]李明.康静秋.嵌入式TCP/IP协议的研究与开发[J].计算机工程应用,2002.
    [16]Kenneth D.Reed.TCP/IP基础[M].3com公司译.北京:电子工业出版社
    [17]Kenneth D.Reed.协议分析[M].孙坦 张学峰等译.北京:电子工业出版社
    [18]琼斯.嵌入式系统TCP/IP应用层协议=TCP/IP application layer protocols for embedded systems[M].北京:电子工业出版社,2003
    [19]阿克塞尔森.嵌入式Ethernet和Internet通信设计技术=Embedded Ethernet and Internet complete[M].北京:北京航空航天大学出版社,2006
    [20]熊光泽,罗蕾.嵌入式软件技术的现状与发展动向[J].计算机应用,2001.20(7)
    [21]谢克明.嵌入式操作系统研究及开发实例[J].自动化博览,2005.2,No1:23-26
    [22]Ganssle Jack G.The Art of Programming.Embedded Systems,San Diego:Academic press,1992.
    [23]金西,黄汪.嵌入式Linux技术及其应用[J].计算机应用,2000.07
    [24]熊江.三种嵌入式操作系统的分析与比较[J].单片机遇嵌入式系统应用,2003.05
    [25]Victor Yodaiken,Michael Brannanov,RTLinux Version Two,VJY Associates LLC[EB/OL].http://www.rtlinux.org/,2000.10.12.
    [26]周德新,张向利.Linux与嵌入式操作系统[J].桂林电子工业学院学报,2000.04
    [27]Daniel P.Bovet,Marco Cesati.Understanding the Linux Kernel.
    [28]David A Rusling.The Linux Kernel[M].
    [29]陈闳中.Linux在嵌入式操作系统中的应用[J].同济大学学报(自然科学版),2001.05
    [30]陈赜,秦贵和,徐华中,王磊.ARM9嵌入式技术及Linux高级实践教程[M].北京:北京航天航空大学出版社,2005.6
    [31]Samsung Electronics Co.,Ltd.S3C2410X 32-Bit RISC Microprocessor User's Manual,Revision 1.2,2003
    [32]沈文斌.嵌入式硬件系统设计与开发实例详解[M].北京:电子工业出版社,2005
    [33]赵文博.新型常用集成电路速查手册[M].北京:人民邮电出版社,2006.1 432-433
    [34]Linear Technology Corporation.LT1086 Series[EB/OL].http://www.alldatasheet.com/datasheet-pdf/pdf/70293/LINER/LT1086.html,2007.12.24.
    [35]SP3222E/3232E,+3.0V到+5.5V RS232收发器[S].广州周立功单片机发展有限公司
    [36]RTL8019AS datasheet Reference[S].REALTEK Semiconductor Corp.
    [37]http://hi.baidu.com/cityzhao/blog/item/a18d952ffa33bc3b1e308956.html
    [38]张阳天,韩异凡.Protel DXP电路设计[M].北京:清华大学出版社,2005.6
    [39]张立强,于伟,柴东.电路原理图与PCB板设计教程Protel DXP[M].科学出版社,2005.2
    [40]清源科技.Protel 2004电路原理图及PCB设计[M].北京:机械工业出版社,2005.1
    [41]http://industry.ccidnet.com/art/321/20060927/911913_1.html
    [42]周立功.ARM嵌入式系统实验教程·一[M].北京:北京航空航天大学出版社,2004
    [43]周立功.ARM嵌入式系统实验教程·二[M].北京:北京航空航天大学出版社,2005
    [44]周立功.ARM嵌入式系统实验教程·三[M].北京:北京航空航天大学出版社,2005
    [45]周立功.ARM嵌入式系统实验教程·三,扩展实验[M].北京:北京航空航天大学出版社,2006
    [46]周立功.ARM嵌入式系统软件开发实例·一[M].北京:北京航空航天大学出版社,2004
    [47]http://www.hhcn.com/cgi-bin/topic.cgi?forum=1&topic=247&show=0
    [48]杨恒.ARM嵌入式系统设计及实践[M].西安电子科技大学出版社,2005
    [49]武汉创维特公司.CAN程序说[EB/OL].http://www.cvtech.com.cn/down_index.asp,2007.9.11
    [50]泽雷尔.嵌入式系统的C程序设计[M].北京:机械工业出版社,2002
    [51]郁文工作室.嵌入式C语言程序设计:使用MCS-51[M].北京:人民邮电出版社,2006
    [52]晨风.嵌入式实时多任务软件开发基础[M].北京:清华大学出版社,2004
    [53]拉姆耶.嵌入式实时操作系统的多线程计算—基于ThreadX和ARM=Real-time Embedded Multithreading:Using ThreadX and ARM[M].北京:北京航空航天大学出版社,2005