《CAN通讯协议介绍》PPT课件.ppt

上传人:赵** 文档编号:63996598 上传时间:2022-11-27 格式:PPT 页数:63 大小:647.50KB
返回 下载 相关 举报
《CAN通讯协议介绍》PPT课件.ppt_第1页
第1页 / 共63页
《CAN通讯协议介绍》PPT课件.ppt_第2页
第2页 / 共63页
点击查看更多>>
资源描述

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

1、Intrepid Control Systems,ICAN Bus Hands-On CoursePresented by:Intrepid Control Systems,Inc.Qin WenSales EngineerTel:+86-137-6464-9956Email:1Intrepid Control Systems,IObjectives Learn the basics of the CAN protocol Understand what makes up a CAN network Understand what makes up a CAN node Learn how C

2、AN compares to competitive protocols Learn how to use a CAN test tool and a CAN Database(DBC)file to monitor and transmit CAN messages and signals2Intrepid Control Systems,IAgenda Part 1:Learn the high level CAN features Part 2:Understand the CAN message Part 3:Understand how messages are communicat

3、ed between CAN nodes3Intrepid Control Systems,IWhat is CAN?Stands for:ControllerArea Network Development of the CAN-bus started originally in 1983 at Robert Bosch GmbH The protocol was officially released in 1986 at the Society of Automotive Engineers(SAE)congress in Detroit 5Intrepid Control System

4、s,ICAN Key FeaturesSpeed up to 1MbpsNon-destructive message arbitrationAll nodes receive all messagesNo guaranteed message latency6Intrepid Control Systems,ICost vs Data RateLINCANFlexRayMOST1 2 5 10Relative cost per nodeData rate bps20K1M10M25M7Intrepid Control Systems,ICAN vs LINCAN is much faster

5、:up to 1 MbpsLIN offers a time deterministic modelCAN offers a more powerful checksumUses LDF instead of DBC files for databases8Intrepid Control Systems,ICAN vs FlexRayFlexRay network startup more complicatedFlexRay offers time deterministic communicationsFlexRay offers fault tolerance using variou

6、s mechanismsFlexRay offers larger data framesUses FIBEX instead of DBC files9Intrepid Control Systems,ICAN 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 layers10Intrepid Control Syst

7、ems,ICAN Hardware FeaturesModerate cost silicon implementationRequires hardware CAN controller and CAN transceiverRequires hardware CAN transceiverMicroprocessorCAN TransceiverCAN ControllerCAN High CAN Low Ground11Intrepid Control Systems,IQuiz 11.CAN guarantees message latency.(True or False)2.CAN

8、 requires hardware 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?12Intrepid Control Systems,ICAN Physical Layers High Speed CAN:up to 1 MbpsLow Speed Fault Tolerant CAN:up to 12

9、5 kbpsSingle Wire CAN:up to 83.3 kbps13Intrepid Control Systems,I2.53.5V1.5tCAN HighCAN LowRecessiveDominantCAN Dual Wire Physical Layers 14Intrepid Control Systems,ICAN Node 1CAN Node 2CAN Node 3120 Ohm120 OhmCAN Dual Wire Termination15Intrepid Control Systems,ISingle Wire Plus GroundTwo 120 Ohm te

10、rmination resistorsBus length to 40 meters 1 Mbps,Slower=longer.SW Physical Layer 16Intrepid Control Systems,IDW/LSFT Physical LayerTwisted Pair(CANH/CANL)plus GroundTwo 120 Ohm termination resistorsBus length to 40 meters 1 Mbps,Slower=longer.17Intrepid Control Systems,ICAN SupportMultiple versions

11、 of CAN are supported in Value CAN and neoVI FIRE:High Speed CAN,LSFT CAN,Single Wire CANVehicle Spy provides full CAN support:CAN message and signal decoding,logging,CAN node simulation18Intrepid Control Systems,I Lab 1:ObjectivesGet familiar with Intrepid CAN/LIN boardFind USB power connectorFind

12、CAN and neoVI power connectorLocate LIN and CAN transceivers on the boardConnect USB and power cablesConnect neoVI to the board19Intrepid Control Systems,I Intrepid CAN/LIN BoardTwo identical connected CAN nodesPower is supplied through USBCAN connectors for neoVI and ValueCANPower connector for neo

13、VI20Intrepid Control Systems,IIntrepid BoardTwo CAN transceivers with test pointsTwo reset buttons21Intrepid Control Systems,IQuiz 21.CAN bus requires termination of 1200 Ohm(True or False)2.CAN requires three lines:CAN low,CAN High and ground(True or False)3.Single wire CAN is in general the slowes

14、t CAN type.(True or False)22Intrepid Control Systems,ICAN Data FrameTypical CAN message is called data frameNumber of data bytes:0-8CAN Data FrameProtocol OverheadData BytesProtocol Overhead24Intrepid Control Systems,ICAN Frame FieldsArbitration field represents frame IDControl field has defines fra

15、me lengthCRC stands for Cyclic Redundancy Check:this is CAN frame checksumACK is acknowledge field:confirms frame receptionCAN Data FrameData BytesArbitration FieldControlFieldCRCACK25Intrepid Control Systems,IArbitration FieldIdentifier assigns 11 bit ID to CAN frames Remote Transmit Request(RTR)bi

16、tCAN node sends CAN frame with recessive RTR bit(logical 1)when the node requests data from other nodesData BytesControlFieldIdentifierRTR111Arbitration FieldCRCACK26Intrepid Control Systems,ICAN Remote FrameIdentical to the Data Frame,except there is no data bytesRTR bit is recessive(logical 1)Cont

