CAN总线协议外文翻译

上传人:痛*** 文档编号:136762571 上传时间:2022-08-17 格式:DOC 页数:10 大小:60KB
收藏 版权申诉 举报 下载
CAN总线协议外文翻译_第1页
第1页 / 共10页
CAN总线协议外文翻译_第2页
第2页 / 共10页
CAN总线协议外文翻译_第3页
第3页 / 共10页
资源描述:

《CAN总线协议外文翻译》由会员分享,可在线阅读,更多相关《CAN总线协议外文翻译(10页珍藏版)》请在装配图网上搜索。

1、CAN Bus ProtocolIntroductionController Area Network (CAN) was initially created by German automotive system supplier Robert Bosch in the mid-1980s for automotive applications as a method for enabling robust serial communication. The goal was to make automobiles more reliable, safe and fuel-efficient

2、 while decreasing wiring harness weight and complexity. Since its inception, the CAN protocol has gained widespread popularity in industrial automation and automotive/truck applications. Other markets where networked solutions can bring attractive benefits like medical equipment, test equipment and

3、mobile machines are also starting to utilize the benefits of CAN. The goal of this application note is to explain some of the basics of CAN and show the benefits of choosing CAN for embedded systems networked applications.CAN OverviewMost network applications follow a layered approach to system impl

4、ementation. This system etic approach enables sinter operability between products from different manufacturers. A standard was created by the International Standards Organization (ISO) as a template to follow for this layered approach. It is called the ISO Open Systems Interconnection (OSI) Network

5、Layering Reference Model. The CAN protocol itself implements most of the lower two layers of this reference model. The communication medium portion of the model was purposely left out of the Bosch CAN specification to enable system designers to adapt and optimize the communication protocol on multip

6、le media for maximum flexibility (twisted pair, single wire, optically isolated, RF, IR, etc.). With this flexibility, however, comes the possibility of interoperability concerns. To ease some of these concerns, the International Standards Organization and Society of Automotive Engineers (SAE) have

7、defined some protocols based on CAN that include the Media Dependents Interface definition such that all of the lower two layers are specified.ISO11898 is a standard for high-speed applications, ISO11519 is a standard for low-speed applications, and J1939 (from SAE) is targeted for truck and bus app

8、lications. All three of these protocols specify a 5V differential electrical bus as the physical interface. The rest of the layers of the ISO/OSI protocol stack are left to be implemented by the system software developer. Higher Layer Protocols (HLPs) are generally used to implement the upper five l

9、ayers of the OSI Reference Model.HLPs are used to:1) Standardize startup procedures including bit rates used,2) Distribute addresses among participating nodes or types of messages,3) Determine the structure of the messages, and4) Provide system-level error handling routines. This is by no means a fu

10、ll list of the functions HLPs perform; however it does describe some of their basic functionality.CAN Protocol BasicsCarrier Sense Multiple Access with Collision Detection (CSMA/CD)The CAN communication protocol is a CSMA/CD protocol. The CSMA stands for Carrier Sense Multiple Access. What this mean

11、s is that every node on the network must monitor the bus for a period of no activity before trying to send a message on the bus (Carrier Sense). Also, once this period of no activity occurs, every node on the bus has an equal opportunity to transmit a message (Multiple Access). The CD stands for Col

12、lision Detection. If two nodes on the network start transmitting at the same time, the nodes will detect the collision and take the appropriate action. In CAN protocol, a nondestructive bitwise arbitration method is utilized. This means that messages remain intact after arbitration is completed even

13、 if collisions are detected. All of this arbitration takes place without corruption or delay of the higher priority message.There are a couple of things that are required to support non-destructive bitwise arbitration. First, logic states need to be defined as dominant or recessive. Second, the tran

14、smitting node must monitor the state of the bus to see if the logic state it is trying to send actually appears on the bus. CAN define a logic bit 0 as a dominant bit and a logic bit 1 as a recessive bit.A dominant bit state will always win arbitration over a recessive bit state, therefore the lower

