1、摘 要 PC 机 RS-232 接口转 CAN 总线转换器采用独 CAN 控制器 SJA1000 作为 CAN 总 线与 RS-232 接口转换器的核心器件。 首先介绍了 CAN 总线的发展历程和 SJA1000 器件的性能,又着重介绍了节点的硬件设计,基于 CAN 协议栈节点的应用程序设 计,软件包括 CAN 节点的初始化,RS-232 报文发送,RS-232 报文接收,CAN 报 文发送和 CAN 报文接收,并在 keilc52 上进行编译、调试,大大提高系统设计的 实用性。由于 CAN 总线具有结构简单、实时性极高、可靠性强且本身具有强大的 纠错能力,使得它在当今自动控制领域中的应用极为
2、广泛。通过相关的 CAN 转接 设备,将 CAN 与计算机相连,利用 CAN232B 转换器组建一个 CAN 控制网络,能够 很方便的实现 RS-232 多点组网、远程通讯,并且,不需要更改原有 RS-232 通讯 软件,用户可直接嵌入原有的应用领域,使系统设计达到更先进的水平。 关键词:关键词:SJA1000;CAN 总线;CAN 控制器;RS-232 接口;AT89c52 单片机 Abstract In the design of stand-alone CAN controller, SJA1000 is used as a kernel part of the CAN/RS232 in
3、tellectual convertor in hardware design. The paper firstly introduces the performance of SJA1000 and the design of node hardware, the application program based on can protocols is mainly presented. The program design includes can nodes initialization, RS-232 transmission and reception, can transmiss
4、ion and reception, the design is complied and debugged in KeilC52, and the design is greatly enhanced. Due to the can bus has a simple structure, very high, high reliability and real-time itself with powerful error correction capability, making it has wide application in toadys field of automatic co
5、ntrol. Though relevant can transfer devices will be connected to the computer can, using CAN232B converter to form a network can control, to facilitate the implementation of the RS-232 multi-point networks, remote communications, and does not need to change the original RS-232 communications softwar
6、e. Users can be directly embedded in the original application, to achieve the more advanced system design level. Key words:SJA1000;CAN bus;CAN controller;RS-232 interface;AT89S52 Single-chip Microcomputer I 目 录 第第 1 1 章章 前言前言 1 1 1.1 课题研究的背景及意义 . 1 1.2 国内外研究的现状 . 2 1.3 本文的主要内容 . 3 第第 2 2 章章 CANCAN 总线与总线与 RS232RS232 的特性的特性 4 4 2.1 CAN 总线的特点 4 2.2 CAN 总线技术介绍 6 2.3 RS232 特性 9 第第 3 3 章章 硬件电路设计硬件电路设计 1313 3.1 智能转换电路 . 13 3.2 SJA1000 与 AT89C52 接口电路设计 14 3.3 SJA1000 与驱动器连接 15 第第 4 4 章章 软件程序设计软件