局域网控制器.doc_第1页
局域网控制器.doc_第2页
局域网控制器.doc_第3页
局域网控制器.doc_第4页
局域网控制器.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

局域网控制器(CAN)CAN 的全称是Controller Area Network,即局域网控制器,CAN总线是从80年代初为解决现代汽车中众多的控制与测试仪器之间的数据交换而开发的一种串行总线系统。1993年 ISO正式颁布了国际标准ISO11898-1并且包含了ISO/OSI开放式互联系统参考模型7层中的数据链路层。CAN总线已经应用到40个半导体硬件生产厂商,它提供两种通讯服务:报文发送(传输数据帧)和报文发送请求(远程发送请求,RTR)。其他所有服务,例如错误信号检测、自动重发错误帧 都是透明使用,这就意味着CAN控制器芯片能自动执行这些服务。 CAN协议与人类交流所使用的拉丁字母具有相同的意义,这也意味着CAN控制器与打印机或打字机具有可比性。CAN的使用者也可以通过子定义语言/语法以及单词/词组来进行通讯。 CAN特点 多主机局域网:应用于智能控制与自控系统。CAN节点在错误严重的情况下自动关闭,而使总线上其它节点的操作不受影响。 广播通讯机制:发送机将报文发送到总线上的所有设备,所有的接收设备接收所有的报文然后判断是否是相关信息。这就保证了系统中所有设备所接收数据的完整性并使用相同信息。 错误检测与错误报文自动重发机制:这也确保了数据的完整性。局域网控制器(CAN)-协议CAN协议是一个被定义为ISO11898的国际标准,除了CAN协议本身外,CAN协议的一致性测试也被定义为ISO16845标准,它描述了CAN芯片的互换性。 数据交换原则 CAN是基于广播通讯机制,它依靠报文(Message)的传送机制来实现。因此CAN并未定义站及站地址,而 仅仅定义了报文。每一个报文都有一个识别符(identifier),在整个网络中必须是唯一的,它不但描述了某一报文的内容,而且还定义了报文的优先 级。当很多站都在访问总线时,优先级是非常重要的(总线裁决),因此CAN是通过报文的识别符来确定报文的优先级的。CAN使用地址访问的方法,使网络系 统的配置变得非常灵活,用户很容易将一个新的站增加到一个已经存在CAN网络里,而不用对已经存在的站进行任何硬件上或软件上的修改,但此新增的站必须为 完全的接收者,这样将不会对网络上各个节点的通讯产生影响。这就允许一个模块化概念并且允许接收多重数据和分布式处理的同步,数据传输并不是以节点的具体 类型的实用性为基础, 这就允许了简单的服务和网络升级。 实时数据传输 在实时处理系统中,通过网络交换紧急报文存在很大的不同:一个快速改变的值,如发动机负载必须频繁的进行传送且 要求延迟比其它的值如发动机温度要小。发送的报文都要和其它的不太紧急的报文进行优先级的比较,在系统设计中,报文的优先级体现在写入报文识别符的二进制 值,这些值不能被动态的改变。识别符中的值越小,其报文的优先级越高(也就是0比1的优先级高)。总线访问冲突是通过使用各个站监测到的总线电平位的识别 符的比特式仲裁来解决的,这和有线机制是一致的,即显性状态覆盖隐形状态。仲裁期间,每一个发送器都对发送位的电平与被监控的总线电平进行比较。如果电平 相同,则这个单元可以继续发送。所有发送的是一“隐性”电平而监控到一“显性”电平的站(节点)将失去总线控制权,仲裁失败的站会失去总线控制权,所有失去 总线控制权的站都会自动变为接收者,接收高优先级的报文,它们不再企图发送报文,直到总线重新空闲。数据发送请求从整体上按照报文的重要性来排序处理,这 对于超载情况尤其有利,由于总线访问是以报文为基础来区分优先级,在实时系统中降低了传输的延迟。 报文帧格式 CAN协议支持两种报文帧格式,一种称为CAN标准帧,一种称为CAN扩展帧,它们之间的区别主要在于识别符的 长度不同。标准帧支持11位的识别符(通常所指CAN2.0协议的Part A部分),扩展帧支持29位的识别符(通常所指CAN2.0 协议的Part B部分) CAN标准帧格式 CAN标准帧格式以被称为帧起始 (SOF) 的起始位开始,接下来是由识别符和远程发送请求位 (RTR) 组成的 仲裁场,RTR用来区别数据帧和被称为“远程帧”的数据请求帧。接下来是控制域,它包含用于区别CAN标准帧与扩展帧的确认扩展位 (IDE),同样,数据长度代码(DLC)用于表示接下去的“数据区 ” (Data field)中数据的字节数. 如果报文用于远程帧,DLC就包含所请求数据的字节数,数据区可达到8个数据字节。报文的完整性由接下来的“循环冗余校验码(CRC)”来保证;而“应答 区(ACK)”则有应答槽(ACK slot)和ACK定界符(ACK delimiter),应答槽中的位元会被接收到正确的报文的站用隐形电平填充显性电平并发送到总线上,接收者不需要判断报文的有效性便可以应答正确的报 文,即无论是否与自己有关的报文,接收者都会填充应答槽并进行发送。报文结束于“帧结束(EOF)”位,“帧间隔(IFS)”定义了一个两个数据帧之间的 最小位元数。如果没有任何站企图对总线进行访问,则总线会一直保持空闲状态。 CAN扩展帧格式 扩展帧报文与标准帧报文之间的区别在于识别符的长度不同,扩展帧识别符由11位基本识别符和18的扩展识别符组 成。CAN标准帧与CAN扩展帧的主要区别来自于对确认扩展位(IDE)的使用, 当IDE为显性时,则报文作为标准帧来发送,当IDE位为隐性时报文作为扩展帧来发送,当两种格式报文同时出现在总线上,并且具有相同的识别符或基本识别 符,那判断报文优先级的方法通常为:标准帧的报文总是比扩展帧的报文优先级高。扩展帧有一些规定:总线反应时间更长(最小20个位时间),扩展帧中报文需 要更多的带宽(大概20),错误检测的执行会更低(优化了15位CRC,使帧的长度增加到112位)。支持扩展帧的CAN控制器(CAN Controller)同样也能发送和接收CAN标准帧,当仅仅支持标准帧的CAN控制器被用在网络上时,则仅只有标准帧能在整个网络上传送,扩展帧将不 能被识别,但是有些只支持标准帧的CAN控制器可以识别扩展帧并且忽略它们 检测和信号错误 不同于其它总线系统,当错误产生时CAN协议不能立即使用应答报文来取代错误信号,对于错误侦测CAN协议有完整的三种报文级机制: 循环冗余检测(CRC):CRC在报文结束时增加一个冗余检测位来保证帧信息安全,接收者会重新计算CRC值并与报文中的位做对比,如果不一样则发生CRC错误 帧检测:这种机制将接收的报文与固定的帧的格式和大小作比较,来确定所接收的报文的结构。帧检测所检测到的错误称为“格式错误(format errors)”。 应答错误:已经接收的帧都要被所有的接收者做应答,如果报文发送者没有收到应答信息则发生一个ACK错误。CAN协议还提供两种位元级的错误检测机制: 监视:发送者可以通过监视总线电平信号来检测错误。每个传送的节点都可以监视总线电平并检测传送位与接收位的不同,对于全局性的错误和只基于发送者的错误都可以被检测到。 位 填充:一帧报文中的每一位都由不归零码(NRZ)表示,可保证位编码的最大效率。然而,如果在一帧报文中有太多相同电平的位,就有可能失去同步。为保证同 步,同步沿用位填充产生,即5个连续相同的位元后,发送者会自动插入一个反向的填充位元到位元组中,接收者自动识别此填充位元并自动丢掉。如果至少一个站使用上述机制发现一个或多个错误,则发送“错误标志(error flag)”来取消当前的传送,阻止其它节点继续接收报文,以确保通过网络的数据连贯性,当错误报文的传输被取消后,发送者自动重新尝试发送(自动重发),并重新进行总线访问权的竞争。 虽然CAN具有较高的效率的,但这种方法存在一个问题,即一个发生错误的站将导致所有数据被终止,其中 也包括正确的数据。因此,如果不采取自监测措施,将会导致总线系统堵塞。为此,CAN协议提供一种方法将节点的暂时错误和永久错误区别开来,并自动关闭错 误的节点。这种方法可以通过对出错站统计评估来确定一个站本身的错误并进入一种不会对其它站产生不良影响的运行方法来实现,即站可以通过关闭自己来阻止其 他节点的正常数据被错误地当成不正确的数据而终止传输。CAN Bus Controller Area NetworkISO 11898/11519CAN Bus DescriptionCAN Bus Pin-Out CAN Bus Interface ICs Other Interface BusesStandard Organizations CANBus OnLine Standards CAN Higher Layer Protocols CANbus EquipmentHome CAN Bus Description The Controller Area Network (CAN) specification defines the Data Link Layer, ISO 11898 defines the Physical Layer.The CAN bus CANbus is a Balanced (differential) 2-wire interface running over either a Shielded Twisted Pair (STP), Un-shielded Twisted Pair (UTP), or Ribbon cable. Each node uses a Male 9-pin D connector. The Bit Encoding used is: Non Return to Zero (NRZ) encoding (with bit-stuffing) for data communication on a differential two wire bus. The use of NRZ encoding ensures compact messages with a minimum number of transitions and high resilience to external disturbance. CAN Bus Electrical Interface Circuit A number of different data rates are defined, with 1Mbps (Bits per second) being the top end, and 10kbps the minimum rate. All modules must support 20kbps. Cable length depends on the data rate used. Normally all the devices in a system transfer uniform and fixed bit-rates. The maximum line length is 1Km, 40 meters at 1Mbps. Termination resistors are used at each end of the cable. The worst-case transmission time of an 8-byte frame with an 11-bit identifier is 134 bit times (thats 134 microseconds at the maximum baud rate of 1Mbits/sec). The CAN Bus interface uses an asynchronous transmission scheme controlled by start and stop bits at the beginning and end of each character. This interface is used, employing serial binary interchange. Information is passed from transmitters to receivers in a data frame. The data frame is composed of an Arbitration field, Control field, Data field, CRC field, ACK field. The frame begins with a Start of frame SOF, and ends with an End of frame EOF space. The data field may be from 0 to 8 bits. The frame check sequence is derived from a Cyclic Redundancy Code (CRC); the coefficients are generated modulo-2: X15 + X14 + X10 + X8 + X7 + X4 + X3 + 1. CAN implements five error detection mechanisms; 3 at the message level and 2 at the bit level Also incorporates error flags. At the message level: Cyclic Redundancy Checks (CRC), Frame Checks, Acknowledgment Error Checks. At the bit level: Bit Monitoring, Bit Stuffing. The CANbus pinout is shown in the table below.The Application for CAN bus in the automotive area include;A low speed CANbus may be employed to operate window and seat controls. A high speed CANbus may be employed for engine management or brake control. Many other applications are possible Engine Sensors, Anti-Skid Systems.For additional information refer to: CAN Bus Specification; Version 2.0, or ISO 11898/11519.CANbus is used as a vehicle bus, for other vehicle Buses see the Automotive Bus page This Site.CANbus is also used as an Industrial Field bus, for other Field Buses see the Field Buses page This Site Detailed info on CANbus Robert Bosch GmbH, Detailed info on CANbus KVASER AB Industrial CANbus Index CAN Bus Pin Out The pinout for the 9-pin D connector is shown in the table below. Additional connector styles are listed on the CAN Bus Connector Pin out page. Many of the additional connector pin outs are used with CANopen and include: 10-pin header 5 x 2 multipole, RJ10 Modular Connector Jack, RJ45 Modular Connector Jack, 5-pin mini circular, 5-pin micro circular, Open Style, 7/8/9-pin round connectors. 9 Pin (male) D-Sub CANbus PinOut Pin # Signal Names Signal Description 1 Reserved Upgrade Path 2 CAN_L Dominant Low 3 CAN_GND Ground 4 Reserved Upgrade Path 5 CAN_SHLD Shield, Optional 6 GND Ground, Optional 7 CAN_H Dominant High 8 Reserved Upgrade Path 9 CAN_V+ Power, Optional Some systems may use pin 8 as an error line, to indicate an error on the net. Listing of D Connectors Manufactures . Listing of Cable ManufacturesThis Site Back to Industrial CANbus Index CAN Bus Standard Organizations CiA CAN In Automation - International Users and Manufactures GroupISO International Organization for StandardizationAll other Standard Organizations This Site Industrial CANbus Index CAN Bus Standard/Specifications Information ISO/DIS 11898-1: Road vehicles - Controller area network (CAN) - Part 1: Data link layer and physical signalingISO/DIS 11898-2: Road vehicles - Controller area network (CAN) - Part 2: High-speed medium access unitISO/CD 11898-3: Road vehicles - Controller area network (CAN) - Part 3: Low-speed fault tolerant medium dependent interfaceISO/CD 11898-4: Road vehicles - Controller area network (CAN) - Part 4: Time triggered communication CAN Bus Specification Version 2.0 All other Interface bus specifications Non-CANbus This Site Industrial CANbus Index CAN Bus Interface ICs CAN Bus uses a Drive Voltage: High; 2.75v to 4.5volts, Low; 0.5 to 2.25volts, Differential 1.5v to 3.0volts CAN Bus Interface IC Logic Transition Levels Analog Devices, Inc. Mixed-Signal-DSPs (ADSP-21992) with 160MIPS and On-Chip CAN V2.0b Atmel Corp. Cast CAN Core, Bus Controller ICs Dallas Semiconductor Maxim DS80C390 Dual CAN High-Speed Microprocessor, bus controller ICs freescale 33389/33388 low speed fault tolerant CAN transceiver Infineon 82C900 Stand-alone TwinCan Controller-TLE6250 CAN Transceiver IC Manufacturer Inicore Inc. CAN IP Core IC Manufacturer Intel, Intel App Notes CanBus Interface 82527 IC Linear Technology CAN Transceiver IC Manufacturer Maxim Integrated Products DS80C390 Dual CAN High-Speed Microprocessor, bus controller IC Melexis CAN Bus Transceiver IC Manufacturer Microchip MCP2510 Stand-alone CanBus Controller IC National Semiconductor uP with CAN Interface NXP 8/16-bit CAN Bus 2.0 Controllers/Transceiver OKI CAN Controller Renesas Technology Corp Micro-Controller uC with CAN / LIN Interface STMicroelectronics uP with CAN Interface Yamar Electronics DC-BUS for digital communication overcome hostile in-vehicle power line communication environment. Power line Communication multiplex semiconductor transceivers for automotive and industrial CAN, LIN networks. TI TMS320F241 with CANbus Interface-3.3v Line Transceiver ICs IC Manufacturers Listing All other types This Site CAN Bus I/O Characteristics CANbus Signal Type Digital Interface Output Voltage (High) VOH +4 volts min, +5.5 volts max Output Voltage (Low) VOL +0 volts min, +1.5 volts max Output Voltage +16 volts (Absolute Max) Output Current 100mA Impedance 124 ohm termination between +/- terminals Circuit Type Differential Bit Times 1uS 1Mb/s; 2uS .5Mb/s 4uS .25Mb/s Encoding Format Non-Return-to-Zero (NRZ) Transmit/Receive Frequency 1Mb/s 40 meters Topology Point-to-Point Medium Shielded Twisted Pair (STP) 9 pin D-Sub Access Control Carrier Sense, Multiple Access with Collision Detect (CSMA/CD).None destructive bit wise arbitration Industrial CANbus Index CANbus Electronic Equipment OEM COT Cards and Board ManufacturersThis Site With CANbus interfaces Detailed info on CANbus Robert Bosch GmbH CD Systems CANbus COTs Card Manufacturer ESD Electronic Systems Cards and Modules LeCroy Corp. Trigger and Decoding oscilloscope Package Micro-key bv Modules Squarell Technology CANbus components for harsh environments and automotive applications. Interfaces, Dataloggers, Sensordevices and Outputdevices. Configurable without programming. Vector-CANtech CAN Development Tools-Interfaces Wind River Systems, Inc. CAN Bus Software Yokogawa CAN Bus Signal Analyzer Industrial CANbus Index CAN Bus Higher Layer Protocols Following the ISO/OSI layer model, the protocol layer is implemented over the data link layer which conforms to CAN 2.0A and/or 2.0B, and the physical layer which specified in the ISO 11898 standard. The data link layer and the physical layer is implemented in hardware TTCAN TTCAN: Time Triggered CAN protocol. Allows the bus to appear more deterministic CANOpen CANopen is based on the CANbus data link layer and high-speed transceiver as specified in ISO 11898, part 1 and 2. In addition, CANopen specifies bit-timing and recommends pin-assignments for connectors. Uses Device profiles defines four types of messages; Manufactures follow guidelines in the CANOpen spec producing devices with characteristics which will operate with each other. The are a number of Bit rates based on bus length: based on 5nS/m cable propagation delay.1Mbps Maximum transfer speed up to a 25 meter maximum bus length Nominal bit time is 1uS800kbps Maximum transfer speed up to a 50 meter maximum bus length Nominal bit time is 1.25uS500bps Maximum transfer speed up to a 100 meter maximum bus length Nominal bit time is 2uS250kbps Maximum transfer speed up to a 250 meter maximum bus length Nominal bit time is 4uS125kbps Maximum transfer speed up to a 500 meter maximum bus length Nominal bit time is 8uS50kbps Maximum transfer speed up to a 1000 meter maximum bus length Nominal bit time is 20uS20kbps Maximum transfer speed up to a 2500 meter maximum bus length Nominal bit time is 50uS10bps Maximum transfer speed up to a 5000 meter maximum bus length Nominal bit time is 100uSPinout for a number of CANopen connectors are listed on the CAN Bus Connector Pin out page. CANopen Software description/ Specs B.Hallgren ATLAS DCS CAN Kingdom CAN Kingdom defines a set of protocol primitives, based on the CAN protocol. A bus Master is defined during initialization, the Master checks to see which nodes are connected to the network. CAN Kingdom uses either an Event driven of Time driven timing model. DeviceNet CENELEC standard - EN50325 DeviceNet identifies the physical layer but does not use the same physical layer interface as ISO 11898, and is based on the CanBus protocol. DeviceNet provides optical isolation for additional protection and does not use 9-pin subD connectors. DeviceNet only supports three baud rates: 125, 250 and 500 Kbaud ( 500 meters) with up to 64 devices on the (differential) bus. In addition the cable carries 24 volts which powers the devices. DeviceNet description ODVA.org Info Rockwell Automation Allen Bradley CAN/EtherNet The University of Warwick DeviceNet Cable

温馨提示

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

评论

0/150

提交评论