智能PCI-CAN及485接口卡的设计及其应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
CAN总线和RS485总线是两种工业上应用非常广泛的总线,CAN总线数据通信具有突出的可靠性、实时性和灵活性,RS485总线结构简单,传输距离长,它们在工业控制领域有着广泛的应用前景。随着计算机性能的日益强悍,计算机技术的应用越来越广泛。在有些工业控制过程中需要计算机作为上位机来监控系统,因此需要一个接口来实现底层网络与上位机的通信。而PCI总线是当前计算机中最流行的总线,它传输速度快,可以实现即插即用。本文设计了一种基于PC机PCI总线的CAN、RS485总线接口卡。
     本文在分析PCI、CAN、RS485总线特点的基础上,确定了接口卡的硬件和软件设计方案。在硬件设计中,为了使接口卡具有一定的智能性,同时减轻上位机系统的负担,增加可靠性,在接口卡中集成了微处理器。硬件采用PCI接口芯片、双口RAM、微处理器和CAN/RS485芯片的结构,文中描述了各部分电路原理图的设计。在软件设计中,描述了CAN控制器初始化、串口初始化、CAN报文发送与接收以及485数据发送与接收程序的详细流程图。
     本文采用WDM驱动模型开发PCI驱动程序。在掌握WDM驱动模型原理的基础上,利用DrvierStudio构建PCI驱动程序。在使用DriverStudio开发PCI驱动程序前,必须对PCI9052的配置空间进行配置,EEPROM的正确配置对驱动程序的正确开发有很大的影响,文中介绍了EEPROM的配置过程。在驱动程序的开发中,还提出了一种驱动程序数据保护的方法:自旋锁机制。通过这种机制可以避免驱动程序数据访问的冲突。最后使用VC++的MFC对驱动程序进行了动态链接库的封装,利用动态链接库提供的函数开发了上位机测试软件。
     利用实验室研制的CAN节点和485节点分别对接口卡的CAN接口和485接口的各个功能进行了验证。最终将接口卡应用到实际项目《汽车CAN模块测试系统》的开发中。本文所设计的PCI-CAN/485接口卡能够广泛地应用到各种测试系统中,具有较强的实用价值。
CAN bus and RS485 bus are two kinds of buses that have been used widely in industy. CAN bus has outstanding reliability, real-time and flexibility in the data communications. The features of RS485 bus are simple structure and long distance. They have broad application prospects in the field of industrial control. With the increasingly powerful computer performance, computer technology has been widely applied. Some industrial control processes also need the computers to monitor system, so we need an interface to implement communication of the underlying network and computer. PCI is the mainstream bus structure of the computer. It have high transmission speed and may achieve Plug and Play. This article has designed a kind of CAN, RS485 bus interface card based PCI bus.
     Based on the Analysis of PCI, CAN and RS485’Features, we determine the programs of hardware and software . In the design of hardware circuit, in order to make the interface card have some intelligence, reduce the PC’s burden and increase reliability, the circuit add the microprocessor in interface card. The hardware uses the PCI interface chip, dual-port static RAM, microprocessor and CAN/485 chip. This paper describe the various parts of the circuit schematic in detail. In software design, this article shows the detailed program flow chart of the initialization of the SJA1000 and the serial port, CAN and 485 data’s sending and receiving.
     This design uses the WDM to develop driver. Based on the study of WDM’s principle, this paper describe the structure of the PCI driver by DrvierStudio. Before developing PCI driver, we need to configure PCI9052 configuration space. EEPROM’s configuration have a great influence to driver’s development. This paper explains the EEPROM’s configuration in detail. In the driver development, this paper proposed a method of data protection: the spin-lock mechanism. By this method, the driver may avoid data access conflicts. Finally,we used MFC of VC++ to package the driver for the dynamic link library, and used the functions provided by the dynamic link library to develop the test software.
     We used the CAN nodes and 485 nodes developed by ourselves to test all the interface card’s function. Moreover, and applied the interface card to a actual project“car CAN module test system”. The PCI-CAN/485 interface card can be applied widely to various test systems, and has a strong practical value.
