CAN 总线协议外文翻译.doc

上传人:文库蛋蛋多 文档编号:2324596 上传时间:2023-02-11 格式:DOC 页数:10 大小:60KB
返回 下载 相关 举报
CAN 总线协议外文翻译.doc_第1页
第1页 / 共10页
CAN 总线协议外文翻译.doc_第2页
第2页 / 共10页
CAN 总线协议外文翻译.doc_第3页
第3页 / 共10页
CAN 总线协议外文翻译.doc_第4页
第4页 / 共10页
CAN 总线协议外文翻译.doc_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《CAN 总线协议外文翻译.doc》由会员分享,可在线阅读,更多相关《CAN 总线协议外文翻译.doc(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协议中的有用的特性是,可以要求一个节点向另一个节点发送消息,这就是所谓的远程发送请求(RTR)。这个与前面的例子不同,因为,此时节点在等待一个特定的节点的消息,这个特定节点发出的消息是被动的。这种基于消息的协议的一个额外的好处是,可以添加额外的节点,系统没有必要对所有其他节点进行重新编程,也可以识别这个节点。这个新的节点将开始接收来自网络的消息,根据消息ID,决定是否要处理或丢弃收到的信息。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号