1、 i Can 总线通信研究与硬件设计 摘 要 CAN 总线是控制器局域网总线(Controller Area Network)的简称。属于现场总线 的范畴,是一种有效支持分布式控制或实时控制的串行通信网络。CAN 总线是一种多主 方式的串行通讯总线, 是国际上应用最广泛的现场总线之一, 现已被应用到各个自动化 控制系统中,从高速的网络到低价位的多路接线都可以使用 CAN 总线。CAN 总线是一种 全双工通信的串行通信网络,属于现场总线的一种,它的数据通信功能强大,能够有效 的支持分布式控制或实时控制系统。相比与其它现场总线,CAN 总线具有通信快、效率 高、易实现、可靠性高等优势,现在已经在很
2、多领域中都得到了应用。本文重点就基于 单片机的 CAN 总线通信设计的实现进行介绍,通过 CAN 控制器以及 CAN 收发器把串口发 送来的数据转换成 CAN 通信的数据,然后又把数据转换成串口通信数据回发给计算机, 实现数据的自发自收。 关键词 CAN 总线;通信;现场总线 ii CAN bus communication research and hardware design Abstract CAN bus is the Controller LAN bus (Controller Area Network). Belongs to the category of the fieldb
3、us, and is an effective support distributed control or real-time control of serial communication network. CAN bus is a main way of serial communication bus, is one of the most widely used field bus in the world, has now been applied to various automation control system, from the network to the low p
4、rice of multiplex wiring CAN bus CAN be used. CAN bus is a full-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 b
5、us communication is fast, high efficiency, easy realize and high reliability advantages, now has been applied in many fields. This paper is based on single chip microcomputer, introduces the implementation of the CAN bus communication design through the CAN controller and CAN transceiver to a serial
6、 port to send data into the CAN communication data, and then send data into the serial communications data back to the computer, realizing data of spontaneous. Key words CAN bus ; Communication ; The fieldbus ii 目 录 摘 要 i AbstractAbstract . ii 第一章 绪 论 . 1 一、 课题背景 1 二、 选题目的 1 三、 选题意义 1 第二章 单片机简介 1 一、 单片机最小系统 1 (一) 晶体振荡器电路 . 3 (二) 复位电路 . 4 (三) Max232 接口电路 5 第三章 CAN 总线介绍 8 一、 CAN 总线基本概念 . 8 二、 CAN 总线的发展概况 . 9 三、 CAN 总线协议 11 第四章 硬件设计原理及方案 . 14 一、 硬件设计原理 . 14 (一) 、 微控制器 STC89C52RC 简介 14 (二) 、 单片机最小