CAN通讯协议介绍.ppt
- 文档编号:18889864
- 上传时间:2024-02-08
- 格式:PPT
- 页数:63
- 大小:647.50KB
CAN通讯协议介绍.ppt
《CAN通讯协议介绍.ppt》由会员分享,可在线阅读,更多相关《CAN通讯协议介绍.ppt(63页珍藏版)》请在冰点文库上搜索。
IntrepidControlSystems,ICANBusHands-OnCoursePresentedby:
IntrepidControlSystems,Inc.QinWenSalesEngineerTel:
+86-137-6464-9956Email:
1IntrepidControlSystems,IObjectivesLearnthebasicsoftheCANprotocolUnderstandwhatmakesupaCANnetworkUnderstandwhatmakesupaCANnodeLearnhowCANcomparestocompetitiveprotocolsLearnhowtouseaCANtesttoolandaCANDatabase(DBC)filetomonitorandtransmitCANmessagesandsignals2IntrepidControlSystems,IAgendaPart1:
LearnthehighlevelCANfeaturesPart2:
UnderstandtheCANmessagePart3:
UnderstandhowmessagesarecommunicatedbetweenCANnodes3IntrepidControlSystems,IWhatisCAN?
Standsfor:
ControllerAreaNetworkDevelopmentoftheCAN-busstartedoriginallyin1983atRobertBoschGmbHTheprotocolwasofficiallyreleasedin1986attheSocietyofAutomotiveEngineers(SAE)congressinDetroit5IntrepidControlSystems,ICANKeyFeaturesSpeedupto1MbpsNon-destructivemessagearbitrationAllnodesreceiveallmessagesNoguaranteedmessagelatency6IntrepidControlSystems,ICostvsDataRateLINCANFlexRayMOST12510RelativecostpernodeDataratebps20K1M10M25M7IntrepidControlSystems,ICANvsLINCANismuchfaster:
upto1MbpsLINoffersatimedeterministicmodelCANoffersamorepowerfulchecksumUsesLDFinsteadofDBCfilesfordatabases8IntrepidControlSystems,ICANvsFlexRayFlexRaynetworkstartupmorecomplicatedFlexRayofferstimedeterministiccommunicationsFlexRayoffersfaulttoleranceusingvariousmechanismsFlexRayofferslargerdataframesUsesFIBEXinsteadofDBCfiles9IntrepidControlSystems,ICANvsMOSTMOSTistargetedatinfotainmentapplicationsMOSToffersdedicatedtransfersinaringnetworkat25MbpsOptical,50MbCopper,and150Mbpsopticalphysicallayers10IntrepidControlSystems,ICANHardwareFeaturesModeratecostsiliconimplementationRequireshardwareCANcontrollerandCANtransceiverRequireshardwareCANtransceiverMicroprocessorCANTransceiverCANControllerCANHighCANLowGround11IntrepidControlSystems,IQuiz11.CANguaranteesmessagelatency.(TrueorFalse)2.CANrequireshardwarecontrollers.(TrueorFalse)3.CANissimilartoLIN:
bothhaveverydefinedmessagestructure.(TrueorFalse)4.WhatisthemaximumnumberofbytescanbeinaCANmessage?
12IntrepidControlSystems,ICANPhysicalLayersHighSpeedCAN:
upto1MbpsLowSpeedFaultTolerantCAN:
upto125kbpsSingleWireCAN:
upto83.3kbps13IntrepidControlSystems,I2.53.5V1.5tCANHighCANLowRecessiveDominantCANDualWirePhysicalLayers14IntrepidControlSystems,ICANNode1CANNode2CANNode3120Ohm120OhmCANDualWireTermination15IntrepidControlSystems,ISingleWirePlusGroundTwo120OhmterminationresistorsBuslengthto40meters1Mbps,Slower=longer.SWPhysicalLayer16IntrepidControlSystems,IDW/LSFTPhysicalLayerTwistedPair(CANH/CANL)plusGroundTwo120OhmterminationresistorsBuslengthto40meters1Mbps,Slower=longer.17IntrepidControlSystems,ICANSupportMultipleversionsofCANaresupportedinValueCANandneoVIFIRE:
HighSpeedCAN,LSFTCAN,SingleWireCANVehicleSpyprovidesfullCANsupport:
CANmessageandsignaldecoding,logging,CANnodesimulation18IntrepidControlSystems,ILab1:
ObjectivesGetfamiliarwithIntrepidCAN/LINboardFindUSBpowerconnectorFindCANandneoVIpowerconnectorLocateLINandCANtransceiversontheboardConnectUSBandpowercablesConnectneoVItotheboard19IntrepidControlSystems,IIntrepidCAN/LINBoardTwoidenticalconnectedCANnodesPowerissuppliedthroughUSBCANconnectorsforneoVIandValueCANPowerconnectorforneoVI20IntrepidControlSystems,IIntrepidBoardTwoCANtransceiverswithtestpointsTworesetbuttons21IntrepidControlSystems,IQuiz21.CANbusrequiresterminationof1200Ohm(TrueorFalse)2.CANrequiresthreelines:
CANlow,CANHighandground(TrueorFalse)3.SinglewireCANisingeneraltheslowestCANtype.(TrueorFalse)22IntrepidControlSystems,ICANDataFrameTypicalCANmessageiscalleddataframeNumberofdatabytes:
0-8CANDataFrameProtocolOverheadDataBytesProtocolOverhead24IntrepidControlSystems,ICANFrameFieldsArbitrationfieldrepresentsframeIDControlfieldhasdefinesframelengthCRCstandsforCyclicRedundancyCheck:
thisisCANframechecksumACKisacknowledgefield:
confirmsframereceptionCANDataFrameDataBytesArbitrationFieldControlFieldCRCACK25IntrepidControlSystems,IArbitrationFieldIdentifierassigns11bitIDtoCANframesRemoteTransmitRequest(RTR)bitCANnodesendsCANframewithrecessiveRTRbit(logical1)whenthenoderequestsdatafromothernodesDataBytesControlFieldIdentifierRTR111ArbitrationFieldCRCACK26IntrepidControlSystems,ICANRemoteFrameIdenticaltotheDataFrame,exceptthereisnodatabytesRTRbitisrecessive(logical1)ControlFieldCRCACKArbitrationField27IntrepidControlSystems,IControlFieldDLCspecifiesnumberofdatabytes:
0-8RB0bitissettological0andreservedforthefutureprotocolsIDEbitdefinesdataframetype:
standardIDorextendedIDdataframeIDEbits:
dominantforstandardandrecessiveforextendeddataframeDataBytesIdentifierIDEControlField114RB0DLCCRCACK28IntrepidControlSystems,IExtendedDataFrameSimilartostandarddataframeIdentifieris29bitslongIdentifierissplitintotwoparts:
ID1andID2DataBytesSRR1111181IDEID1CRCACKID2RTRArbitrationFieldControlField29IntrepidControlSystems,IStandardandExtendedFramesDataBytesControlFieldIdentifierRTR111CRCACKDataBytesSRR1111181IDEID1CRCACKID2RTRArbitrationFieldControlFieldArbitrationField30IntrepidControlSystems,ICRCFieldCRC:
CyclicRedundancyCheckCRCiscalculatedandputonthebusbytransmittingnodeCRCiscomputedagainbythereceivingnode:
ifitdoesnotmatch,thenanerrorframeissentandthedataframeissentagainbythetransmitter.CRCfieldis15bitlongandhas1bitdelimiterDelimiteralwaysshouldbelogical1DataBytesArbitrationFieldControlFieldCRCACKDel31IntrepidControlSystems,IACKFieldACK:
AcknowledgefieldIfCANnodereceivedthemessagecorrectlyitshouldsetACKbitasdominantbit(logical0)AtleastonereceivershouldsetACKtodominantbit.Ifnot,anerrorframeifgeneratedandthetransmitterresendstheframeACKdelimiter:
1bitalwaysshouldbelogical1DataBytesArbitrationFieldControlFieldCRCACKDelDel32IntrepidControlSystems,ILab2:
ObjectivesGetfamiliarwithWaveBPSsoftwareConnectedWaveBPStoIntrepidboardusingtheoscilloscopeRunWaveBPSandmonitorCANwaveformscomingfromtheboardIdentifyCANhighandCANlowlinesMeasureonebitlengthintimeandcomputecorrespondingCANbaudrate33IntrepidControlSystems,IQuiz31.Whatisthemaindifferencebetweenaremoteframeandadataframe?
2.ControlfieldcontainsthenumberofCANdatabytes(TrueorFalse)3.WhatisthemaindifferencebetweenastandardandextendedCANframes?
4.IfanodereceivedaCANframecorrectly,howwouldthisaffectACKfieldoftheframe?
34IntrepidControlSystems,ICANArbitrationAnynodecantransmitwhenbusisfreeMultiplenodetransmissionisresolvedbybitwisearbitrationusingIDfieldNondestructiveframearbitration36IntrepidControlSystems,ICANArbitrationHigherpriorityframeswinarbitrationDataframeswinarbitrationoverremoteframesNodesalwaysmonitorthebusIfthereisadominantbitonthebus,andanodewantstosendarecessivebit,thenodelosesarbitration37IntrepidControlSystems,I1011001101110110010011LSBMSBNodewantstosendCANframewiththisID:
OthernodeID:
CANArbitrationExample38IntrepidControlSystems,IStartandEndofFrameAlldataandremoteframeshavestartandendwaveformsStartofframeis1dominantbitEndofframe(EOF)is7recessivebitsIntermissionfieldis3recessivebits:
overloadframecanbesentduringthefirstintermissionbitCANDataorRemoteFrameStartBitEOFINTIdleBus39IntrepidControlSystems,IOverloadFrameOverloadframeissentwhenreceiverrequiresadelay,orDominantbitwasdetectedduringintermissonAtmosttwooverloadframescanbegeneratedtodelaynextdataorremoteframeOverloadflagfromnodesis6bitshighOverloadframeSuperpositionofoverloadflagsfromnodes(6bitsdom.)Delimiter6-12bits8bitsHighEOF40IntrepidControlSystems,IErrorFrameErrorframeissentwhenanodedetectserrorconditiononthebusActiveErrorflagfromnodesis6bitshighErrorframeSuperpositionofoverloadflagsfromnodes(6bitsdom.)Delimiter6-12bits8bitsHighEOF41IntrepidControlSystems,IChecksumErrorCRCiscomputedbytransmitterandputonthebusReceivingnodecalculatesCRCandcomparesitwithCRCfieldIfCRCdoesnotmatch,errorframeisgeneratedandtransmitterresendsthemessageCANDataFrameDataBytesArbitrationFieldControlFieldCRCACK42IntrepidControlSystems,IAcknowledgeErrorAtleastonereceivermustsetACKbitdominantIfnot,anerrorframeisgeneratedandthetransmitterresendsthemessageDataBytesArbitrationFieldControlFieldCRCDelACK43IntrepidControlSystems,IFormErrorCondition:
fixedformfieldshaveillegalbits:
dominantbit(logical0)isdetectedinthedelimiters,EndofFrame(EOF)orinter-framespaceTransmitterthensenderrorframeandresendsthemessageCANDataorRemoteFrameEOFINTIdleBusDelDel44IntrepidControlSystems,IStuffErrorCondition:
6consecutivebitsofthesamestateinnon-fixedformfieldsCANbitstuffingalgorithminsertsadditionalbitsintoCANframetomakesurethereisnomorethan5consecutivebitsofthesamelevelThetransmitterresendsthemessageCANDataFrameDataBytesArbitrationFieldControlFieldCRCACK45IntrepidControlSystems,IBitErrorCondition:
transmittermonitorswhatitsendsanddetectsabitstateoppositetowhatitputonthebusExcludeArbitrationandACKfieldCANDataFrameDataBytesArbitrationFieldControlFieldCRCACK46IntrepidControlSystems,IFaultConfinementWhathappenswhentransmitterdetectsanerrorandkeepssendingerrorframes?
Endlessloopp
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CAN 通讯 协议 介绍