节点文献

智能PCI-CAN及485接口卡的设计及其应用

Design and Application of Intelligent CAN and 485 Card Based on PCI Bus

【作者】 许沛云

【导师】 刘勇;

【作者基本信息】 哈尔滨工业大学 , 电气工程, 2010, 硕士

【摘要】 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接口卡能够广泛地应用到各种测试系统中,具有较强的实用价值。

【Abstract】 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.

【关键词】 PCI总线CANRS485PCI9052WDM驱动程序
【Key words】 PCICANRS485PCI9052WDM Driver
节点文献中: 

本文链接的文献网络图示:

本文的引文网络