引文
1阳宪惠.现场总线技术及其应用.清华大学出版社. 1999:1~4
    2 Renjun Li, Chu Liu, Feng Luo. A design for automotive CAN bus monitoring system. IEEE Veh. Power Propul. Conf., VPPC. 2008:1~4
    3 M. D. Natale. Scheduling the CAN Bus With Earliest Deadline Techniques[C]. 21st IEEE Real-time Systems Symposium, Orlando, FL, USA, 2000: 259-268.
    4张常年,郭书军等.计算机通信与工业控制.化学工业出版社. 2002:131~132
    5 Fang Li, Lifang Wang, Chenglin Liao. CAN bus communication system based on matlab/simulink. Wireless Communications, Networking and Mobile Computing, WiCOM’08. 4th International. 2008:1~4
    6孙云霄,陈颖. RS485总线在数据采集系统中的应用.工矿自动化. 2006, 4:75~76
    7薛迎成,何坚强.工控机及组态控制技术.中国电力出版社. 2007: 26~28
    8吴晓.计算机工业控制技术.厦门大学出版社. 2005:1~4
    9 Yu Peng, Yanmeng Ba, Bo Li. A Design of PCI-Bus High Speed Serial Commun- ication Card. Electronic Measurement & Instruments, 2009. 9th International Conference on Digital Object Identifier. 2009: 1061 ~ 1064
    10 T. Shanley, D. Anderson. PCI System Architecture Fourth Edition. New York: Addison-Wesley Publishing Company, 2001:120~138
    11 J.P.G. Sterbenz. High Speed Network Design: A Systematic Approach to High Bandwidth Low-Latency Communication. High Performance Interconnects, 2005. Proceedings. 13th, 2005: 8~9
    12 Dongliang Zhang, Xincheng Tian, Qing Xu. Application of CAN bus technique in digital AC servo drives. The 4th International Conference on Power Electronics and Motion Control Conference, IPEMC. 2004, 2: 746– 749
    13 Liangxue Ding, Yi Shen, Yang Zhou. Real Time Performance Analysis and Evalua- tion of CAN Bus with an Extended Petri Net Model. 2009 IEEE Intrumentation and Measurement Technology Conference, 12MTC 2009. 2009: 1085~1090
    14杨江,陈拱,李海清. CAN总线的应用研究.计算机应用. 1998,(5): 33~36
    15张艳兵,赵建华等.计算机控制技术.国防工业出版社. 2008:194~196
    16 Lei Shi, Bao Long Guo. RS485/422 solution in Embedded Access Control System.Biomedical Engineering and Informatics, 2009. BMEI '09. 2nd International Conference. 2009: 1~4
    17吴晓.计算机工业控制技术.厦门大学出版社. 2005:20~21
    18 Peter Robinson, JamesPaik.Understanding hypertranport technology: A new I/O architecture arrives[J]. Computer Technology Review, 2001, 3:44~47
    19 Chame Al. PCI bus in high speed I/O systems applications. IEEE Aerospace Applications Conference Proceedings. 1998, 4:505~514
    20 C. Bruggen, H.J. Pottinger. A novel FPGA-based master/slave PCI interface core. Circuits and Systems[C]. 2000 Proceedings of the 43rd IEEE Midwest Symposium. 2000, 1: 162~163
    21 Brian Small. PCI Bus Master in a QuickLogic 8000 Gate FPGA. Wescon Conference Record. 1995:256~260
    22 PCI Special Interest Group. PCI to PCI Bridge Architecture Spesification. Re- vision 1.1. 1993:15~37
    23 Huaiming Sun, Xien Ye. Design of Video Transmission Card Based on PCI Bus Interface Technology. 2008 International Conference on Audio, Language and Image Processing, Proceedings. 2008:408~412
    24李贵山,戚德虎. PCI局部总线开发者指南.西安电子科技大学出版社. 2001:13~14
    25曾繁泰,冯保初. PCI总线与多媒体计算机.电子工业出版社. 1998:21~26
    26 Hofstee, J.W., Goense, D., Simulation of a Controller Area Network-based Ta- ctorimplement Data bus according to ISO 11783[J]. Journal of Agricultural Engineering Researeh, 1999, 73(4):383~394
    27 BOSCH. CAN Speeification Version2.0. 1991,9
    28 PLX Technology. PCI9052 DataBook. 2001
    29潘志强,李演仁. PCI9052接口电路的功能与应用.电子元器件应用. 2003, 5(12):33~35
    30 Microchip Technology. 93LC46B DataBook.1998
    31 Yanxia Liu, Shufen Li, Liting Cao.Application of dual-RAM in Numerical Control System. Proc. Services Science, Management and Engineering, 2009. SSME’09. IITA International Conference. 2009:468~471
    32李红玲,舒乃秋.双端口RAM器件IDT7005在标准源中的应用.国外电子测量技术. 2006, 25(8):23~24
    33 Integrated Device Technology. IDT High-speed 8k×8 Dual-Port Static Ram
    34赵二明,周建平等.基于双端口RAM的数控运动控制卡接口电路设计.自动化工程. 2009, 57(2):57~58
    35李正军.现场总线与工业以太网及其应用系统设计.人民邮电出版社, 2006:248~253
    36赵新秋等.工业控制网络技术.中国电力出版社, 2009:19~22
    37 Philips Semiconductors.SJA1000 Stand-alone CAN controller. 2000
    38 Philips Semiconductors. PCA82C250 High speed CAN transceiver.2001
    39张超,孟宪罩.光电耦合器6N137和6N136的使用.煤矿自动化. 101~103
    40丁恩杰,马方清.监控系统与现场总线.中国矿业大学出版社. 2003:146~147
    41潘琢金,施国君. C8051Fxxx高速SOC单片机原理及应用[M].北京航空航天大学出版社, 2002.
    42李刚,林凌.与8051兼容的高性能、高速单片机—C8051Fxxx.北京航空工业出版社, 2002: 160~161
    43夏继强,邢春香等.现场总线工业控制网络技术.北京航空航天大学出版社, 2005:128~129
    44 Chris Cant. Writing Windows WDM Device Drivers. Published by R&D/ Freem- an . 2000
    45武安河,周利丽. Windows设备驱动程序(VxD和WDM)开发实务.电子工业出版社, 2001:5~6
    46 Walter Oney. Programming the Microsoft Windows Driver Model. Microsoft Press. 2000
    47刘勇,佟为明,林景波.基于WinDriver的PCICAN接口卡Windows驱动程序开发.低压电器.2005,(9):36~40
    48 Microsoft. Microsoft Windows2000 Driver Developmet Kit Documentation. 2000
    49彭道刚,杨平等.基于DDE的分布式监控系统的设计及其应用.仪器仪表学报. 2006, 27(6): 482~483
    50田虎,杨承志.基于DDE和组态软件的控制系统仿真研究.自动化仪表. 2009, 30(2): 11~12
    51庄文祥.用DDEML实现Windows应用程序间的动态数据交换.微型机与应用. 1997, 3: 7~9

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

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

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