CAN Specification 2.0 PART B (1) -- CAN message 定义

目录

CAN message 定义

1. DATA FRAME 数据帧

1.1 START OF FRAME(SOF)  帧起始

1.2 ARBITRATION FIELD 仲裁场

1.2.1 IDENTIFIER Field

1.2.2 RTR(Remote Transmission Request)

1.2.3 SRR(Substitute Remote Request)

1.2.4 IDE(Identifier Extension Bit)

1.2.5 小结

1.3 CONTROL FIELD 控制场

1.4 DATA FIELD 数据场

1.5 CRC FIELD 校验场

1.6 ACK FIELD 应答场

1.7 END OF FRAME 帧结尾

2. ERROR FRAME 错误帧

3. INTERFRAME SPACING 帧间空间

4. OVERLOAD FRAME 过载帧

5. REMOTE FRAME 远程帧(忽略)

6. CAN总线上一帧数据的传输时间


记录 BOSCH CAN Specification 2.0 PART B CAN 协议标准学习过程,以备需要时查看;

BOSCH CAN Specification 2.0 文档获取:

http://esd.cs.ucr.edu/webres/can20.pdf

CAN message 定义

1. DATA FRAME 数据帧

DATA FRAME 由 Start of Frame, Arbitration Field, Control Field, Data Field, CRC Field, ACK Field, End of Frame 这几个位域组成;

1.1 START OF FRAME(SOF)  帧起始

由一个显性位组成(可以理解为MCU CAN TX pin上的低电平);一个CAN网络上的所有节点根据SOF边沿来实现同步;

1.2 ARBITRATION FIELD 仲裁场

总线仲裁的概念

相当于总线上有多个节点在同一时刻控制总线,经过仲裁后,优先级高的节点会实际控制总线;

总线仲裁实现机制

总线上显性电平(可以理解为MCU CAN TX pin上的低电平)比隐性电平具有更高的优先级(可以理解为MCU CAN TX pin上的高电平);

Node 1 输出 Node 2 输出 实际总线状态
d(显性)(逻辑0) d(显性)(逻辑0) d(显性)(逻辑0)
d(显性)(逻辑0) r(隐性)(逻辑1) d(显性)(逻辑0)
r(隐性)(逻辑1) d(显性)(逻辑0) d(显性)(逻辑0)
r(隐性)(逻辑1) r(隐性)(逻辑1) r(隐性)(逻辑1)

总线上的每个节点在同一时刻都按照自己的想法拉高或拉低总线,但实际总线的电平状态,类似于线与的效果;CAN总线上的电信号状态,在经过CAN transceiver 后,由一对差分信号CANH/CANL 来表示,CANH/CANL 间存在压差表示为显性,CANH/CANL间无压差表示为隐性;

仲裁场的格式

对于标准帧(Standard Frame)和扩展帧(Extended Frame), 仲裁场的格式不同

标准帧(Standard Frame)的数据帧格式

扩展帧(Extended Frame)的数据帧格式

对于标准帧,仲裁场由11 bit 的ID 域和 1 bit RTR 控制位组成;

对于扩展帧,其仲裁场相比于标准帧,ID 在标准帧11 bit 的基础上增加了18 bit,扩展到 29 bit;另外多了两个控制位SRR 和IDE;

1.2.1 IDENTIFIER Field

ID 域可以理解为每个数据帧的独有的名字;

在标准帧中,

The Controller Area Network (CAN) is a serial communications protocol which efficiently supports distributed realtime control with a very high level of security. Its domain of application ranges from high speed networks to low cost multiplex wiring. In automotive electronics, engine control units, sensors, anti-skid-systems, etc. are connected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective to build into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replace the wiring harness otherwise required. The intention of this specification is to achieve compatibility between any two CAN implementations. Compatibility, however, has different aspects regarding e.g. electrical features and the interpretation of data to be transferred. To achieve design transparency and implementation flexibility CAN has been subdivided into different layers. • the (CAN-) object layer • the (CAN-) transfer layer • the physical layer The object layer and the transfer layer comprise all services and functions of the data link layer defined by the ISO/OSI model. The scope of the object layer includes • finding which messages are to be transmitted • deciding which messages received by the transfer layer are actually to be used, • providing an interface to the application layer related hardware. There is much freedom in defining object handling. The scope of the transfer layer mainly is the transfer protocol, i.e. controlling the framing, performing arbitration, error checking, error signalling and fault confinement. Within the transfer layer it is decided whether the bus is free for starting a new transmission or whether a reception is just starting. Also some general features of the bit timing are regarded as part of the transfer layer. It is in the nature of the transfer layer that there is no freedom for modifications. The scope of the physical layer is the actual transfer of the bits between the different nodes with respect to all electrical properties. Within one network the physical layer, of course, has to be the same for all nodes. There may be, however, much freedom in selecting a physical layer. The scope of this specification is to define the transfer layer and the consequences of the CAN protocol on the surrounding layers.
The Controller Area Network (CAN) is a serial communications protocol which efficiently supports distributed realtime control with a very high level of security. Its domain of application ranges from high speed networks to low cost multiplex wiring. In automotive electronics, engine control units, sensors, anti-skid-systems, etc. are connected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective to build into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replace the wiring harness otherwise required. The intention of this specification is to achieve compatibility between any two CAN implementations. Compatibility, however, has different aspects regarding e.g. electrical features and the interpretation of data to be transferred. To achieve design transparency and implementation flexibility CAN has been subdivided into different layers. • the (CAN-) object layer • the (CAN-) transfer layer • the physical layer The object layer and the transfer layer comprise all services and functions of the data link layer defined by the ISO/OSI model. The scope of the object layer includes • finding which messages are to be transmitted • deciding which messages received by the transfer layer are actually to be used, • providing an interface to the application layer related hardware. There is much freedom in defining object handling. The scope of the transfer layer mainly is the transfer protocol, i.e. controlling the framing, performing arbitration, error checking, error signalling and fault confinement. Within the transfer layer it is decided whether the bus is free for starting a new transmission or whether a reception is just starting. Also some general features of the bit timing are regarded as part of the transfer layer. It is in the nature of the transfer layer that there is no freedom for modifications. The scope of the physical layer is the actual transfer of the bits between the different nodes with respect to all electrical properties. Within one network the physical layer, of course, has to be the same for all nodes. There may be, however, much freedom in selecting a physical layer. The scope of this specification is to define the transfer layer and the consequences of the CAN protocol on the surrounding layers.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值