15、 the value in the Message Identifier (the field used in the message arbitration process), the higher the priority of the message. As an example, suppose two nodes are trying to transmit a message at the same time. Each node will monitor the bus to make sure the bit that it is trying to send actually

16、 appears on the bus. The lower priority message will at some point try to send a recessive bit and the monitored state on the bus will be a dominant. At that point this node loses arbitration and immediately stops transmitting. The higher priority message will continue until completion and the node

17、that lost arbitration will wait for the next period of no activity on the bus and try to transmit its message again.Message-Based CommunicationCAN protocol is a message-based protocol, not an address based protocol. This means that messages are not transmitted from one node to another node based on

18、addresses. Embedded in the CAN message itself is the priority and the contents of the data being transmitted. All nodes in the system receive every message transmitted on the bus (and will acknowledge if the message was properly received). It is up to each node in the system to decide whether the me

19、ssage received should be immediately discarded or kept to be processed. A single message can be destined for one particular node to receive, or many nodes based on the way the network and system are designed. For example, an automotive airbag sensor can be connected via CAN to a safety system router

20、 node only. This router node takes in other safety system information and routes it to all other nodes on the safety system network. Then all the other nodes on the safety system network can receive the latest airbag sensor information from the router at the same time, acknowledge if the message was

21、 received properly, and decide whether to utilize this information or discard it.Another useful feature built into the CAN protocol is the ability for a node to request information from other nodes. This is called a Remote Transmit Request(RTR). This is different from the example in the previous par

22、agraph because instead of waiting for information to be sent by a particular node, this node specifically requests data to be sent to it.One additional benefit of this message-based protocol is that additional nodes can be added to the system without the necessity to reprogram all other nodes to rec

23、ognize this addition. This new node will start receiving messages from the network and, based on the message ID, decide whether to process or discard the received information.CAN Message Frame DescriptionCAN protocol define four different types of messages (or Frames). The first and most common type

24、 of frame is a Data Frame. This is used when a node transmits information to any or all other nodes in the system. Second is a Remote Frame, which is basically a Data Frame with the RTR bit set to signify it is a Remote Transmit Request. The other two frame types are for handling errors. One is call

25、ed an Error Frame and one is called an Overload Frame. Error Frames are generated by nodes that detect any one of the many protocol errors defined by CAN. Overload errors are generated by nodes that require more time to process messages already received.Data Frames consist of fields that provide add

26、itional information about the message as defined by the CAN specification. Embedded in the Data Frames are Arbitration Fields, Control Fields, Data Fields, CRC Fields, a 2-bit Acknowledge Field and an End of Frame.The Arbitration Field is used to prioritize messages on the bus. Since the CAN protoco

27、l defines a logical 0 as the dominant state, the lower the number in the arbitration field, the higher priority the message has on the bus. The arbitration field consists of 12-bits (11 identifier bits and one RTR bit) or 32-bits (29 identifier bits, 1-bit to define the message as an extended data f

28、rame, an SRR bit which isunused, and an RTR bit), depending on whether Standard Frames or Extended Frames are being utilized. The current version of the CAN specification, version 2.0B,defines 29-bit identifiers and calls them Extended Frames. Previous versions of the CAN specification defined 11-bi

29、tidentifiers which are called Standard Frames.As described in the preceding section, the Remote Transmit Request (RTR) is used by a node when it requires information to be sent to it from another node. To accomplish an RTR, a Remote Frame is sent with the identifier of the required Data Frame. The R

30、TR bit in the Arbitration Field is utilized to differentiate between a Remote Frame and a Data Frame. If the RTR bit is recessive, then the message is a Remote Frame. If the RTR bit is dominant, the message is a Data Frame. The Control Field consists of six bits. The MSB is the IDE bit (signifies Ex

31、tended Frame) which should be dominant for Standard Data Frames. This bit determines if the message is a Standard or Extended Frame. In Extended Frames, this bit is RB1 and it is reserved.The next bit is RB0 and it is also reserved. The four LSBs are the Data Length Code (DLC) bits. The Data Length

32、Code bits determine how many data bytes are included in the message. It should be noted that a Remote Frame has no data field, regardless of the value of the DLC bits. The Data Field consists of the number of data bytes described in the Data Length Code of the Control Field. The CRC Field consists o

