{$cfg_webname}
主页 > 电子信息 > 单片机 >

基于51单片机的RS-232串口转CAN总线模块设计(附电路原理图,程序代码)

来源:wenku163.com  资料编号:WK16314115 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK16314115
资料介绍

基于51单片机的RS-232串口转CAN总线模块设计(附电路原理图,程序代码)(任务书,开题报告,论文13000字,程序代码,总电路图)
摘 要
串行通信技术发展的漫长历程中,出现了RS-232串口具有低成本,工程工程使用线路较少的优点,在生产领域得到广泛使用。然而通信技术不断取得发展,对传输可靠性的要求变高,出现的CAN总线具备的高性能和高可靠性,具有非常好的发展前途。
本次设计是以51单片机为开发平台,以C语言为开发语言,开发一个基于51单片机的RS-232串口转CAN总线模块,能实现将串口标准变换成CAN接口标准并进行通信等功能。设计历程中采用模块化设计,其中硬件部分分为RS-232模块、CAN总线模块、核心控制模块,从单一模块开始设计,最终各个模块连接在一起完成硬件电路设计。软件设计历程中也分为主程序模块,RS-232通信模块,CAN总线通信模块以及故障监听模块。最后将软件程序写入硬件完成协议转换器设计。通过完成串口转CAN总线,将极大的上方便了CAN总线在实际生活的使用,为人们的生活带来便捷。
关键字: RS-232串口;CAN总线;模块化设计;51单片机
 
Abstract
In the long process of the development of serial communication technology, the rs-232 serial ports have the advantages of low cost andless circuit and have been widely used in the field of production. While communication technology have made continuous progress, transmission requires high reliability, high performance. reliability of the CAN bus has made it one of the most widely used field bus in the world and has a very high development future.
This design is based on 51 single chip microcomputer as the development platform, C for the development of language, develop a RS - 232 serial port based on 51 single chip microcomputer to CAN bus module, CAN make serial protocol conversion into CAN bus protocol and communications and also have other functions. In the design process adopts the modular design, including the hardware part is divided into RS - 232 module, CAN bus module, the core control module, starting from a single module design, final modules together complete the hardware circuit design. The software design process also consists of the main program module, the rs-232 communication module, the CAN bus communication module and the failure listening module. Finally, the software program is written to the hardware completion protocol converter design .By completing the serial port of CAN bus, it will greatly facilitate the use of the CAN bus in real life and bring convenience to people's life.
Keywords: RS-232 serial port;CAN bus; modular design;51 singlechip

设计内容及组织结构
    本次设计是以51单片机为开发平台,以C语言为开发语言,开发一个基于51单片机的RS-232串口转CAN总线模块。采用了51单片机为内核,RS-232模块使用了MAX708S电平转换芯片,CAN总线模块使用的是SJA1000芯片作为控制模块,收发器使用的是PCA82C250芯片,而电源模块将220V交流市电变为5V直流电压。先使用变压器变为低电压,再通过桥式整流电路进行整流,和滤波电容进行滤波过程,最后选用稳压芯片得到5V直流输出电压,满足芯片供电需求。软件部分分为几个模块进行运作,它们是:设计主程序模块,RS-232接口通信模块,CAN总线通信模块以及保障通信可靠性的故障监听模块[6]。
本论文分先从设计目地和意义开始介绍,通过对比RS-232串口和CAN总线的优缺点以及发展历程,分析它们的发展前景,明确本次设计硬件转换器的宗旨,其次分别介绍了RS-232总线的电气特性和CAN总线的协议标准,并将本次设计使用的软件Protues和keil软件进行简要介绍。并进行设计拓展,增加了RS-484总线的协议介绍,丰富了接口转换器的功能,极大增加了转换器的实用意义。然后,分为硬件设计方案和软件设计方案介绍了设计历程中的具体实现方案,最后总结本次设计历程中遇到的种种问题,为以后的学习生活提供必备经验。
 

基于51单片机的RS-232串口转CAN总线模块设计(附电路原理图,程序代码)
基于51单片机的RS-232串口转CAN总线模块设计(附电路原理图,程序代码)



目 录
第1章 绪论    1
1.1研究目的和意义    1
1.2国内外研究现状    1
1.3设计内容及组织结构    2
第2章 协议简介    4
2.1 RS-232协议简介    4
2.1.1发展历史和作用    4
2.1.2接口和协议标准    5
2.2 CAN协议简介    6
2.2.1 CAN性能特点    6
2.2.2 CAN分层结构    7
2.3 RS-485协议简介    10
第3章 协议转换器的硬件设计方案    11
3.1协议转换器的硬件框图    11
3.2 控制处理器模块设计    12
3.3 RS-232接口模块设计    13
3.4 CAN总线模块设计    14
3.4.1 CAN总线控制器SJA1000    14
3.4.2 CAN收发器PCA82C250电路设计    16
3.5 RS-485接口扩展设计    18
第4章 协议转换器的软件设计    19
4.1软件组成及架构    19
4.2主程序模块    19
4.3 CAN总线通信模块    22
4.4 RS232总线通信模块    24
第5章 总结和展望    25
5.1论文工作总结    25
5.2研究工作展望    25
参考文献    26
致 谢    27

推荐资料