CAN 总线通信讨论与软件设计摘 要现场总线,又称现场网络,是一种工业数据通信总线。在当今时代,现场总线的进展速度非常之快,它的出现为工业的进展提供了非常好的技术保障,为分布式控制系统中的各个节点之间的数据通信提供了非常好的技术保障。CAN 总线是一种半双工通信的串行通信网络,属于现场总线的一种,它的数据通信功能强大,能够有效的支持分布式控制或实时控制系统。相比与其它现场总线,CAN 总线具有通信快、效率高、易实现、可靠性高等优势,现在已经在很多领域中都得到了应用。本文主要讨论 CAN 总线通信技术的原理及其技术特点,讨论了 CAN 通信的具体流程,包括初始化流程以及发送接收数据流程。运用 C 语言编写相关单片机程序以及CAN 的通信程序实现通信。本次软件设计是在 keil4 开发环境下进行的,主要编写了串口程序,SPI 接口程序以及 CAN 的初始化、发送和接收数据程序,并与相关硬件设计结合,实现两个 CAN节点之间的相互的数据通信。关键词:现场总线;CAN 总线;软件设计;通信CAN bus communication research and software designAbstractField bus, also called the network, is a kind of industrial data communication bus. In today's era, the development of field bus speed is very fast, it provides a very good technical support for the development of industry, for data communication between each node in distributed control system provides a very good technical support. CAN bus is a half-duplex communication serial communication network, belongs to a kind of fieldbus, it has powerful data communication function, CAN effectively support distributed control or real-time control system. Compared with other field bus, CAN bus communication is fast, high efficiency, easy realize and high reliability advantages, now has been applied in many fields.In this paper, the principle of the CAN bus communication technology and its technical characteristics, research the CAN communication process, including the initialization process and the process to send and receive data....