33、f a 15-bit CRC field and a CRC delimiter, and is used by receiving nodes to determine if transmission errors have occurred.The Acknowledge Field is utilized to indicate if the message was received correctly. Any node that has correctly received the message, regardless of whether the node processes o

34、r discards the data, puts a dominant bit on the bus in the ACK Slot bit time The last two message types are Error Frames and Overload Frames. When a node detects one of the many types of errors defined by the CAN protocol, an Error Frame occurs. Overload Frames tell the network that the node sending

35、 the Overload Frame is not ready to receive additional messages at this time, or that intermission has been violated. These errors will be discussed in more detail in the next section.Fast, Robust CommunicationBecause CAN was initially designed for use in auto mobiles, a protocol that efficiently ha

36、ndled errors was critical if it was to gain market acceptance. With the release of version 2.0B of the CAN specification, the maximum communication rate was increased 8x over the version 1.0 specification to 1Mbit/sec. At this rate, even the most time-critical parameters can be transmitted serially

37、without latency concerns. In addition to this, the CAN protocol has a comprehensive list of errors it can detect that ensures the integrity of messages.CAN nodes have the ability to determine fault conditions and transition to different modes based on the severity of problems being encountered. They

38、 also have the ability to detect short disturbances from permanent failures and modify their functionality accordingly. CAN nodes can transition from functioning like a normal node (being able to transmit and receive messages normally), to shutting down completely (bus-off) based on the severity of

39、the errors detected. This feature is called Fault Confinement. No faulty CAN node or nodes will be able to monopolize all of the bandwidth on the network because faults will be confined to the faulty nodes and these faulty nodes will shut off before bringing the network down. This is very powerful b

40、ecause Fault Confinement guarantees bandwidth for critical system information.ConclusionThe CAN protocol was optimized for systems that need to transmit and receive relatively small amounts of information (as compared to Ethernet or USB, which are designed to move much larger blocks of data) reliabl

41、y to any or all other nodes on the network. CSMA/CD allows every node to have an equal chance to gain access to the bus, and allows for smooth handling of collisions. Since the protocol is message-based, not address based, all messages on the bus receive every message and acknowledge every message,

42、regardless of whether in needs the data or not. This allows the bus to operate in node-to-node or multicast messaging formats without having to send different types of messages.Fast, robust message transmission with fault confinement is also a big plus for CAN because faulty nodes will automatically

43、 drop off the bus not allowing any one node from bringing a network down. This effectively guarantees that bandwidth will always be available for critical messages to be transmitted. With all of these benefits built into the CAN protocol and its momentum in the automotive world, other markets will b

44、egin to see and implement CAN into their systems.CAN 总线协议简介控制器区域网络(CAN)的最初创建者是80年代中期的德国汽车系统供应商罗伯特博世,作为汽车应用启用强大的串行通信的方法。其目标是让汽车更可靠,安全,省油同时减少线束的重量和复杂性。公司自成立以来,已取得了CAN协议广泛普及和其在工业自动化汽车/卡车方面的应用。该总线在其他市场网络解决方案一样能够带来强有力的利润,例如医疗设备,测试设备和移动机器也开始利用CAN总线的优势。本文的目的是解释一些CAN的基本知识,和选择CAN通信作为嵌入式系统网络应用的好处。CAN总线概述大多数网络

45、应用程序遵循分层方法实施。这一系统的方法使不同产品之间的制造商共同创建一个标准的国际标准化组织(ISO)的为模板遵循这种分层方法。这就是所谓的国际标准组织开放系统互连(OSI)网络分层参考模型。CAN协议本身实现了较低的最基本参考模型层的通信模型中的一部分,是故意忽略CAN规范,使系统设计调整和优化的通信协议最大程度的灵活性(双绞线多种媒体,单丝,光隔离,射频,红外线等)。有了这个灵活性,但是,随之而来的互操作的可能性成为关注。为了缓解这些问题一些国际标准组织与国际汽车工程师学会(SAE)在原来的基础上定义了一些在CAN协议基础上的定义,这包括在指定两个底层媒体独立接口的定义。ISO11898

