文档介绍:唐山学院
毕业设计
设计题目:基于CAN总线节点通信的设计与实现
系别: 计算机科学与技术系
班级: 06计本1班
姓名:
指导教师:
2012年6月* 日
基于CAN总线节点通信的设计与实现
摘要
本设计是基于CAN总线节点的网络通信。设计的硬件用到了ARM处理器,CAN总线模块(主要有控制器MCPC2510,收发器82C250等),PC机,虚拟机。
设计实现了用ARM处理器通过SPI串口总线[1]将信息发送各给CAN总线,利用芯片MCP2510作为控制器控制收发器采集CAN总线上的信息,然后通过设置好的CAN总线模块的自回环模式实现将采集到的信息自收自发。ARM处理器会通过TCP协议,
CAN总线是一种新兴的现场总线[2],短短时间内就成为了国际上应用最广泛的现场总线之一,其成本低,能耗小,稳定性高,抗干扰强,传输速度快,传输距离远。被广大的技术人员所喜爱。CAN总线开始只是应用于汽车行业,后来由于其众多的优点被逐渐拓展到各个领域,广为人们认知和应用。
TCP同UDP协议一样属于运输层协议。不同的是它是基于字节流的,是一种面向连接的,可靠的通信协议。TCP协议通过三个报文段完成连接的建立,这个过程称为三次握手。TCP用一个校验和函数来检验数据是否有错误;在发送和接收时都要计算和校验。本设计采用了TCP协议就是因为它的可靠性。
套接字(Socket)是为了在多个TCP连接或多个应用程序进程需要通过同一个 TCP协议端口传输数据时,为了区别不同的应用程序进程和连接,许多计算机操作系统为应用程序与TCP/IP协议交互提供的接口。
关键词:CAN总线,MCP2510,TCP协议,虚拟机。
Based on the CAN munication design and Implementation
Abstract
The design is based on CAN munication. Design of the hardware used in the ARM processor, CAN bus module ( the main controller MCPC2510, transceiver82C250, PC machine, a virtual machine ).
Design and implementation of a ARM processor through the SPI serial bus to send information to the CAN bus, using chip MCP2510 as the controller controls the transceiver to collect the information of the CAN bus, and then through the set of CAN bus module self loopback mode to achieve the information collected since the resumption of spontaneous. The ARM processor via the TCP protocol,
CAN bus is a new kind of field bus, a short time has e the international most widely used one of the field bus, its low cost, low energy consumption, high stability, strong interference resistance, high transmission speed, the transmission distance. The vast majority of technical staff favorite. CAN bus is used in the automotive industry, and later because of its numerous advantages are gradually extended to various fields widely, cognition and application.
TCP and UDP protocol as a transport layer protocol. Different is that it is based on a stream of bytes, is a connection-oriented, munication protocol. The TCP protocol