欢迎来到天天文库
浏览记录
ID:5994569
大小:111.39 KB
页数:4页
时间:2017-12-30
《bit timing(can总线bt时间确定-用于确定波特率)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Bittiming(can总线BT时间确定-用于确定波特率)CANhasadvancedfeaturesforcopingwiththetimedelaysfoundinlongbuslengths(incomparisontothebitrate)andcopingwithdifferencesinclockchrystalfrequenciesfornodesonthebus.Thechoiceofbittimingisveryimportantsinceitdecidesthebitrate,thesample
2、pointandtheabilitytoresynchronise.Bitsegments(asinBoschstandard)Eachbitisdividedintofoursegments-thesynchronisationsegment,thepropagationsegmentandthephasesegmentsoneandtwo.Eachsegmentconsistsofoneormoretimequanta.Atimequantumisafixedamountoftimewhichisderivedf
3、romtheCANcontrollerclockwithaprescalefactor.Synchronisationsegment(Synch_Seg)Thesynchronisationsegmentisusedtosynchronisethevariousnodesonthebus.Whenabitissentonthebus,theleadingedgeisexpectedtobewithinthissegment.Thissegmentisalwaysonetimequantumlong.Propagati
4、onsegment(Prop_Seg)ThePropagationSegmentisneededtocompensateforthedelayinthebuslines.Thesegmentsizeisprogrammablebetween1and8timequanta.PhaseSegment1(Phase_Seg1),PhaseSegment2(Phase_Seg2)Thesesegmentscanbeusedlengthenedorshortenedbyresynchronisation.Bitsegments
5、(asinimplementationslikeIntel527andC167CR)InmostimplementationsofCANcontrollersthesegmentsseemtobeimplementedinadifferentwaythandescribedinthestandard.Thesynchsegmentlooksasinthestandardandconsistsofonetimequantum.Thebigdifferenceisthatthepropagationsegmentandt
6、hephasesegment1inthestandardhavebeencombinedintoonesegment,TSEG1.Phasesegment2isleftuntouched,butisrenamedtoTSEG2.Normallythereisonlyonesamplepointforeachbit.Inthiscase,thesamplepointisintheedgebetweenTSEG1andTSEG2.However,someCANcontrollerscanalsosampleeachbit
7、threetimes.Inthiscase,thebitwillbesampledthreequantainarow,withthelastsamplebeingtakenintheedgebetweenTSEG1andTSEG2.Threesamplesshouldonlybeusedforrelativelyslowbaudrates.CalculationofbaudrateandsamplepointBaudrateThebaudrateofthebuscanbecalculatedfrom:Baudrate
8、=fcrystal/(2*n*(BRP+1))wherenisthenumberoftimequantaforonebitandisdefinedas:n=SYNCHSEG+TSEG1+TSEG2BRPisthevalueoftheBaudRatePrescaler.Warning:someCANcontrollers(likeIntel526
此文档下载收益归作者所有