46、是一个用于高速应用的标准,ISO11519是一个低速应用标准,J1939的(从SAE)对象是卡车和总线的应用。所有这些协议的物理接口指定为一个5V的差分电气总线。其余剩下ISO / OSI协议栈层由系统软件开发商来实现,更高一层的协议(HLPs)一般用来实现上面五层的OSI参考模型。HLPs用于:1)规范程序,包括比特率启动使用时,2)参与节点之间分配地址消息或类型,3)确定的消息结构,4)提供系统级的错误处理例程。这绝不是一个执行的职能HLPs完整列表,但它确实描述了他们的基本的一些功能。CAN总线协议基础载波侦听多路访问冲突检测(CSMA / CD)CAN通讯协议是CSMA / CD协议,

47、CSMA代表载波侦听多路访问。这意味着,每一个网络节点在尝试往总线上发送一个消息期间,必须监测总线并保证总线处于不活动状态(载波监听);另外,当总线处于空闲状态,总线上的每一个节点传输消息的机会是平等的(多址接入)。CD代表冲突检测。如果两个网络上的节点在同一时间开始发送数据,节点将检测到冲突并采取适当的行动。在CAN协议中,利用无损逐位仲裁的方法。这也就是说,即使完成冲突检测,仲裁后消息仍然保持完整,所有这一切仲裁均无损坏或延误的最高优先级的消息。无损逐位仲裁的实现需要两个条件。第一,逻辑状态必须定义为显性或隐性。第二,发送节点必须监视总线状态,以此观察正在试图发送到总线上的实际逻辑状态。C

48、AN总线定义为一个逻辑显性位0和逻辑隐性位1。一个显性位的状态总能仲裁隐性位的状态,因此,较低的消息标识符值(消息中的仲裁过程中使用的字段),消息的优先级越高。例如,假设两个节点试图在同一时间发送消息。每个节点会监察总线,以保证它正试图发送的位确确实实出现在总线上。较低的优先级的消息将在某个点尝试发送一个隐性位,并监视总线状态使自己成为主节点。此时,这个节点失去仲裁,并立即停止发送。更高的优先级消息将持续发送直到完成,失去仲裁的节点将等待总线的下一个空闲周期,并尝试发送数据。基于消息的通信CAN协议是一个基于消息的协议,而不是一个基于地址的协议,这意味着消息不能从一个节点地址传送到另一个节点地

49、址上。嵌入式CAN消息本身就是优先和正在传输数据的内容。所有系统中的节点将接收每个传递在总线上的消息(如果消息正确接收并确认)。它是由系统的每个节点决定是否将接收到的数据立即丢弃还是保存处理。一个单一的消息可以设计成指定接受一个特定的节点,或许多建立在网络和系统上的节点。例如,汽车安全气囊传感器只能通过CAN连接到安全系统的路由器节点,此路由器节点接收其他系统安全信息并转发到安全系统网络的其他节点上。安全系统网络上的所有其他节点可以在同一时间从路由器上收到最新的安全气囊传感器的信息,确认是否被正确接收后,决定是否利用这些信息,或遗弃它。另外一个内置在CAN协议中的有用的特性是,可以要求一个节点

50、向另一个节点发送消息,这就是所谓的远程发送请求(RTR)。这个与前面的例子不同,因为,此时节点在等待一个特定的节点的消息,这个特定节点发出的消息是被动的。这种基于消息的协议的一个额外的好处是,可以添加额外的节点,系统没有必要对所有其他节点进行重新编程,也可以识别这个节点。这个新的节点将开始接收来自网络的消息,根据消息ID,决定是否要处理或丢弃收到的信息。CAN消息帧描述CAN协议定义了四种不同类型的信息(或帧)。第一个也是最常见的类型是数据帧,这是用来当一个节点发送信息系统中的任何或所有其他节点;二是远程帧,这基本上是一个用来设置表示,它是一个远程发送请求RTR位的数据帧。其他两个错误处理的帧