17、rolFieldCRCACKArbitration Field27Intrepid Control Systems,IControl 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 standard and recessive for extend

18、ed data frameData BytesIdentifierIDEControl Field1 1 4RB0DLCCRCACK28Intrepid Control Systems,IExtended Data FrameSimilar to standard data frameIdentifier is 29 bits longIdentifier is split into two parts:ID1 and ID2Data BytesSRR11 1 1 18 1IDEID1CRCACKID2RTRArbitration FieldControlField29Intrepid Con

19、trol Systems,IStandard and Extended FramesData BytesControlFieldIdentifierRTR111CRCACKData BytesSRR11 1 1 18 1IDEID1CRCACKID2RTRArbitration FieldControlFieldArbitration Field30Intrepid Control Systems,ICRC FieldCRC:Cyclic Redundancy CheckCRC is calculated and put on the bus by transmitting nodeCRC i

20、s computed again by the 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 FieldControlFieldCRCACKDel31Intrepid Control Systems,I

21、ACK FieldACK:Acknowledge fieldIf CAN node 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 Byt

22、esArbitration FieldControlFieldCRCACKDelDel32Intrepid Control Systems,I 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

23、time and compute corresponding CAN baudrate33Intrepid Control Systems,IQuiz 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

24、received a CAN frame correctly,how would this affect ACK field of the frame?34Intrepid Control Systems,ICAN Arbitration Any node can transmit when bus is free Multiple node transmission is resolved by bitwise arbitration using ID field Non destructive frame arbitration36Intrepid Control Systems,ICAN

25、 Arbitration Higher priority frames win arbitration Data frames win arbitration over remote frames Nodes always 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 37Intrepid Control Systems,I1011001101110110010011LSBMSBNode wants

26、 to send CAN frame with this ID:Other node ID:CAN Arbitration Example38Intrepid Control Systems,IStart and End of FrameAll data and remote frames 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

27、 be sent during the first intermission bitCAN Data or Remote FrameStart BitEOF INTIdle Bus39Intrepid Control Systems,IOverload FrameOverload frame is sent when receiver requires a delay,orDominant bit was detected during intermissonAt most two overload frames can be generated to delay next data or r

28、emote frameOverload flag from nodes is 6 bits highOverload frameSuperposition of overload flags from nodes(6 bits dom.)Delimiter6-12 bits8 bits HighEOF40Intrepid Control Systems,IError FrameError frame is sent when a node detects error condition on the busActive Error flag from nodes is 6 bits highE

29、rror frameSuperposition of overload flags from nodes(6 bits dom.)Delimiter6-12 bits8 bits HighEOF41Intrepid Control Systems,IChecksum ErrorCRC is computed by transmitter and put on the busReceiving node calculates CRC and compares it with CRC fieldIf CRC does not match,error frame is generated and t

30、ransmitter resends the messageCAN Data FrameData BytesArbitration FieldControlFieldCRCACK42Intrepid Control Systems,IAcknowledge Error At least one receiver must set ACK bit dominant If not,an error frame is generated and the transmitter resends the message Data BytesArbitration FieldControlFieldCRC

31、DelACK43Intrepid Control Systems,IForm 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 the messageCAN Data or Remote FrameEOF INTIdle BusDelDel44Intrepid Contr

32、ol Systems,IStuff 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 transmitter resends the messageCAN Data FrameData BytesArbitra

33、tion FieldControlFieldCRCACK45Intrepid Control Systems,IBit 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 FieldControlFieldCRCACK46Intrepid Control Systems,IFault Conf

34、inement 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 communication after certain num

35、bers of errors47Intrepid Control Systems,IFault 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,error pas

36、sive nodes send additional 8 recessive bits after intermission field it is called“Suspend Transmission”field Bus off nodes:no influence on the bus48Intrepid Control Systems,IFault ConfinementErrorCounters TEC:000 REC:000Error ActiveError Active REC:001 TEC:000 REC:002 TEC:001 REC:003 TEC:002 REC:004

37、 TEC:004 REC:010 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:0

38、00 REC:002 TEC:000 3 Error States:Error Active,Error Passive,Bus OffCAN Node 1CAN Node 2CAN Node 3Error ActiveError PassiveBUS OFFIntrepid Control Systems,IReceive Error CounterIf receiver sends an error frame:REC+1If receiver was first to start an error frame:REC+8If receiver monitors a BIT ERROR w

39、hile sending an error frame:REC+8After successfully receiving a message:REC-150Intrepid Control Systems,ITransmit 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

40、127:Cannot send Error Frames,but can Tx/Rx51Intrepid Control Systems,I 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 messages52Intrepid Control Systems,IQuiz 41.Overload fr

41、ame is sent when receiver requires a delay.(True or False)2.Under what conditions 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)53Intrepid Control Systems,ICAN Bit Timing Issues All nodes must receive TX waveform“si

42、multaneously”for arbitration Varying Delays for different nodes Resynchronization:no common clock between nodes57Intrepid Control Systems,ICAN 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_S

43、EGPROP_SEGPHASE_SEG1PHASE_SEG21 bit in CAN frameSample point58Intrepid Control Systems,IHigh Level Protocols Examples:Ford SCP is a 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:DeviceNet59Intrepid Control Systems,IDBC Files Industr

44、y standard DBC file format DBC files describe the structure for signals that CAN frames could contain Vehicle Spy supports DBC files for message decoding60Intrepid Control Systems,IQuiz 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?62Intrepid Control Systems,IThank you for your attentionQuestions?63

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

当前位置:首页 > 教育专区 > 高考资料

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

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