1、Abstract 1 - 1 - 摘要 CAN总线上的接口是网络上报文的接收和发送站一般由单片机和可编程的 CAN通信控制器组成。 本文首先较为详细地分析了控制器局域网CAN总线的发展历程及未来的发 展,论述了CAN总线的特点和通信协议,并介绍了CAN的高层协议。再次介绍了一 种新型的独立CAN通信控制器MCP2515,以及MCP2515的功能,结构和工作原理, 最后用单片机中常用的PIC16F877和MCP2515完成硬件接口电路。 由于使用了高速 SPI接口收发数据,提高了CAN报文的传输能力,同时扩大了CA接口解决方案所采 用的单片机的选择范围, 而不必强求MCU必须内含CAN总线控制模
2、块。 软件设计时, 给出了软件流程图和程序。本接口在对软件稍作修改后就可以通过SPI接口和 MCP2515交换数据。这样,不需要更换MCU就可以在现有的产品上增加CAN总线的 通信功能,从而达到了产品的快速更新。 关键词:CAN总线; MCP2515; PLC16F877 Abstract 1 - 2 - Abstract CAN Bus interface on the network is reported to receive and send text of the station. General from the CAN microcontroller and programmab
3、le communications controller. This paper is more detailed analysis of the CAN Bus course of development and the future development of the CAN bus on the characteristics and communication protocol, introduced the CAN and the high-level agreements. Once again introduced a new independent CAN communica
4、tions controller MCP2515, and the MCP2515 function, structure and working principle, commonly used in the final with the PIC16F877 MCU and MCP2515 complete hardware interface circuit. As the use of high-speed SPI interface send and receive data, to improve the text of the CAN transmission capacity, while expanding the CA interface solutions used by the MCU range of options, rather than be forced MCU embedded CAN bus control module. Software design, is a software flow chart and procedures. The