51、,一个为错误帧和一个为过载帧。检测出CAN协议定义的错误都将产生错误帧,产生超载错误的节点,需要更多的时间来处理已经接收的数据。数据帧中包括的有关数据信息的额外字段由CAN定义规范,数据帧中嵌入仲裁场,控制场,数据区,CRC场,一个2位的应答场和一个帧结束。待添加的隐藏文字内容1仲裁字段用于总线消息的优先,由于CAN协议定义为逻辑0为显性状态,在仲裁场的数字越低,在总线上的消息优先级更高。该仲裁场由仲裁场由12位(11位标识符和RTR位)或32位(29个标识符位,1位扩展数据帧定义位,未使用的SRR位,RTR位),这取决于是否用到标准帧或扩展帧。当前版本的CAN规范2.0B版,定义了29位的标

52、识符,并称其为扩展帧。之前的CAN规范版本中定义的11位标识符就是所谓的标准帧标识符。正如上一节中所述,远程发送请求(RTR)用于一个节点时,要求信息发送给它从另一个节点。为了完成一个远程请求,远程帧发送与标识符相同的数据帧。RTR位仲裁字段是用来区分远程帧和数据帧,如果RTR位隐性的,则该消息是一个远程帧,如果RTR位是显性的,该消息是一个数据帧。控制场由6位组成, MSB是IDE位(象征扩展帧)大多数情况下为标准数据帧,该位决定如果消息是标准帧还是扩展帧。在扩展帧中,RB0和RB1位被保留。最低四位有效位是数据长度码(DLC)位,数据长度码位决定在消息中包含多少字节数据。应当指出,远程帧没

53、有数据领域,无论DLC位为多少。数据区就是在控制场中描述的数据长度码的字节数量的数据。CRC场包含一个15位的CRC字段和一个CRC定界符,用于接收节点时确定是否发生传输错误。应答场是用来表示如果消息被正确接收。任何节点已正确收到的消息,不论节点处理或丢弃的数据,都会在帧间间隔发送一个显性位到总线上。最后两个消息类型,错误帧和过载帧。当一个节点检测到一个由CAN协议定义的错误时,会产生一个错误帧。过载帧告诉网络该节点发送数据过载,该节点并没有准备好在这个时候接收更多的数据,或在帧间间隔检测到非法显性位。快速,可靠的通信因为CAN协议最初设计用于汽车的使用,如果它要得到市场的认可,关键是有效地处

54、理错误。随着发布2.0B版的CAN规范,相对1.0版本规范,最高通信速率增加8倍以上达到1Mbit/sec。按照这一速度,大多数关键时间参数也可以连续无延时地传输。除了这个,CAN协议的有一个全面的错误检测列表,以确保消息的完整性。CAN节点有能力根据故障状况和所遇到的问题的严重性过渡到不同的模式。他们还有能力在检测永久中检测到短期扰动,从而相应地修改它们的功能。CAN节点通能够从像一个正常运作的节点(即能够发送和接收消息),也能根据检测到的错误的严重性过渡到完全关闭的状态(总线关闭),此功能被称为故障隔离。无故障节点将占用所有的带宽,因为网络将限制故障节点,并在网络瘫痪之前关闭故障节点和。这

55、是非常强大,因为故障界定保证系统关键信息的带宽。结论CAN协议对系统进行了优化,依靠任意网络上的节点,发送和接收信息量相对较少(与之相比,以太网或USB接口,其宗旨在移动更大的数据块)。CSMA/CD的通信方式允许每个节点有平等的获得访问总线的机会,并可以顺利处理冲突。由于协议是基于消息的,而不是基于地址的,无论是在需要数据与否,总线上的所有信息将被接收并确认。这使得总线节点到节点间或组播消息格式的操作,无需发送不同类型的信息。快速,可靠的信息传输故障界定也是一大优点,因为故障节点会自动脱离总线连接,CAN总线不允许任何节点的故障导致总线瘫痪。这有效地保证带宽始终可进行关键信息的传输。CAN协议的所有这些优势以及其在汽车行业的良好趋势,其他市场将开始看到这些优点及利益,并落实到他们的系统中。

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!