资 源 简 介
本文以 C8051F120 单片机为背景,在CAN V2.0 技术规范的基础上提出了一种基于单片机的CAN 应用层协议。文中首先设计了一种数据传递格式,它解决了CAN V2.0 规范只能传递小于8 字节数据的缺点,实现了大于8 字节数据的准确传输。并在此基础上,建立了可靠的收发机制、管理机制和错误处理机制共同维护协议的运转,实现了CAN 总线数据方便快捷的传输。关键词: CAN 总线 通信协议 C8051F120Abstract:This paper proposed a CAN protocol of application layer based on CAN specification 2.0A with the background of C8051F120 microcontroller. At first, hasdesigned a data format in transfering, which can transfer data more than 8 bytesbased on CAN specification 2.0A and makes up for the shortage of CAN protocolof application layer based on the data structure, and has established the reliablereceiving and dispatching mechanism, the management mechanism and the errorprocessing mechanism and so on, which maintains the protocol work smoothly and attainsthe convenient and prompt transmission through CAN bus.Keyword: CAN;BUS; Communication Protocol; 8051F120