CAN通讯协议介绍.pptx

上传人:莉*** 文档编号:73645031 上传时间:2023-02-21 格式:PPTX 页数:62 大小:544.26KB
返回 下载 相关 举报
CAN通讯协议介绍.pptx_第1页
第1页 / 共62页
CAN通讯协议介绍.pptx_第2页
第2页 / 共62页
点击查看更多>>
资源描述

《CAN通讯协议介绍.pptx》由会员分享,可在线阅读,更多相关《CAN通讯协议介绍.pptx(62页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、1Agenda Part 1:Learn the high level CAN features Part 2:Understand the CAN message Part 3:Understand how messages are communicated between CAN nodes第1页/共62页3What is CAN?Stands for:ControllerArea Network Development of the CAN-bus started originally in 1983 at Robert Bosch GmbH The protocol was offic

2、ially released in 1986 at the Society of Automotive Engineers(SAE)congress in Detroit 第3页/共62页4CAN Key FeaturesSpeed up to 1MbpsNon-destructive message arbitrationAll nodes receive all messagesNo guaranteed message latency第4页/共62页5Cost vs Data RateLINCANFlexRayMOST1 2 5 10Relative cost per nodeData

3、rate bps20K1M10M25M第5页/共62页6CAN vs LINCAN is much faster:up to 1 MbpsLIN offers a time deterministic modelCAN offers a more powerful checksumUses LDF instead of DBC files for databases第6页/共62页7CAN vs FlexRayFlexRay network startup more complicatedFlexRay offers time deterministic communicationsFlexR

4、ay offers fault tolerance using various mechanismsFlexRay offers larger data framesUses FIBEX instead of DBC files第7页/共62页8CAN vs MOSTMOST is targeted at infotainment applicationsMOST offers dedicated transfers in a ring network at 25 Mbps Optical,50 Mb Copper,and 150 Mbps optical physical layers第8页

5、/共62页9CAN Hardware FeaturesModerate cost silicon implementationRequires hardware CAN controller and CAN transceiverRequires hardware CAN transceiverMicroprocessorCAN TransceiverCAN ControllerCAN High CAN Low Ground第9页/共62页10Quiz 11.CAN guarantees message latency.(True or False)2.CAN requires hardwar

6、e controllers.(True or False)3.CAN is similar to LIN:both have very defined message structure.(True or False)4.What is the maximum number of bytes can be in a CAN message?第10页/共62页11CAN Physical Layers High Speed CAN:up to 1 MbpsLow Speed Fault Tolerant CAN:up to 125 kbpsSingle Wire CAN:up to 83.3 k

7、bps第11页/共62页122.53.5V1.5tCAN HighCAN LowRecessiveDominantCAN Dual Wire Physical Layers 第12页/共62页13CAN Node 1CAN Node 2CAN Node 3120 Ohm120 OhmCAN Dual Wire Termination第13页/共62页14Single Wire Plus GroundTwo 120 Ohm termination resistorsBus length to 40 meters 1 Mbps,Slower=longer.SW Physical Layer 第14

8、页/共62页15DW/LSFT Physical LayerTwisted Pair(CANH/CANL)plus GroundTwo 120 Ohm termination resistorsBus length to 40 meters 1 Mbps,Slower=longer.第15页/共62页16CAN SupportMultiple versions of CAN are supported in Value CAN and neoVI FIRE:High Speed CAN,LSFT CAN,Single Wire CANVehicle Spy provides full CAN

9、support:CAN message and signal decoding,logging,CAN node simulation第16页/共62页17 Lab 1:ObjectivesGet familiar with Intrepid CAN/LIN boardFind USB power connectorFind CAN and neoVI power connectorLocate LIN and CAN transceivers on the boardConnect USB and power cablesConnect neoVI to the board第17页/共62页

10、18 Intrepid CAN/LIN BoardTwo identical connected CAN nodesPower is supplied through USBCAN connectors for neoVI and ValueCANPower connector for neoVI第18页/共62页19Intrepid BoardTwo CAN transceivers with test pointsTwo reset buttons第19页/共62页20Quiz 21.CAN bus requires termination of 1200 Ohm(True or Fals

11、e)2.CAN requires three lines:CAN low,CAN High and ground(True or False)3.Single wire CAN is in general the slowest CAN type.(True or False)第20页/共62页22CAN Data FrameTypical CAN message is called data frameNumber of data bytes:0-8CAN Data FrameProtocol OverheadData BytesProtocol Overhead第22页/共62页23CAN

12、 Frame FieldsArbitration field represents frame IDControl field has defines frame lengthCRC stands for Cyclic Redundancy Check:this is CAN frame checksumACK is acknowledge field:confirms frame receptionCAN Data FrameData BytesArbitration FieldControlFieldCRCACK第23页/共62页24Arbitration FieldIdentifier

13、assigns 11 bit ID to CAN frames Remote Transmit Request(RTR)bitCAN node sends CAN frame with recessive RTR bit(logical 1)when the node requests data from other nodesData BytesControlFieldIdentifierRTR111Arbitration FieldCRCACK第24页/共62页25CAN Remote FrameIdentical to the Data Frame,except there is no

14、data bytesRTR bit is recessive(logical 1)ControlFieldCRCACKArbitration Field第25页/共62页26Control FieldDLC specifies number of data bytes:0-8RB0 bit is set to logical 0 and reserved for the future protocols IDE bit defines data frame type:standard ID or extended ID data frameIDE bits:dominant for stand

15、ard and recessive for extended data frameData BytesIdentifierIDEControl Field1 1 4RB0DLCCRCACK第26页/共62页27Extended Data FrameSimilar to standard data frameIdentifier is 29 bits longIdentifier is split into two parts:ID1 and ID2Data BytesSRR11 1 1 18 1IDEID1CRCACKID2RTRArbitration FieldControlField第27

16、页/共62页28Standard and Extended FramesData BytesControlFieldIdentifierRTR111CRCACKData BytesSRR11 1 1 18 1IDEID1CRCACKID2RTRArbitration FieldControlFieldArbitration Field第28页/共62页29CRC FieldCRC:Cyclic Redundancy CheckCRC is calculated and put on the bus by transmitting nodeCRC is computed again by the

17、 receiving node:if it does not match,then an error frame is sent and the data frame is sent again by the transmitter.CRC field is 15 bit long and has 1 bit delimiterDelimiter always should be logical 1Data BytesArbitration FieldControlFieldCRCACKDel第29页/共62页30ACK FieldACK:Acknowledge fieldIf CAN nod

18、e received the message correctly it should set ACK bit as dominant bit(logical 0)At least one receiver should set ACK to dominant bit.If not,an error frame if generated and the transmitter resends the frameACK delimiter:1 bit always should be logical 1Data BytesArbitration FieldControlFieldCRCACKDel

19、Del第30页/共62页31 Lab 2:ObjectivesGet familiar with WaveBPS softwareConnected WaveBPS to Intrepid board using the oscilloscopeRun WaveBPS and monitor CAN waveforms coming from the boardIdentify CAN high and CAN low linesMeasure one bit length in time and compute corresponding CAN baudrate第31页/共62页32Qui

20、z 31.What is the main difference between a remote frame and a data frame?2.Control field contains the number of CAN data bytes(True or False)3.What is the main difference between a standard and extended CAN frames?4.If a node received a CAN frame correctly,how would this affect ACK field of the fram

21、e?第32页/共62页34CAN Arbitration Any node can transmit when bus is free Multiple node transmission is resolved by bitwise arbitration using ID field Non destructive frame arbitration第34页/共62页35CAN Arbitration Higher priority frames win arbitration Data frames win arbitration over remote frames Nodes alw

22、ays monitor the bus If there is a dominant bit on the bus,and a node wants to send a recessive bit,the node loses arbitration 第35页/共62页361011001101110110010011LSBMSBNode wants to send CAN frame with this ID:Other node ID:CAN Arbitration Example第36页/共62页37Start and End of FrameAll data and remote fra

23、mes have start and end waveformsStart of frame is 1 dominant bit End of frame(EOF)is 7 recessive bitsIntermission field is 3 recessive bits:overload frame can be sent during the first intermission bitCAN Data or Remote FrameStart BitEOF INTIdle Bus第37页/共62页38Overload FrameOverload frame is sent when

24、 receiver requires a delay,orDominant bit was detected during intermissonAt most two overload frames can be generated to delay next data or remote frameOverload flag from nodes is 6 bits highOverload frameSuperposition of overload flags from nodes(6 bits dom.)Delimiter6-12 bits8 bits HighEOF第38页/共62

25、页39Error FrameError frame is sent when a node detects error condition on the busActive Error flag from nodes is 6 bits highError frameSuperposition of overload flags from nodes(6 bits dom.)Delimiter6-12 bits8 bits HighEOF第39页/共62页40Checksum ErrorCRC is computed by transmitter and put on the busRecei

26、ving node calculates CRC and compares it with CRC fieldIf CRC does not match,error frame is generated and transmitter resends the messageCAN Data FrameData BytesArbitration FieldControlFieldCRCACK第40页/共62页41Acknowledge Error At least one receiver must set ACK bit dominant If not,an error frame is ge

27、nerated and the transmitter resends the message Data BytesArbitration FieldControlFieldCRCDelACK第41页/共62页42Form Error Condition:fixed form fields have illegal bits:dominant bit(logical 0)is detected in the delimiters,End of Frame(EOF)or inter-frame space Transmitter then send error frame and resends

28、 the messageCAN Data or Remote FrameEOF INTIdle BusDelDel第42页/共62页43Stuff Error Condition:6 consecutive bits of the same state in non-fixed form fields CAN bit stuffing algorithm inserts additional bits into CAN frame to make sure there is no more than 5 consecutive bits of the same level The transm

29、itter resends the messageCAN Data FrameData BytesArbitration FieldControlFieldCRCACK第43页/共62页44Bit Error Condition:transmitter monitors what it sends and detects a bit state opposite to what it put on the bus Exclude Arbitration and ACK fieldCAN Data FrameData BytesArbitration FieldControlFieldCRCAC

30、K第44页/共62页45Fault Confinement What happens when transmitter detects an error and keeps sending error frames?Endless loop problem:transmitter sends bad frame and the receiver error frames it Solution:node fault confinement.It maintains CAN TX and RX error counters,and isolate nodes from the communica

31、tion after certain numbers of errors第45页/共62页46Fault Confinement States Three states Error active nodes:take part in the communication and send error active flags when errors are detected Error passive nodes:take part in the communication but can only send error passive flags After transmission,erro

32、r passive nodes send additional 8 recessive bits after intermission field it is called“Suspend Transmission”field Bus off nodes:no influence on the bus第46页/共62页Fault ConfinementErrorCounters TEC:000 REC:000Error ActiveError Active REC:001 TEC:000 REC:002 TEC:001 REC:003 TEC:002 REC:004 TEC:004 REC:0

33、10 TEC:011 REC:018 TEC:026 REC:029 TEC:052 REC:029 TEC:097 REC:031 TEC:129 REC:033 TEC:185 REC:042 TEC:211 REC:047 TEC:233 REC:051 TEC:256ErrorCountersTEC:000REC:000 REC:000 TEC:000ErrorCountersTEC:000REC:000 REC:001 TEC:000 REC:000 TEC:000 REC:001 TEC:000 REC:002 TEC:000 REC:001 TEC:000 REC:002 TEC

34、:000 3 Error States:Error Active,Error Passive,Bus OffCAN Node 1CAN Node 2CAN Node 3Error ActiveError PassiveBUS OFF第47页/共62页48Receive Error CounterIf receiver sends an error frame:REC+1If receiver was first to start an error frame:REC+8If receiver monitors a BIT ERROR while sending an error frame:R

35、EC+8After successfully receiving a message:REC-1第48页/共62页49Transmit Error CounterIf transmitter sends an error frame:TEC+8If transmitter monitors a BIT ERROR while sending an error frame:TEC+8After successfully transmitting a message:TEC-1If TEC reaches 127:Cannot send Error Frames,but can Tx/Rx第49页

36、/共62页50 Lab 3:ObjectivesGet familiar with Vehicle Spy softwareCreate a message that is sent periodicallyPut that message into the 2nd node on the EVBFind our message amongst all the messages第50页/共62页51Quiz 41.Overload frame is sent when receiver requires a delay.(True or False)2.Under what condition

37、s does a form error occur?3.Stuff bits are inserted only if there are 5 consecutive bits of the same state on the bus.(True or False)第51页/共62页55CAN Bit Timing Issues All nodes must receive TX waveform“simultaneously”for arbitration Varying Delays for different nodes Resynchronization:no common clock

38、 between nodes第55页/共62页56CAN Bit Timing Issues Each bit has four parts and the sampling point Each part of the bit consists of a number of time quantas Sample point at 70-80%of bitSYNC_SEGPROP_SEGPHASE_SEG1PHASE_SEG21 bit in CAN frameSample point第56页/共62页57High Level Protocols Examples:Ford SCP is a

39、 HLP to J1850 and so is Class 2 CAN HLP:J1939,GMLAN are on top of CAN CAN HLP:CAN Calibration Protocol(CCP)CAN HLP:DeviceNet第57页/共62页58DBC Files Industry standard DBC file format DBC files describe the structure for signals that CAN frames could contain Vehicle Spy supports DBC files for message dec

40、oding第58页/共62页60Quiz 51.CAN frame arbitration takes into account frame ID and frame data bytes.(True of False)2.During CAN arbitration a dominant bit(logical 0)always wins arbitration vs a recessive bit(logical 1)(True or False)3.What is bit sampling point?Can we change it?第60页/共62页61Thank you for your attentionQuestions?第61页/共62页感谢您的观赏!第62页/共62页

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > PPT文档

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

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