periodjavlibrary.com

javlibrary.com  时间:2021-03-19  阅读:()
FreescaleSemiconductorApplicationNoteDocumentNumber:AN3333Rev.
0,11/2006ContentsFreescaleSemiconductor,Inc.
,2006.
Allrightsreserved.
1IntroductionTheXGATEsignalgatewaypackageisacollectionofheaderandsourcefilesintheCprogramminglanguage,enablingyoutocreateaCANandLINsignallevelautomotivebodygateway.
Thegatewaystructuredetailedinthisapplicationnoteisflexibleenoughtoallowextensionsand/ormodificationstosatisfyaparticularenvironment'srequirements.
2SignalGatewayTheoryNoindustry-widestandardcurrentlyexistsforautomotivebodygateways.
Eachvehiclemanufacturermaintainshisorherownsetofevolvingspecificationsofthetrafficagatewayhandles.
Thissectionoutlinesonesetofspecifications.
Thesespecificationsarenotbasedonrequirementssetbyanyspecificvehiclemanufacturer.
TogaininsightintotheXGATEperformance,thissetrepresentsmeaningfulbasicbodygatewayrequirementsenablingareal-worldgatewaytobeimplemented.
1Introduction12SignalGatewayTheory12.
1ThePurposeofGateways.
22.
2DataRepresentation32.
3GatewayDataFlow43GatewayImplementation.
73.
1DataStructures73.
2Algorithms143.
3LimitationsofThisGatewayImplementation.
234PerformanceAnalysis234.
1XGATELoad234.
2RequiredMemorySize325GeneratingtheDescriptors345.
1GeneratedFiles.
345.
2NodeDataWorksheet355.
3RxFramesWorksheet.
355.
4TxFrameWorksheet.
375.
5GeneratingtheSourceFiles386References38XGATELibrary:SignalGatewayImplementingCANandLINSignalLevelGatewayby:DanielMalikMCDApplicationsEastKilbride,ScotlandXGATELibrary:SignalGateway,Rev.
0SignalGatewayTheoryFreescaleSemiconductor22.
1ThePurposeofGatewaysInthepastdecade,theautomotiveindustryhasseenincreaseddemandforsafetyfeatures,increasedpressuretoreduceenvironmentaleffectscausedbyde-processingvehicles,andincreasedexpectationsformoderntechnology(suchasnavigationsystemsormobilecommunications)tobecomestandardeveninlower-endmodels.
Thesechangesarepartiallycausedandpartiallyenabledbythedecreasingcostofsemiconductorsolutionsofferedtoautomotivemanufacturers.
Keyautomotivetechnologieshavedevelopedfromnetworkedsystemstodistributedsystems.
Thedifferentin-vehiclesystemsusedifferentnetworkingtechnologies;however,thetraditionalcontrollerareanetwork(CAN)developedbyRobertBoschGmbHin1986isstillattheheartofmany.
Theneedforcost-optimized,low-speedbuseshasledtothedevelopmentofalocalinterconnectnetwork(LIN)typicallyusedforseatmanagementanddoorsub-systems(locks,windows,mirrors,etc.
).
Independentbuses(asopposedtoasinglebusinterconnectingallsystemsinthewholevehicle)areusedinindividualvehiclesystemsforseveralreasons:Applicationrequirementsmayresultindifferentcommunicationspeedsfordifferentsystems(500kbpsforpowertrainvs.
125kbpsfordashboard).
Thephysicallayerofthebusesmaynotbecompatible(LINvs.
CAN,low-speedCANvs.
high-speedCAN,etc.
).
Physicalseparationofthebusesmayberequiredforsecuritypurposes.
Systemssharinglittleinformationmayusephysicallyseparatebusestolowertheamountofunnecessarytraffic.
Thegatewayapplication'spurposeistotransferinformationamongthevehicle'sdifferentbusestoensureallsystemsreceivetherequiredinformationinatimelymanner.
Forexample,thedashboardisdesignedtodisplay(amongotherinformation)thecurrenttemperatureoftheenginecoolant.
Itisthegateway'sresponsibilitytoensurethetemperatureinformationpresentonthepowertrainbusisre-transmittedonthebodybus(seeFigure1).
Figure1.
GatewayApplicationExampleCANPHYHCS12XXGATECANPHYCANPHYCANPHYCANPHYLSCANBodyHSCANTelematicsHSCANPowertrainHS/LSCANChassisHSCANDiagnosticLINPHYLINPHYDoormodules-rightsideDoormodules-leftsideDirectloadsSwitchpanelFrontlightingSteeringcolumnSwitchpanelsWipersPowerseatsRainsensorandsunroofLINPHYLINPHYSignalGatewayTheoryXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor32.
2DataRepresentationToassessthetaskofthegatewayapplication,theusermustunderstandhowinformationisrepresentedonthedifferentbuses.
2.
2.
1MessageGatewayingThecommonpropertyofLINandCANframesisthattheycantransportuptoeightdatabytes.
Thesimplesttaskforthegatewayistoreceiveaframeononebusthenre-senditonanotherbusinitsentirety.
Thisprocessisusuallyreferredtoasmessagegatewayingoras1:1frameforwardingandistypicallyusedfordiagnosticpurposes.
Indiagnosticmode,thegatewayextractsasetofframesfromthedifferentbusestowhichitisconnected.
Theseframesarethenre-transmittedonthediagnosticbustowhichthegaragediagnosticequipmentisconnected.
Thegatewayalsoreceivesframesfromthediagnosticequipmentandforwardsthemtothedifferentvehiclesystems(foradjustmentofengineparameters,firmwareupgrade,etc.
).
2.
2.
2SignalsMessagegatewayingisefficient;however,itcanbeusedonlyifthedestinationapplicationcanprocesstheoriginalframewithoutanytransformation.
Anotheraspectisthebusload.
Apieceofinformationisrarelytransmittedaloneinitsownframe.
Itiscommontoconcatenatemoredataintoasingleframe.
Forexample,theenginecoolanttemperature,theoiltemperature,andtheintake-airtemperaturemightbeconcatenatedtogetherandtransmittedinasingleframeonthepowertrainbus.
Ifthedestinationapplicationneedsonlyonebyteofinformationfroman8-bytelongframe,theremainingsevenbyteswouldbetransmittedunnecessarilyandcontributeonlytodummyloadofthedestinationbus.
Thepiecesofinformationtransportedintheframesarecalledsignals.
Asignalcanbebetweenonebit(binaryon/offinformation)and64bits(afull8-byteframe)long.
2.
2.
2.
1SignalCopyThebulktaskforthegatewayistoextracttherequiredsignalsfromthereceivedframes,re-packthemtoformnewframes,andtransmittheseontheirdestinationbus.
ThisprocessisoutlinedinFigure2.
Figure2showsthesignalbits(inblue)receivedina4-bytesource(Rx)frame.
Thegateway'staskistotransportthissignaltoitsdesignatedpositionwithinthe3-bytedestination(Tx)frameinpreparationforthedestination-frametransmission.
Figure2.
CopyofaSignalfromSourceFrametoDestinationFrameRxTxXGATELibrary:SignalGateway,Rev.
0SignalGatewayTheoryFreescaleSemiconductor42.
2.
2.
2BigandLittleEndianFigure2omitsanybitandbytenumberswithintheRxandTxframes.
Microprocessormanufacturershavebeendividedintotwomajorgroups,dependingonhowtheirproductsaccessmulti-byteentitiesintheiron-chipandoff-chipmemories.
Microprocessorsstoringthemostsignificantbyteonthelowestaddressareknownasbigendianarchitectures.
Conversely,thelittleendianmicroprocessorsstorethemostsignificantbyteonthehighestaddress.
TheHCS12Xmicrocontrollerfamilybelongstothebigendiangroup.
TheCPUorXGATEcanworkwithdatastoredinthelittleendianformat;however,careisrequiredinsuchacase.
ThedifferencebetweenlittleandbigendianarchitecturesisdepictedinFigure3,whichshowsan11-bitlongsignalstoredintwoconsecutivebytesinmemory.
Figure3.
TheDifferenceBetweenSignalMemoryLayoutinBigandLittleEndianThedifferencebetweenthetwodataorganizationsisapparentwhenweattempttointerpretthedatanotasindividualbytesbutasastreamofbits.
Whenbytesaredepictedhorizontally,itiscommontokeeptheleastsignificantbit(LSB)ontherightandthemostsignificantbit(MSB)ontheleft.
However,thisonlyworksforthebigendiandataorganization(Figure4).
Tokeepthebitsbelongingtothesignaltogether,theorderofbitsinbytesmustbereversedforthelittleendianorganization.
Theconsequencesofthesebit-orderingrequirementsarediscussedfurtherinSection3.
1.
1,"BitandByteNumberinginBuffers.
"Figure4.
InterpretingBigandLittleEndianDataasStreamsofBits2.
3GatewayDataFlowThissectiondescribesthedataflowthroughthegateway.
Itoutlineshowthegatewayapplicationshouldreacttoincomingsignalsandwhenandhowtheoutgoingsignalsshouldbetransmitted.
MSBADDR+0ADDR+0ADDR+1ADDR+1LSBBigEndianLittleEndianLittleEndianMSBMSBMSBMSBMSBMSBMSBMSBADDR+0ADDR+1LSBLSBLSBLSBLSBLSBLSBLSBBigEndianLittleEndianBigEndianMSBfirstLSBfirstSignalGatewayTheoryXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor52.
3.
1ReceptionWheneveranyinterface(node)receivesadataframe,thegatewaymustcheckwhethertheframeshouldbeprocessed(theremightbetrafficonthebusesirrelevanttothegatewayprocess).
Incasetheincomingframewillbefurtherprocessed,thegatewaymustlookupthesignalinformation.
Thisincludespositionsoftheindividualsignalscontainedinthereceivedframeandtheirsizes.
Afterthepositionsandsizesofsignalsintheincomingframeareidentified,thegatewaycanstartthesignalcopyprocess.
ThisinvolvescopyingthesignalsfromtheRxbuffertothedestinationTxbuffersinpreparationofsignaltransmissions.
Eachsignalcanhavemorethanonedestination(forexample,asignalcontainingthevehiclespeedmustbeforwardedtothedashboardforindicationaswellastheaudiosystemforvolumeadjustmentpurposes).
Thegatewaydoesnotkeepacopyofthereceivedframes.
AfterallthesignalsfromtheRxframearecopiedintotheTxbuffers,theRxframecontentsarediscarded.
Undernormalcircumstances,amajorityoftheframesarepresentonthebusesperiodically.
Ifaframeceasestobereceived,itisusuallyasignofasystemoverloadorfailure.
Thegatewayapplicationmustbecapableoftrackingthereceptionfrequencyforeachframe.
TherearetwokindsoftimeoutsdefinedfortheRxframes.
Afterthefirst(shorter)timeout,thegatewayrecognizesthatareceptionofaframeislateandthatsignalvaluesstoredintheTxbuffersareout-of-dateandpotentiallyincorrect.
Toindicatethis,thegatewaycansetaflag(aone-bitsignal)inoneoftheTxbuffers.
Afterthesecond(longer)timeoutwithoutreceptionofaframe,thegatewayconsiderstheframesourcetohavemajordifficultiesinmeetingitsrequirements.
Theactiontakendependsonthefailingsystem'sfunctionandcannotbegeneralized(thatis,afailureoftheentertainmentsystemisinconvenient,butafailureoftheairbagsystemispotentiallylifethreatening).
Figure5depictsthereceptionprocess.
Figure5.
GatewayReceptionProcessRxTimerByte0GatewaydatabaseCRCDATAIDRxByte1ByteNTxbuffersXGATELibrary:SignalGateway,Rev.
0SignalGatewayTheoryFreescaleSemiconductor62.
3.
2TransmissionThegatewaytransmitsamajorityofTxframesperiodically.
Thetransmissionisindependentofthereceptionprocess,andthegatewaykeepsanup-to-datecopyofalltransmittedframes.
ThegatewaykeepsatimerforeachTxframeandtransmitstheframewhenthetimerexpires(andreloadsthetimerautomaticallywiththespecifiedperiod).
Figure6outlinesthisprocess.
Figure6.
PeriodicFrameTransmissionIncertaincases,thesignalsshouldbetransmittedwithoutwaitingforthenextperiodictransmission.
ThegatewayoffersthepossibilitytotransmitaTxframeassoonasanyofitssignalsarereceivedandprocessed(Figure7).
Figure7.
PeriodicFrameTransmissionwithImmediateTransmissionuponSignalReceptionIncertaincases,itisimportanttotransmitthesignalsassoonaspossiblewithoutwaitingforthenextperiodictransmissiononlyifthevalueofthesignalhaschanged.
ThegatewaysupportsanoptiontotransmittheTxframeafteranyofitssignalschangesvalue(Figure8).
RxTxTxTxTxperiodtimeTxperiodtimeRxTxTxTxTxTxTxperiodTxperiodTxperiodGatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor7Figure8.
PeriodicFrameTransmissionwithImmediateTransmissionuponSignalValueChangeFrametransmissioncanalsobesettohappenonlyaftersignalreception(withorwithoutvaluechange).
Framestransmittedthiswayarecalledsporadicframes.
Thegatewayapplicationmaintainsatransmissionqueueforeachnodetoresolvesimultaneoustransmissionofmorethanoneframe.
2.
3.
3LINConsiderationsThegatewayapplicationisexpectedtoactasaLINmaster:itmustinitiatealltransfersthroughtheLINnodes.
ThebehavioroftheRxtimersnormallyusedfortimeoutprocessingischangedincaseofLINnodesbecausetheyareusedtotriggerthereceptionofframesfromLINslavesinstead.
3GatewayImplementationThissectiondescribesaparticularimplementationofthegatewayapplicationfortheXGATEco-processor.
TheimplementationmakessomelimiteduseofthespecialXGATEproperties;however,amajorityofthecodeiswritteninANSIClanguage.
3.
1DataStructuresThissectiondescribesthedatastructuresusedinthegatewayapplication.
Thegatewaybehaviorisfullydescribedbythesedatastructures'content(thegatewaydatabase).
Thesamesetofuniversalalgorithmsprocessesallincomingandoutgoingsignals,andthegatewaydatabasedescribeshowthedifferentsignalsaredealtwith.
Noneofthesignal-specificbehaviorsarehard-codedinthealgorithms.
Figure9isanoverviewofthedatastructuresthegatewayapplicationuses.
timeRxRxTxTxTxTxTxTxperiodTxperiodTxperiodXGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor8Figure9.
OverviewofGatewayDataStructures3.
1.
1BitandByteNumberinginBuffersAsdescribedinSection2.
2.
2.
2,"BigandLittleEndian,"careisrequiredregardingbigandlittleendiandatastorageproperties.
Thegatewayapplicationcanefficientlydealwithbothencodings;however,thetwoencodingscannotbemixed.
Intheimplementation,thechoicemustbemadeatthetimeofcompilation.
Thebigendiandataorganizationisselectedbydefault;thelittleendiandatastoragecanbeselectedbythedefiningsymbolLITTLE_ENDIAN.
3.
1.
1.
1BigEndianFigure10showsthebitandbytenumberingschemeusedforframesinbigendianformat.
Thebytesareintheusualformat:MSBontheleft,LSBontheright.
However,bitnumber0istheMSBofbyte0,andbitnumber63istheLSBofbyte7.
FrameswithbytesfewerthaneightarealignedtoADDR+0(forexample,a3-byteframecontainsbytes0,1,and2).
Figure10.
BitandByteNumberingSchemeforBigEndianDataStorageNodedescriptorsCANnodesLINnodesRxframedescriptorsLINnodedescriptorsSignalandSignaldest.
descriptorsTxframedescriptorsTxdatabuffersMSBMSBADDR+0ADDR+1LSBLSBMSBMSBMSBLSBLSBLSBADDR+2ADDR+7Bitnumber:Bytenumber:012345678151623245556630127GatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor93.
1.
1.
2LittleEndianFigure11showsthebitandbytenumberingschemeusedforframesinlittleendianformat.
Thebytenumberingisthesameasforbigendianformat,buttheorderofbitsinbytesisdifferent:bitnumber0istheLSBofbyte0,andbitnumber63istheMSBofbyte7.
Figure11.
BitandByteNumberingSchemeforLittleEndianDataStorage3.
1.
2TimerStructureThetimerstructure(tTimer)isusedforallRxandTxtimersinthegatewayapplication.
Itcontainsan8-bitdown-counterandan8-bitreloadvalue.
Thedown-counterisreloadedwhenitisdecrementeddowntoavalueofzero.
Thefrequencyofdecrementingthedown-counterisdefinedoutsideofthisstructure.
Thetimerstructureoccupiestwobytesofmemoryspace.
Timerstructure:typedefstruct{unsignedcharload_value;unsignedcharcounter;}tTimer;3.
1.
3SignalDestinationDescriptorThesignaldestinationdescriptor(tSignalDestDescr)describesintowhichTxbufferasignalshouldbecopiedandtowhatposition.
Thepositionmemberissixbitslong,coveringanybitpositionofthesignalbetween0and63.
Theframe_nomemberistenbitslong,allowingreferencingupto1024Txbuffers.
Thesignaldestinationdescriptoroccupiestwobytesofmemoryspace.
Signaldestinationdescriptor:typedefconststruct{unsignedintframe_no:10;unsignedintposition:6;}tSignalDestDescr;3.
1.
4SignalDescriptorThesignaldescriptor(tSignalDescr)structureholdsinformationaboutanincomingsignal.
ItdescribesitspositionintheRxbuffer(position)anditssize(size)inbits.
Thestructurealsocontainsinformationaboutthenumberofdestinationsthesignalmustbecopiedintouponreception(dests_no).
Signaldescriptorstructure:typedefconststruct{unsignedintposition:6;unsignedintsize:6;unsignedintdests_no:4;}tSignalDescr;MSBMSBADDR+0ADDR+1LSBLSBMSBMSBMSBLSBLSBLSBADDR+2ADDR+7Bitnumber:Bytenumber:012345678151623245556630127XGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor10Todescribetheoperationsnecessarytobeperformedafterthereceptionofasignal,thesignaldescriptorisalwaysfollowedinmemorybytheappropriatenumberofsignaldestinationdescriptors(Figure12).
Figure12.
HowSignalDestinationDescriptorsFollowSignalDescriptor3.
1.
5RxFrameDescriptorTheRxframedescriptor(tRxFrmDescr)describesanincomingframe.
Thestructurecontains:FrameID(ID)—Bywhichtheincomingframeisassociatedwithitsdescriptor.
Expecteddatapayloadoftheframe(DataSize)—Anerrorhandlerexecuteswhenlessthantheexpectednumberofbytesisreceived.
Rxtimerprescaler(RxTimerPrescaler)andRxtimer(RxTimer)—Theprescalerisfivebitslong;however,aspecialalgorithmallowsdecadicdivisionratioswhilekeepingtheXGATEloadatalowlevel.
Thepossibleprescalerratiosare1,2,10,and20.
(Section3.
2.
5,"HandlingofRxandTxTimers,"furtherexplainsthealgorithm.
)Numberofsignalscontainedintheframe(SignalCount)andapointertothefirstsignaldescriptor(pSignalDescr)—Figure12showshowsignaldestinationdescriptorsfollowthesignaldescriptor.
IftheRxframecontainsmorethanonesignal,thesecondsignaldescriptor(anditsdestinationdescriptors)followsthefirstsignal'slastdestinationdescriptor.
Figure13depictstheorganizationofthedescriptorsinmemory.
Timeoutfailureindicatorenable(RxToutFailEn)andtimeoutfailureindicatorposition(RxToutFailPos)—WhenanRxtimeoutisdetected,thegatewaycansetanindicatorbitintheTxbufferpointedtobythefirstsignaldestinationdescriptorofthefirstsignal.
TheindicatorisclearedwhentheRxframeisreceivedagain.
(SeeSection2.
3.
1,"Reception,"andSection3.
2.
5,"HandlingofRxandTxTimers.
")Timeoutcounter(RxToutCntr)andtimeoutcounterreload(RxToutReload)TxbufferRxbuffer.
.
.
.
.
positionpositionpositionframe_noframe_nodests_nosizeGatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor11—ThetimeoutcounterisdecrementedeverytimetheRxtimerexpires(atimeoutisdetected).
Thetimeouthandlerroutineiscalledafterthetimeoutcounterisdecrementeddowntozero.
Bytecopyindicator(byte_copy)—Enablesfastercopyofsignalsthatspanwholebytes.
Thisfeatureisusuallyusedformessagegatewaying,whereasinglesignalisdefinedwhichspansthewholedatapayload.
Thisindicatorspeedsupthesignalcopyprocess.
(SeeSection4.
1.
1.
2,"SignalCopy,"forperformanceimplications.
)Rxframedescriptorstructure:typedefstruct{unsignedintID:11;/*FrameID*/unsignedintRxTimerPrescaler:5;/*prescalleroftheRxTimer*/tSignalDescr*pSignalDescr;/*pointertoSignaldescriptors*/unsignedintDataSize:4;/*expecteddatasizeforthisframe*/unsignedintSignalCount:8;/*numberofsignals*/tTimerRxTimer;/*Rxtimeout*/unsignedintbyte_copy:1;/*bytecopyofdata*/unsignedintRxToutFailEn:1;/*enableoftheout-of-datebitassertion*/unsignedintRxToutFailPos:6;/*positionoftheout-of-datebit*/unsignedintRxToutReload:4;/*timeoutcounterreload*/unsignedintRxToutCntr:4;/*timeoutcounter*/}tRxFrmDescr;Theimplementationofthetwotimeoutconditions(Section2.
3.
1,"Reception")makestheirtimingdependoneachother.
TheRxtimerloadvaluedefinestheshortertimeout(afterwhichthefailureindicatorisset).
Thelongertimeout(afterwhichthetimeouthandlerroutineiscalled)isdefinedasamultipleoftheshorttimeout.
Thetimeoutcounterreloaddefineshowmanyshorttimeoutsmustoccurbeforealongtimeoutisdetected.
TheRxframedescriptorsarestoredinmemoryinanarray.
Thesearchalgorithmrequiresthatthearrayissorted(inascendingorder):1.
Bythenumberofthenodethroughwhichtheframeisreceived2.
ByframeIDAsinglenode'sRxframedescriptorsaregrouped.
Withinagroup,thedescriptorsaresortedbyframeID.
Thisenablestheuseofafastsearchalgorithm;thegatewayfunctionalityisnotcompromised.
XGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor12Figure13.
MemoryFootprintofSignalandSignalDestinationDescriptors3.
1.
6TxFrameDescriptorTheTxframedescriptor(tTxFrmDescr)describestheoutgoingframes.
Thestructurecontains:FrameID(ID)—Transmittedaspartofframe.
Nodenumber(node)—IdentifieswhichCANorLINnodetheframeshouldbetransmittedthrough.
Txtimerprescaler(TxTimerPrescaler)andTxtimer(TxTimer)—Specifytransmissionperiodinperiodictransmissionmodes(Section2.
3.
2,"Transmission"andSection3.
2.
5,"HandlingofRxandTxTimers").
Datasize(DataSize)—Specifiesthenumberofbytestobetransmittedasthedatapayloadoftheframe.
Immediatetransmissionuponanysignalreceptionindicator(TxonRx).
(Section2.
3.
2,"Transmission")Immediatetransmissionuponanysignalvaluechangeindicator(TxonDataChg).
(Section2.
3.
2,"Transmission")Transmissionscheduledindicator(TxScheduled)—Flagservingasaninterlocktoensuretheframecanbescheduledfortransmissiononlyoncebeforeitistransmittedthroughtheappropriatenode.
(Section3.
2.
4,"TransmissionofFrames").
.
.
.
.
.
positionpositionpositionframe_noframe_nodests_nosize.
.
.
.
.
positionpositionframe_nodests_nosizeIDRxTimerPrescalerPSignalDescrDataSizeSignalCountRxTimerByte_copyRxToutFailEnRxToutFailPosRxToutReloadRxToutCntrRxFrameDescriptorSignal#1DescriptorSignal#1DestinationDescriptor#1Signal#1DestinationDescriptor#2Signal#2DestinationDescriptor#1Signal#2DescriptorGatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor13Txframedescriptorstructure:typedefstruct{unsignedintID:11;/*IDoftheframe*/unsignedintnode:5;/*nodenumber*/tTimerTxTimer;/*Txperiodictimer*/unsignedchar*Data;/*pointertothedatabuffer*/unsignedintTxTimerPrescaler:5;/*prescalleroftheRxTimer*/unsignedintDataSize:4;/*datasizeforthisframe*/unsignedintTxonRx:1;/*transmitframeondatareception*/unsignedintTxonDataChg:1;/*transmitframeondatachange*/unsignedintTxScheduled:1;/*transmissionisscheduled*/}tTxFrmDescr;3.
1.
7NodeDescriptorThenodedescriptor(tNodeDescr)describestheindividualnodesthroughwhichtheframesarereceivedandtransmitted.
Thestructurecontains:Addressoftheperipheral(periph_addr)—ThevalueistheMSCANperipheral(CANnode)addressortheLINnodedescriptor(LINnode)address.
PointertothefirstRxframedescriptor(rx_idx_start_p)andthenumberofframedescriptors(rx_idx_cnt)belongingtothisnode—ThesepiecesofinformationdelimitthespacewithintheRxdescriptortablethesearchalgorithmneedstomovethroughtoidentifyframedescriptorofanyreceivedframe.
Peripheraltype(periph_type)—Identifiesperipheraltypethenodeuses.
Transmissionqueuepointer(TxBuffer),indexofthefirstitem(TxBufferTake),indexofthefirstemptyslot(TxBufferAdd),andsizeofthequeue(TxBufferSize)—Managetransmissionqueue.
SeeSection3.
2.
1,"ReceptionofFrames"andSection3.
2.
4,"TransmissionofFrames,"forfurtherdetails.
Nodedescriptorstructure:typedefstruct{unsignedintperiph_addr;/*addressoftheperipheral*/tRxFrmDescr*rx_idx_start_p;/*pointertothefirstRxdescriptor*/unsignedintrx_idx_cnt;/*numberofRxdescriptorsforthisnode*/unsignedcharperiph_type;/*peripheraltype*/unsignedcharTxBufferAdd;/*indexafterthelastentryinthequeue*/unsignedcharTxBufferTake;/*indextothefirstentryinthequeue*/unsignedcharTxBufferSize;/*sizeoftheTxqueue*/tTxFrmDescr**TxBuffer;/*pointertotheTxqueue*/}tNodeDescr;Implementedperipheral(node)types:enumperiph_types{MsCan,Lin};XGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor143.
1.
8LINDataStructuresFulldescriptionofLINmasternodeimplementationontheHCS12Xarchitectureisbeyondthescopeofthisdocument.
ThegatewayapplicationusesLINmasterimplementationdescribedinFreescale'sapplicationnote,AN2732:"UsingXGATEtoImplementLINCommunicationonHCS12X.
"TocalculatetherequiredmemorysizeoftheLINnodedescriptorstructure,seeLINnodedescriptor:typedefstruct{tSCI*pSCI;/*pointertotheSCIperipheral*/unsignedintchecksum;/*checksum*/unsignedchardata[8];/*bufferforTxandRxdata*/unsignedcharId;/*LINidentifiertobetransmitted*/unsignedchardir:1;/*direction:Rx=0;Tx=1*/unsignedcharlen:4;/*lengthofframe*/unsignedcharstate;/*stateoftheLINstatemachine*/signedchartimer;/*Rxtimeoutcounter*/unsignedchar*data_p;/*pointertoLINframedata*/}tLINnode;3.
2AlgorithmsThissectiondescribesthealgorithmsusedinthegatewayapplication.
Thegatewayapplicationhasfiveentrypoints:MSCANRxinterrupt—MSCANmoduleraisesthisinterruptrequestwhenitreceivesamessage.
ThealgorithmprocessingincomingframesisdiscussedinSection3.
2.
1,"ReceptionofFrames.
"MSCANTxbufferemptyinterrupt—MSCANmoduleraisesthisinterruptrequestwhenaTxbufferbecomesemptyafterasuccessfulframetransmission.
ThealgorithmusedfortransmittingframesisdiscussedinSection3.
2.
4,"TransmissionofFrames.
"Gatewaytiminginterrupt—Thegatewayapplicationusesonechanneloftheperiodicinterrupttimer(PIT)totimeallRxandTxoperations.
ThealgorithmformanagingtheRxandTxtimersisdescribedinSection3.
2.
5,"HandlingofRxandTxTimers.
"SCIRxbufferfull/Txbufferemptyinterrupt—TheLINmasteralgorithmusesSCIinterrupts.
TheoperationoftheLINalgorithmisdescribedinFreescale'sapplicationnote,AN2732:"UsingXGATEtoImplementLINCommunicationonHCS12X.
"LINtiminginterrupt—TheLINalgorithmusesanotherPITchanneltodetectoccurrencesofLINRxtimeouts.
TheoperationoftheLINalgorithmisdescribedinFreescale'sapplicationnote,AN2732:"UsingXGATEtoImplementLINCommunicationonHCS12X.
"3.
2.
1ReceptionofFramesWhenweconsiderthedataflow,thenthereceptionalgorithmsaretheentrypointsofthegatewayapplication.
Therearetworeceptionalgorithms,oneforeachcommunicationprotocol:CANandLIN.
3.
2.
2ReceptionofCANFramesFigure14outlinesthealgorithmforprocessingreceivedCANframes.
GatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor15Figure14.
AlgorithmforProcessingofReceivedCANFramesOntheCANbus,framesarereceivedasynchronously.
Thegatewayapplicationcannotrelyonspecificframesbeingreceivedatspecifictimesorinaspecificorder.
Theonlyidentificationisthereceivedframe'sID.
Therefore,thealgorithmfirstsearchesthegatewaydatabaseofRxframedescriptorstofindinformationaboutthereceivedframe(Section3.
2.
2.
1,"IDSearch").
Ifnoinformationabouttheframeisfound,theframeisnotfurtherprocessed,andthealgorithmfinishesexecution.
IfanRxframedescriptorwithamatchingIDisfound,thealgorithmchecksthedatapayloadofthereceivedframe.
Iftheframecontainslessthantheexpectednumberofbytes,theinvalidframehandlerroutine(RxInvalidHandler)iscalled,andtheframeisnotfurtherprocessed.
Theactiontakenincaseofinvalidframereceptionmaydifferdependingontheinformationstoredintheframe(ignoretheframe,requestre-send,reportanerror,etc.
).
Theinvalidframehandlercontentsshouldbetailoredtosuitthegatewayapplicationrequirements.
Aftertheframepassesthepayloadsizecheck,thegatewayreloadsitsRxtimer(thatis,thereceptiontimeoutstartsrunningagain).
Ifafailureindicatorisenabledfortheframe,thealgorithmclearsit.
NNYYIDfoundSearchthegatewaydatabasefortheframeIDIsthedatapayloadsize>=expectedReloadRxtimerClearthefailureindicator(ifenabled)CopysignalsCANframereceptionHandleinvalidframeXGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor16Thefinalstepinthealgorithmisthegateway'smaintask.
Thedatapayloadisbrokenintoindividualsignalsandcopiedintotheirdestinations.
MoredetailsaboutthesignalcopyalgorithmcanbefoundinSection3.
2.
2.
2,"SignalCopy.
"3.
2.
2.
1IDSearchThealgorithmthatperformsthesearchforanRxframedescriptorwithanIDmatchingthecurrentlyreceivedframe(RxFindFrmId)isavariationonthebinarysearchalgorithm.
Thebinarysearchalgorithmreliesonthearrayelementsbeingsorted.
ThisiswhytheRxframedescriptorsmustbesortedbytheirframeIDs(inascendingorder).
RxFindFrmIdfunction:tRxFrmDescr*RxFindFrmId(intFrmId,tNodeDescr*node){tRxFrmDescr*base=(node->rx_idx_start_p);inti;intresult;tRxFrmDescr*p;for(i=node->rx_idx_cnt;i!
=0;i>>=1){p=base+(i>>1);result=FrmId-(p->ID);if(result==0)return(p);/*ifspoton,returnthepointer*/if(result>0){/*movingright*/base=p+1;/*adjusttheindexandbase*/i--;}}return(NULL);}Itsparametersareapointertoanodedescriptorofthenodethroughwhichtheframewasreceivedandthereceivedframe'sID.
ItreturnsapointertothematchingRxframedescriptororaNULLpointerincaseanRxframedescriptorwithamatchingIDisnotfound.
ThefunctiondoesnotsearchthewholeRxframedescriptortable;itsearchestheportionofthetablecontainingdescriptorsforthespecifiednode.
3.
2.
2.
2SignalCopyThealgorithmforthesignalcopyroutine(Figure15)consistsoftwonestedloops.
Theouterloopcyclesthroughallthesignalspresentinthesourcedata.
Foreverysignal,theinnerloopcyclesthroughalldestinationsfortheframe.
Foreachsignaldestination,thesignalisextractedfromthesourcedatabufferandcopiedtothedestinationTxbuffer.
GatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor17Figure15.
AlgorithmforCopyingSignals3.
2.
3ReceptionofLINFramesUnlikeCAN,theLINbusisbasedonasinglemasterconcept.
Themasterinthesysteminitiatesalltransfersonthebus.
ThegatewayapplicationactsasmasterontheattachedLINbusesandisinfullcontroloftheoperations.
BecausethegatewayapplicationinitiatesreceptionofframesontheLINbuses,searchingthegatewaydatabaseforacorrespondingRxframedescriptorisunnecessary,astheapplicationknowswhichframeisbeingreceived.
ThearchitectureoftheLINdriversalsoensuresthatonlycorrectlyreceivedRxframescontainingtheexpectedamountofdataaresubmittedtothegatewayapplicationforfurtherprocessing.
Thealgorithmflow(Figure14)issimplifiedfortheLINbusesbecauseID-searchandthepayload-sizecheckingcanbeomitted.
Theremainingstepsarethesame.
3.
2.
4TransmissionofFramesTheframetransmissionalgorithm(FrameTransmit)doesnotphysicallytransmittheframeinquestion.
Itoperatesonthetransmissionqueuesandinsertsapointertotheframedescriptorintotheappropriatequeue.
Figure16outlinesthealgorithm.
ForallsignalscontainedinthedatapayloadoftheframeForalldestinationsofthesignalcurrentlybeingprocessedExtractthesignalfromthesourcedatabufferandcopyitintothedestinationTxbufferXGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor18Figure16.
FrameTransmissionAlgorithmWhentheroutineexecutes,itmarkstheframeasscheduledfortransmission.
TheTxScheduledflagservesasaninterlocktoensuretheframecannotbeinsertedintothetransmissionqueuemorethanonce.
Ifanysignalcontainedinthisframeisupdatedbeforetheframemovestothefrontofthequeueandistransmitted,thereisnoneedtoinserttheframeintothequeueagain.
Whentransmitted,itwillcontainthenewestavailablevalueofthesignal.
Aftertheframeismarkedasscheduled,apointertoitsTxframedescriptorisinsertedintothetransmissionqueuebufferoftheappropriatenode.
TheTxBufferAddindexisthenincrementedtopointtothefirstunusedelementinthebuffer.
Topreventoverflows,thequeuebuffermustbelongenoughfortheworstcasescenario.
Inthisparticularimplementation,thebufferissizedtohaveenoughspaceforalltheframesoftheparticularnode.
Itispossibletoscheduleallframesatoncewithoutanoverflowoccurringinthequeuebuffer.
ThealgorithmthenreloadstheTxtimertostartanewperiodincaseofperiodictransmissions.
TheTxtimerisreloadedwhentheframeisscheduledfortransmissionandnotwhenitisactuallytransmitted.
Thismeansthattrafficonthebus—oralongqueuedelayingtheactualtransmission—doesnotinterferewiththetimingoftheperiodictransmissionprocess,andastableperiodismaintained.
Iftheperipheralinquestionisidle,thelaststepinthetransmissionalgorithmistriggeringtheactualtransmission.
Whentherearenomoreframestotransmit(thequeueisempty),theinterruptserviceroutinethatloadstheperipheralwithframesaccordingtothetransmissionqueuedisablesthetransmitbufferemptyinterrupt.
Thetransmissionalgorithmmustrecognizethissituationandenabletheinterruptsourcetoallowtheinterruptroutinetoexecuteandloadtheperipheralwiththenewlyscheduledframe.
MarktheframeasscheduledfortransmissionStorepointertotheTxframedescriptorintotheTxqueueoftheappropriatenodeRestarttheTxtimer(ifenabled)TriggertransmissioniftheperipheralisidleYNIstheframealreadyscheduledGatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor193.
2.
5HandlingofRxandTxTimersAsingleroutine(GatewayTick)managesallthetimerswithinthegatewayapplication.
Asthenameoftheroutinesuggests,itexecutesperiodicallyinresponsetoaninterruptsignalfromanon-chiphardwaretimer.
Whethertheunderlyinghardwaretimergeneratestimebasewithaperiodof1ms,10ms,orevenlongerisirrelevant—thealgorithmsworkexactlythesame.
TominimizetheXGATEload,setthetimebasetoaslongaperiodaspossible(typically10ms).
Eachtimerhasitsownprescaler.
Typicalgatewayrequirementssettheperiodictransmissionfrequenciesandreceptiontimeoutstovalueseasilyunderstoodbyhumans(forexample,500msratherthan512ms).
Tosupporthuman-readablenumbers,theprescalerallowsthetimertobeupdatedonevery1st,every2nd,every10thorevery20thopportunity.
Asinglestaticcountervariableimplementstheprescalerfunctionality.
Thecountervariableupdatesattheendoftheinterruptroutine(afteralltimeralgorithmshaveexecuted).
Thecounterisaneight-bitslongvariabledividedintotwo,4-bitnibbles.
Oneveryupdate,thecountervalueisincremented.
Ifthelowernibbleequals10,thenibbleisclearedandtheuppernibbleisincremented.
Thissimplifiesimplementationofthedecimalprescalersoftheindividualtimerstoamasking(bitwiseAND)operationandshortenstherequiredexecutiontime.
Eachalgorithmalsocheckswhetherthetimervalueequalszero.
Avalueofzeroisnotvalidduringnormaltimeroperationandisconsideredtohaveaspecialmeaning(timerdisabled).
Thismakesiteasyforthesoftwarelayersabovethegatewayapplicationtostartandstoptimers,asrequired.
Ifthetimervalueisnon-zero,thetimerisdecremented.
Ifthetimerequalszeroafteritisdecremented,itisconsideredexpired.
Afterexpiration,thetimerisreloadedandanactionistaken.
Theactiondependsontheindividualtimer.
Timerswithinthegatewayapplicationhavethreeuses:TxtimerCANRxtimerLINRxtimer3.
2.
5.
1TxTimersTxtimersareusedforperiodictransmissionofframes.
Figure17showsthealgorithmforprocessingTxtimers.
AlltheTxtimersareprocessedsequentiallyinaloop.
WhenaTxtimerexpires,itisreloadedandtheframethetimerbelongstoisscheduledfortransmission.
XGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor20Figure17.
TxTimerProcessing3.
2.
5.
2CANRxtimersTheRxtimersareusedfordetectingtimeoutsinCANframereceptions.
ThealgorithmforprocessingRxtimersisslightlymorecomplicatedthanforTxtimesbecauseitneedstohandlethetwotimeoutactionsdescribedinSection2.
3.
1,"Reception.
"Figure18showsthealgorithm.
EverytimetheCANRxtimerexpires,theout-of-dateindicatorisset(ifenabled),andtheappropriatetimeoutcounterisdecremented.
Whenthetimeoutcounterreacheszero,thetimeoutprocessingroutineiscalled.
ForallTxtimersNNYYYN(counter&prescaler)==counterIsthetimerrunningDecrementthetimerHasthetimeroverflown(==0)ReloadthetimerTrasmittheframeGatewayImplementationXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor21Figure18.
CANRxTimerProcessingForallCanRxtimersNNYYYNYYY(counter&prescaler)==counterIsthetimerrunningDecrementthetimerHasthetimeroverflown(==0)ReloadthetimerReloadthetimeoutcounterandcalltimeoutprocessingSettheout-of-datebitDecrementthetimeoutcounterIstheout-of-datebitenabledNNNIsthetimeoutcounterrunningIsthetimeoutcounter==0TimeoutprocessingXGATELibrary:SignalGateway,Rev.
0GatewayImplementationFreescaleSemiconductor223.
2.
5.
3LINRxTimersBecauseoftheLINprotocol(Section2.
3.
3,"LINConsiderations"),LINRxtimersaresimilartoTxtimers.
TheonlydifferencebetweenthealgorithmsisinthefactthattheRxframedescriptordoesnotdirectlyindicatethenodeitbelongsto;aquicksearchisnecessarytoidentifythenodethroughwhichtheframewillbereceived.
ThesearchdoesnotrepresentamajorloadfortheXGATE:thenumberofnodedescriptorsitneedstovisitislow(limitedbythenumberofLINnodestheapplicationuses).
Figure19showsthealgorithmforprocessingtheLINRxtimers.
ItisnotnecessarytodetectanytimeoutsassociatedwiththeLINframesatthegatewaylevel;thetimeoutsaredetectedwithintheLINdriveritself(see[2]).
WhentheLINdriverdetectsatimeoutduringframereception,itexecutesthesametimeoutalgorithmthatisinplaceforCANframes(seebottomhalfofFigure18).
Figure19.
LINRxTimerProcessingForallLINRxtimersNNYYYN(counter&prescaler)==counterIsthetimerrunningDecrementthetimerHasthetimeroverflown(==0)ReloadthetimerFindwhichLINnodetheframebelongstoInitiatereceptionoftheLINframePerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor233.
3LimitationsofThisGatewayImplementationThesamplegatewayapplicationdescribedinthisdocumenthaslimitations(Table1)causedbychoicesmadeduringthecreationoftheexample;however,requirementsexceedingtheselimitationscanbeaccommodatedifanappropriatechangeismadetothesourcecode.
Suchchangeswouldmainlyimpactthememoryfootprintoftheapplication;theXGATEloadcreatedbytheapplicationwouldvaryonlyslightlyandcouldincreaseordecreasebasedonhowthechangeisimplemented(forexample,increasingthemaximumframeIDlengthfrom11bitsto16bitsincreasestherequiredmemorysizebutsimplifiesprocessingbecausenobitmanipulationswouldbeneededtoaccesstheID).
4PerformanceAnalysisTheCodeWarriorcompiler/debuggertoolsversion4.
5wereusedtomeasurethegatewayapplication'sperformanceandrequiredmemorysize.
Theexampleprojectusedforthemeasurementisavailableinazipfileassociatedwiththisapplicationnote.
ExecutiontimesofthedifferentpartsofthegatewayapplicationweremeasuredwhiletheHCS12XCPUperformedinfrequentaccessesintotheon-chipRAM.
4.
1XGATELoadTheXGATEperformancerequiredbythegatewayapplicationcanbeanalyzedbystudyingtherequirementsoftheindividualthreadsXGATEexecutes.
AsoutlinedinSection3.
2,"Algorithms,"thegatewayapplicationhasfiveseparateentrypoints(fivedifferentthreadstobeanalyzed).
Theloadcreatedbythethreadshandlingtheseentrypointsarediscussedinthissection.
4.
1.
1CANRxThreadTheCANRxthreadexecutesafterthereceptionofeachCANmessage.
4.
1.
1.
1IDSearchThefirststepintheCANRxalgorithmistofindtheRxframedescriptorwithamatchingID(seeSection3.
2.
2,"ReceptionofCANFrames,"andSection3.
2.
2.
1,"IDSearch").
ThesearchtimedependsontheportionsizeoftheRxdescriptortabletobesearchedandalsoonthedescriptorpositionwithamatchingIDwithinthetable.
Figure20showstheworstcasescenarios(expressedinbuscycles)forsearchsizesupto200.
Table1.
LimitationsParameterAllowedrangeFramedatasize0–15bytesSignalsize1–64bitsSignalposition0–63NumberofTxbuffers0–1024Rx/Txtimerperiod1–5120ticks(51.
2smax.
@10mstimebase)FrameIDlength1–11bitsXGATELibrary:SignalGateway,Rev.
0PerformanceAnalysisFreescaleSemiconductor24Figure20.
MaximumIDSearchTimeforDifferentSizesofRxDescriptorTableThemaximumsearchtimetrendcloselymatchesthenumberofiterationsrequiredbytheunderlyingbinarysearchalgorithm(thenumberofrequirediterationsisatmostlog2N,whereNisthenumberofelementsofthearray).
OnlytheRxdescriptorsbelongingtotheparticularCANnodearesearched(asopposedtosearchingthewholeRxdescriptortablecontainingdescriptorsforallCANnodes).
4.
1.
1.
2SignalCopyAftertheappropriateRxframedescriptorwithmatchingIDisfound,andthesizeofthereceivedframeisverified,thesignalsarecopiedintotheirdestinationbuffers.
Thisprocessisthemostintensivetaskthegatewayapplicationperformsandrepresentsthemajorityofrequiredprocessingtime.
Therearetwooptionsgoverningtheactualcopyingofthesignals.
EachRxframedescriptorindicateswhethertheparticularframedatapayloadshouldbecopiedwithbitorbyteaccuracy(byte_copy).
Anadditionalcompile-timeoptionforsignalscopiedwithbitaccuracygovernswhetherthedatapayloadisinbigendianorlittleendianformat.
Figure21showstheexecutiontimeofthebyteaccuratesignalcopyfunction(CopyDataChk).
MaximumRxFrameIDseachtime0102030405060708090100020406080100120140160180200Searchtablesize[entries]Maximumsearchtime[buscycles]PerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor25Figure21.
ByteCopyTimeforDifferentDataSizesCopyingdatawithbitaccuracyismoredemandingintermsofthenumberofrequiredbuscycles.
Thereislittledifferencebetweenlittleandbigendiandataformatsintermsofrequiredperformance.
Figure22showstheexecutiontimeofthebigendianbitaccuratesignalcopyfunction(CopySignalChkBE).
Figure22.
BitAccurateSignalCopyTimeforDifferentDataSizesItismoredemandingtocopyalongsignalthanashortsignal.
Theparameter,whichdictatestheexecutiontimeinthisimplementationofthefunctions,isthesignalspaninthedestinationdatabuffer.
Byspan,wemeanthenumberofbytesthesignaloccupies.
Figure23showsexamplesofsignalsspanningdifferentnumbersofbytes.
Bytecopytime0102030405060708012345678Numberofbytestocopy[bytes]Datacopytime[buscycles]DatavalueunchangedDatavaluedifferentinallbytesSignalcopytime02040608010012014016018012345678Signalspanindestinationbuffer[bytes]Signalcopytime[buscycles]SignalvalueunchangedSignalvaluedifferentinallbytesXGATELibrary:SignalGateway,Rev.
0PerformanceAnalysisFreescaleSemiconductor26Figure23.
SignalsSpanning1,2and3BytesThealgorithmofthebitaccuratesignalcopyfunctionconsistsofaloopthatexecutesonceforeverybyteofsignalspaninthedestinationbuffer.
Thisiswhytheexecutiontimegrowslinearlywiththesignalspan.
Thefunctionisoptimizedforprocessingshortsignalsthatfitintoasinglebyte.
Theexecutiontimeforsignalsspanningonebyteisslightlyshorterthanthelineartrendpredicts.
AsdiscussedinSection2.
3.
2,"Transmission,"thegatewayapplicationcanbeconfiguredtotransmitframeswhenvaluesoftheirsignalschange.
Changesinsignalvaluescanbedetectedonlyduringthecopyprocess;therefore,executiontimevariesdependingonthesignalvalue.
Figure21andFigure22showthebestandworstcasescenarios(copyofanunchangedsignalandasignalthatdiffersinalldestinationbytes).
Ingeneral,thefunction'sexecutiontimeisbetweenthetwodepictedextremes.
AsoutlinedinSection3.
2.
2.
2,"SignalCopy,"thesignalcopyalgorithmitself(CopySignals)consistsoftwonestedloops.
Theouterlooprunsthroughallthesignaldescriptorsfortheframewhiletheinnerlooprunsthroughalldestinationsofthesignalcurrentlyprocessed.
Figure24showsanexampleofhowtheexecutiontimeofthisalgorithmdependsonthenumberofsignalsandtheirdestinations.
Figure24.
ExecutionTimeofCopySignalsMSBMSBLSBLSBMSBMSBLSBLSBMSBMSBLSBLSBMSBMSBLSBLSBMSBMSBLSBLSBMSBMSBLSBLSBSignalsspanning1byte:Signalsspanning2bytes:Signalspanning3bytes:0100020003000400050006000700080009000100001100012000Executiontime[buscycles]1234567891011121314151Signal3Signals5Signals7Signals9Signals11Signals13Signals15SignalsNumberofdestinationsforeachsignal[-]CopySignalsexecutiontime(bytecopyofsignals1bytelong,nochangeinvalue)PerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor27AsshowninFigure24,theexecutiontimegrowslinearlywiththenumberofsignalsandthenumberofsignaldestinationsthealgorithmmustprocess.
Theexecutiontimecan,therefore,beapproximatedbytheformulafoundinEquation1.
TheparametersinthisequationarethenumberofsignalsintheRxframeandthetotalnumberofdestinationsforallthesignalscombined.
Eqn.
1TheexecutiontimesofCopyDataChkandCopySignalChkBEareexcludedfromtheequationandmustbeaddedtoobtainthetotaltimethesignalcopyprocessrequires.
CombiningEquation1withthecopytimes(Figure21andFigure22)enablesthesoftwaredesignertoestimatetheexecutiontimethesignalcopyalgorithmrequires.
4.
1.
1.
3FrameTransmissionSchedulingProcedureFrameTransmitschedulesframesfortransmission(seeSection3.
2.
4,"TransmissionofFrames").
Theexecutiontimeoftheproceduredependsonwhethertheparticularframeisalreadyscheduledfortransmission.
Table2showstheprocedure'sexecutiontimes.
ExecutiontimeoftheLINframesetupprocedure(LinFrameSetup)—incasethescheduledframeisaLINframe—isexcludedfromthevaluesinTable2.
TheLinFrameSetupprocedureexecutesanalgorithmthatstartsoperationoftheLINperipheralifitwasidlewhentheframeisscheduledfortransmission.
ItsexecutiontimedependsonwhetheranRxoraTxLINframeisbeingprocessed.
Table3showstheprocedure'sexecutiontimes.
4.
1.
2CANTxThreadTheTxthread(MsCanTxEmptyIsr)executesinresponsetotheMSCANTxbufferemptyinterruptrequest.
Executiontimeofthisinterruptserviceroutinedependsonwhetheranyframesarescheduledfortransmissionorwhetherthetransmissionqueueisempty.
Whenthequeueisempty,theinterruptroutineonlydisablestheinterruptsourcebecausetherearenomoreframestotransmit.
Table4showsexecutiontimes.
Table2.
ExecutionTimesofFrameTransmitProcedureConditionExecutiontime[BusCycles]Framealreadyscheduled12Framenotscheduledyet40Table3.
ExecutionTimesofLinFrameSetupProcedureConditionExecutionTime[BusCycles]Txframeattopofqueue70Rxframeattopofqueue42Transmissionqueueempty11TCopySignals2612Nsignals32Ndestinationsbuscycles[]++=XGATELibrary:SignalGateway,Rev.
0PerformanceAnalysisFreescaleSemiconductor284.
1.
3RxandTxTimerHandlingThreadAsdescribedinSection3.
2.
5,"HandlingofRxandTxTimers,"thetimersareusedforthreedifferentpurposeswithinthegatewayapplication.
Thesegroupsoftimersareprocessedindependently;youcanseparatelyanalyzetheexecutiontimeofthetimerhandlingthread(GatewayTick)forthethreegroups.
Theoverallexecutiontimeisanadditionoftheprocessingtimesrequiredforthethreetimergroups.
Theexecutiontimesdetailedinthefollowingsectionsweremeasuredunderthefollowingconditions:Alltimershavereloadvalueequalto202.
Theexpirationofindividualtimersisstaggered(onlyonetimerexpiresduringoneexecutionofthethread).
Callsofotherfunctionswithinthegatewayapplication(suchastransmissionscheduling)wereexcludedduringthemeasurements.
4.
1.
3.
1TxTimersFigure25showstheprocessingtimesrequiredfordifferentnumbersofTxtimerswithdifferentprescalers.
Figure25.
ProcessingTimeRequiredforTxTimersTable4.
ExecutionTimesofMsCanTxEmptyIsrInterruptServiceRoutineConditionMax.
executiontime[buscycles]Frame(s)scheduledfortransmission53Transmissionqueueempty12ProcessingtimeofTxtimers0250500750100012501500175020002250250027503000020406080100120140160180200NumberofTxtimers[-]Processingtime[buscycles]TxTimersmax(~ave[÷1])TxTimersave[÷2]TxTimersave[÷10]TxTimersave[÷20]PerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor29Themaximumexecutiontimeisindependentoftheprescalerselectionanddependsonthenumberoftimersbeingprocessed.
Theaverageexecutiontimeforprescalervaluesgreaterthan1islowerbecausethetimersarenotdecrementedineveryiterationofthealgorithm.
4.
1.
3.
2CANRxTimersIntermsofprocessingcomplexity,theCANRxtimersarealmostidenticaltotheTxtimers.
Figure26showstheprocessingtimesrequiredfordifferentnumbersofCANRxtimerswithdifferentprescalers.
Figure26.
ProcessingTimeRequiredforCanRxTimers4.
1.
3.
3LINRxTimersProcessingofLINRxtimersincludesasearchtoidentifywhichLINnodethetimerbelongsto.
Thesearchtimeisshort,butbecauseitisonlyperformedwhenatimerexpires,theaverageprocessingtimeforprescalervalueof1isnolongerequaltothemaximumprocessingtime.
ThesearchtimeisthelongestwhentheexpiredtimerbelongstothelastLINnode.
Forthepurposeofthismeasurement,sixLINnodesweredefined,andallthetimerswereassignedtothelastLINnode(thissituationrepresentstheworstcasescenarioforgatewayapplicationwithsixLINinterfaces).
Figure27showstheprocessingtimesrequiredfordifferentnumbersofLINRxtimerswithdifferentprescalers.
ProcessingtimeofCanRxtimers0250500750100012501500175020002250250027503000020406080100120140160180200NumberofRxtimers[-]Processingtime[buscycles]RxTimersmax(~ave[÷1])RxTimersave[÷2]RxTimersave[÷10]RxTimersave[÷20]XGATELibrary:SignalGateway,Rev.
0PerformanceAnalysisFreescaleSemiconductor30Figure27.
ProcessingTimeRequiredforLinRxTimers4.
1.
4LINMasterAlgorithmTheLINmasteralgorithmisimplementedasasimplestate-machinewhichrespondstoSCITxbufferemptyandRxbufferfullinterrupts(LinSciIsr).
Executiontimeofthealgorithmdependsonthestateofthealgorithm.
Table5showstheexecutiontimesindifferentstates.
Table5.
ExecutionTimeofTheLinMasterAlgorithmStateExecutiontime[buscycles]Sendbreak&synccharacters21SendID(whentransmitting)22SendID(whenreceiving)25Receivesync(whenreceiving)19ReceiveID(whenreceiving)24Transmitdata36Receivedata37Transmitchecksum28Receivechecksumandsetupnewframe(queueempty)58Setupnewframe(whentransmitting)(Txframeattopofqueue)89Setupnewframe(whentransmitting)(Rxframeattopofqueue)63Setupnewframe(whentransmitting)(queueempty)32ProcessingtimeofLinRxtimers0250500750100012501500175020002250250027503000020406080100120140160180200NumberofRxLINtimers[-]Processingtime[buscycles]RxLINTimersmaxRxLINTimersave[÷1]RxLINTimersave[÷2]RxLINTimersave[÷10]RxLINTimersave[÷20]PerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor31TheLINmasteralgorithmcallstheLinFrameSetupproceduretosetuptransmissionorreceptionofanewframeafterprocessingofthecurrentframeiscomplete(seeSection4.
1.
1.
3,"FrameTransmissionScheduling").
4.
1.
5LINTimeoutDetectionTheLINtimeoutdetectionalgorithm(LinTimeoutTick)executesatafrequencyequalto1/5ofthesymbolrateoftheLINperipherals(allLINperipheralsareexpectedtorunatthesamespeed,typically19,200or9600baud).
Thealgorithmexecutiontimedependsontwoparameters:thenumberofLINnodesusedbythegatewayapplicationandthenumberofLINnodescurrentlyreceivingframesfromslavedevices(and,therefore,inneedoftimeoutdetection).
Figure28showsthealgorithmexecutiontimes.
TheexecutiontimesinthegrapharebasedoncaseswherethetimeoutdetectionisactivefortheselectednumberofLINnodes,butnotimeouthasbeendetected(alldatafromslavedevicesarereceivedontime).
Figure28.
ExecutionTimeofLinTimeoutTickFigure28showshowtheexecutiontimegrowslinearlywiththenumberofLINnodesandreceivingLINnodes.
Equation2showshowtoapproximatetheexecutiontime.
TheparametersinthisequationarethenumberofLINnodesthegatewayapplicationusesandthenumberofLINnodesreceivingframesfromslavedevices.
Eqn.
2ThealgorithmcallstheRxTimeoutHandlerroutinewhenitdetectsatimeoutonanyreceivingLINnode.
Insuchacase,theexecutiontimeislongerthanindicatedabove.
020406080100120140160180200Executiontime[buscycles]01234567891011121314151617181Lin3Lins5Lins7Lins9Lins11Lins13Lins15Lins17LinsNumberofLinnodesreceivingframes[-]LinTimeoutTickexecutiontime(timeoutnotdetected)TLinTimeoutTick156NLinNodes4NRxLinNodesbuscycles[]++=XGATELibrary:SignalGateway,Rev.
0PerformanceAnalysisFreescaleSemiconductor324.
2RequiredMemorySizeTheCodeWarriorcompilerversion4.
5wasusedtodeterminethesizeoftheindividualcomponentsofthegatewayexampleapplication.
4.
2.
1CodeSizeThegatewaydatabasedefinesthebehaviorofthefundamentalalgorithmsofthegatewayapplication.
Thesizeofthecodeisconstantanddifferentrequirementsareaccommodatedbychangingthegatewaydatabase.
Onlyafewhigher-levelfunctionsmustbefine-tunedbasedontheactualrequirements.
Suchfunctionsaremarkedinthetablesbelow.
Table6detailsthesizeofcodefortheCPU.
AlltheCPUfunctionsperforminitializationactivitiesandareonlyexecutedonceafterstart-up.
Table7showsgatewaycodesizefortheXGATE.
TheXGATEalsoexecutestheLINdriver.
Table8showscodesizeoftheXGATELINdriver.
Table6.
CodeSizefortheCPUFunction/ProcedureSize[bytes]GatewayInit78InitPit49InitSci29InitMsCan83SetIntPrio22TOTAL261Table7.
CodeSizefortheXGATEFunction/ProcedureSize[bytes]RxFindFrmId58CopySignalChkBE264CopyDataChk42CopySignals212BitAssign48RxTimeoutHandlerplaceholderforusercodeRxHandlerplaceholderforusercodeRxInvalidHandlerplaceholderforusercodeGatewayRxTimeout94GatewayTick278PerformanceAnalysisXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor334.
2.
2DataSizeInareasonablysizedgatewayapplication,thedatastructuresarelargerthantheapplicationcode.
Thegatewaydatabasesizedependsonthesignalroutingrequirements.
Itisonlypossibletodocumentthesizesoftheindividualdatabasecomponents(descriptors),andyoumustcalculatetherequiredmemorysizebasedonthenumbersofthedescriptorsrequiredtosatisfytheparticularrequirements.
Table9showsthedescriptorsizes.
FrameTransmit108MsCanTxEmptyIsr110MsCanRxFullIsr136TOTAL1350Table8.
CodeSizeoftheXGATELINdriverFunction/ProcedureSize[bytes]LinFrameSetup210LinSciIsr450LinTimeoutTick96TOTAL756Table9.
SizesofGatewayDescriptorsDescriptor/variableUseSize[bytes]tNodeDescrMemberofNodeDescrsarray;describesanode(LINorMSCAN)12tLINnodeMemberofLinNodeDescrsarray;describesadditionalpropertiesofLINnodes18tTxFrmDescrMemberofTxTablearray;describesaTxframe8tRxFrmDescrMemberofRxTablearray;describesanRxframe10tSignalDescrDescribesasignal(sizeandpositionintheRxframe)2tSignalDestDescrDescribesasignaldestination(Txframenumberandposition)2FrmDataDatabuffers(oneforeachTxframe)sizeofeachbufferdependsonthepayloadsizeoftheparticularTxframeNodeTxBufferTransmissionqueuebuffers(oneforeachnode)seetextbelowTable7.
CodeSizefortheXGATE(continued)Function/ProcedureSize[bytes]XGATELibrary:SignalGateway,Rev.
0GeneratingtheDescriptorsFreescaleSemiconductor34Thetransmissionqueuesmustbelongenoughtoavoidoverflowevenwhenalltheframesofanodearescheduledfortransmission.
Thequeuemustbelongenoughtoholdpointerstoallframesthatcanbescheduledplusone.
OnMSCANnodes,onlyTxframescanbescheduledfortransmission;however,onLINnodes,bothTxandRxframesgothroughtheschedulingprocess.
OntheXGATEco-processor,allpointersare16bitswide.
4.
2.
2.
1DataSizeCalculation—anExampleThisexampledemonstrateshowdatasizecanbecalculatedbasedonthegatewayrequirements.
Consideragatewayapplicationwiththefollowingparameters:2MSCANnodesand2LINnodes4Rxframes(oneforeachnode)with2signalseachEachsignalhas1destination6Txframeswith7bytesofpayloadeachThememoryspacerequiredtoholdallthedescriptorscanbecalculatedlikethis:4nodedescriptors(12byteseach)and2LINnodedescriptors(18byteseach)=84bytes4Rxframedescriptors(10byteseach)and8signaldescriptors(2byteseach)=56bytes8signaldestinationdescriptors(2byteseach)=16bytes6Txframedescriptors(8byteseach)anddatabuffers(42bytes)=90bytes4transmissionqueuesfor6Txframesand2LINRxframes=(4+6+2)*2=24bytesThememoryspacerequiredtoholdthegatewaydatabase(inthiscase)is270bytes.
5GeneratingtheDescriptorsGeneratingthegatewaydatabasedatathatdescribestheapplication'sdesiredbehaviorislaborious(especiallyforlargersystemsclosetorealworldrequirements).
AnExcel1spreadsheetwithVisualBasicmacroswascreatedtosimplifythisprocess.
ThissectiondescribeshowtheExcelspreadsheetcangeneratethegatewaydatabase.
5.
1GeneratedFilesThemacroswithintheExcelspreadsheetgeneratethreesourcefiles:gateway_vector_pointers.
h—ContainsindexesintotheNodeDescrsarrayfortheindividualon-chipperipherals.
TheseindexespassthecorrectnodedescriptorstotheXGATEinterruptserviceroutines.
gateway_data_dims.
h—Containsdimensionsofthedifferentdatatables.
ItspecifiesthetotalnumberofRxframes,Txframes,andnodes.
ItalsospecifiestheindexofthefirstLINnodeintheNodeDescrsarrayandthenumberofdefinedLINnodes.
1.
ExcelandVisualBasicareregisteredtrademarksofMicrosoftCorporationintheUnitedStatesand/orothercountries.
GeneratingtheDescriptorsXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor35gateway_data.
cxgate—Containsthedifferentarraysformingthegatewaydatabase(TxframedescriptorarrayTxTable,RxframedescriptorarrayRxTable,signaldescriptorstructureSignalDescrs,LINnodedescriptorarrayLinNodeDescrs,andnodedescriptorarrayNodeDescrs).
Afterthesesourcefilesaregenerated,theyarecompiledaspartofthegatewayexampleproject.
5.
2NodeDataWorksheetThefirstworksheetwithgateway-relateddataisnamedNodeData.
Itdefinesallthenodesthegatewayapplicationwilluse.
Figure29showsanexampleofthisworksheet.
Figure29.
ExampleofNodeDefinitionsStartonline4andfillinthefirstthreecolumnsofthisworksheet.
ColumnAcontainsthenodenumbers.
Thenodenumbersmuststartatzeroandincrementbyoneoneachsubsequentline.
ThefirstblankcellencounteredincolumnAterminatesthenodelist.
ColumnBidentifiesthehardwareperipheralnumberusedbythenode.
Forexample,0signifiesSCI0(incaseofaLINnode)orMSCAN0(incaseofaCANnode).
Similarly,1signifiesSCI1/MSCAN1,etc.
ColumnCdeterminesthenodetype.
Onlytwotypesofnodesarepermittedinthecurrentversionofthegatewayexamplecode.
TheseareLinforLINnodesandMsCanforCANnodes.
Theorderofthehardwareperipheralsinthelistisnotimportant(thatis,SCI0canprecedeSCI1ortheotherwayround).
However,LINnodesmustalwaysfollowCANnodes(thatis,CANnodenumbersmustbelowerthanLINnodenumbers).
Thedescriptorsearchalgorithmrequiresthisorder.
Valuesintheremainingcolumnsoftheworksheetarecalculatedbythemacrosduringthefile-generationprocessandcontainstatisticsabouttheindividualnodes.
Forexample,datasizesrequiredbytheindividualnodesarecalculatedincolumnIandatotaldatasizeforthewholegatewayapplicationisvisibleincellJ3.
5.
3RxFramesWorksheetThesecondworksheetisnamedRxFrames.
Itcontainsallframedefinitionsthegatewayapplicationshouldreceive,definitionsofallthesignalscontainedintheseframes,andtheirdestinations.
Figure30showsanexampleofthisworksheet.
TheRxframedataarefilledinstartingonline4.
ColumnAcontainstheRxframenumbers.
TheRxframenumbersmuststartatzeroandincrementbyoneoneachsubsequentline.
ThefirstblankcellencounteredincolumnAterminatestheRxframelist.
2345678910ABCDEFGHIJEx.
:1=SCI1/CAN1bytes]bytes][bytes]21400MsCan117235111MsCan117245321Lin118116632Lin1020044XGATELibrary:SignalGateway,Rev.
0GeneratingtheDescriptorsFreescaleSemiconductor36Figure30.
ExampleofRxFrameDefinitionsColumnBholdsthereceivedframe'sID,andcolumnCholdsthenodenumbertheframeisreceivedthrough.
CANRxframedescriptorsareidentifiedbasedonthereceivedframe'sID.
ThesearchalgorithmrequiresthatRxframedefinitionsaresortedbynodenumberthenID(bothinascendingorder).
ColumnDholdstheexpecteddatapayloadsizefortheframe.
Framesreceivedwithshorter-than-expectedpayloadgenerateanerrorduringthereceptionprocess.
ColumnsE,F,andGholdtheRxtimerprescaler,reloadvalueandinitialcountervalue(respectively).
Thevaluesallowedfortheprescalerarerestrictedto1,2,10,and20.
Thereloadvalueandtheinitialcountervaluearerestrictedtoarangebetween0and255.
TheinitialcountervalueisusedtobuildLINschedules.
AllLINframesbelongingtothesamescheduleareassignedthesamereloadvalue(scheduleperiod)andtheinitialcountervalueservesasanoffsetfromthebeginningofthescheduleperiod.
LeavingthecellsemptydisablestheRxtimer.
Non-emptycellsincolumnHenablethefailbitfunctionality(Section2.
3.
1,"Reception,"andSection3.
2.
5,"HandlingofRxandTxTimers").
ColumnIdefinesthefail-bitpositionwithintheTxframe.
ThenumberincolumnJgovernshowmanytimeoutperiodsmustelapsebeforethelongtimeoutisdetected.
ColumnKdetermineswhetherabit-accurateorabyte-accurate-copyalgorithmisused.
Ifanon-blankcellisdetected,thesignalsarecopiedwithbyteaccuracy.
ColumnLholdsthenumberofsignalscontainedwithintheframe.
ThisisthelastcolumnbelongingtotheRxframedescriptorintheRxTablearray.
TheremainingcolumnsbelongtothesignaldescriptorstructureSignalDescrs.
5.
3.
1SignalDescriptionsEachsignalisdescribedinfourcolumns.
ColumnsM,N,0,andPdescribesignal#0.
ColumnsQ–Tdescribesignal#1,etc.
12345678910ABCDEFGHIJKLFRM#RxID(hex)RxNodeMsgSizeRxTimerRxTimerRxTimerFailbitFailbitTimeoutHandlerbytecopy#ofsignals[bytes]prescalerreloadinitialvalueenablepositioncounterreload0200820252521211815050X82222922X112345678910AMNOPQRSTUVWXsignal#0signal#1signal#2FRM#positionlength#ofdestsdestinspositionlength#ofdestsdestinspositionlength#ofdestsdestinsframe#,position;frame#,position;.
.
.
01820,0;1,1513312,1615831,0;0,8;2,015112,2420212,0GeneratingtheDescriptorsXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor37Thefirstcolumn(thatis,columnMforSignal#0)definesthesignalpositionintheRxframe.
Thesecondcolumn(thatis,columnNforSignal#0)definesthesignallength.
Thethirdcolumn(thatis,columnOforSignal#0)storesthenumberofdestinationsthesignalshouldbecopiedinto.
Thelastcolumn(thatis,columnPforSignal#0)storesastringdescribingthesignaldestinations.
Thesignaldestinationdescriptionstringcontainsnumberpairs,oneforeverydestination.
Semicolonsseparatenumberpairs(thereisnosemicolonafterthelastpair).
Commasseparatethenumberswithinthepairs.
ThefirstnumberistheTxframenumberthesignalistobecopiedinto.
ThesecondnumberisthepositionwithintheTxframewherethesignalcopyshouldbeplaced.
5.
4TxFrameWorksheetThelastworksheetcontainingthegatewaydatabasedataisnamedTxFrames.
Itcontainsdefinitionsofallframesthegatewayapplicationwilltransmit.
Figure31showsanexampleofthisworksheet.
TheTxframedataarefilledinstartingonline4.
Figure31.
ExampleofTxFrameDefinitionsColumnAcontainstheTxframenumbers.
TheTxframenumbersmuststartatzeroandincrementbyoneoneachsubsequentline.
ThefirstblankcellencounteredincolumnAterminatestheTxframelist.
ColumnBdefinesthetransmittedframe'sID,andcolumnCidentifieswhichnodetheframewilltransmitthrough.
ColumnDspecifiesthedatapayloadsizeoftheframe.
ColumnsE,F,andGholdtheTxtimerprescaler,reloadvalue,andinitialcountervalue(respectively).
Thevaluesallowedfortheprescalerarerestrictedto1,2,10,and20.
Thereloadvalueandtheinitialcountervaluearerestrictedtorangebetween0and255.
TheinitialcountervalueisusedtobuildLINschedules.
AllLINframesbelongingtothesamescheduleareassignedthesamereloadvalue(scheduleperiod),andtheinitialcountervalueservesasanoffsetfromthebeginningofthescheduleperiod.
LeavingthecellsemptydisablestheTxtimer.
Non-blankcellsincolumnHspecifytheframeshouldbescheduledfortransmissionimmediatelyafteranyofthesignalsitcontainsarereceived.
Non-blankcellsincolumnIspecifytheframeshouldbescheduledfortransmissionimmediatelyafteranyofthesignalsitcontainsarereceived,providingthevalueofthereceivedsignaldiffersfromthesignalvaluewhichwaspreviouslytransmitted.
SeeSection2.
3.
2,"Transmission.
"12345678910ABCDEFGHIFRM#TxID(hex)TxNodeDataSizeTxTimerperiodicTxPeriodicTxTxonRxTxondatachgprescalerreloadinitialvalue030071100110517X233281055X347322011XGATELibrary:SignalGateway,Rev.
0ReferencesFreescaleSemiconductor385.
5GeneratingtheSourceFilesThesourcefilescontainingthegatewaydatabasecanbegeneratedaftertheworksheetsarefilledwithdatadescribingthedesiredgatewaybehavior.
ThesourcefilesaregeneratedbypressingtheGenerateFilesbuttonintheNodeDataworksheet.
Ifthesourcefilesalreadyexist,theyareoverwritten.
Verylittledataconsistencyandvalidityverificationisperformedaspartofthefile-generationprocess.
Youmustensurethedatavaluesarevalid.
6References1.
MC9S12XDP512DataSheet,FreescaleSemiconductorInc.
,2005.
2.
ApplicationnoteAN2732:"UsingXGATEtoImplementLINCommunicationonHCS12X",FreescaleSemiconductorInc.
,2004.
ReferencesXGATELibrary:SignalGateway,Rev.
0FreescaleSemiconductor39THISPAGEISINTENTIONALLYBLANKDocumentNumber:AN3333Rev.
011/2006HowtoReachUs:HomePage:www.
freescale.
comE-mail:support@freescale.
comUSA/EuropeorLocationsNotListed:FreescaleSemiconductorTechnicalInformationCenter,CH3701300N.
AlmaSchoolRoadChandler,Arizona85224+1-800-521-6274or+1-480-768-2130support@freescale.
comEurope,MiddleEast,andAfrica:FreescaleHalbleiterDeutschlandGmbHTechnicalInformationCenterSchatzbogen781829Muenchen,Germany+441296380456(English)+46852200080(English)+498992103559(German)+33169354848(French)support@freescale.
comJapan:FreescaleSemiconductorJapanLtd.
HeadquartersARCOTower15F1-8-1,Shimo-Meguro,Meguro-ku,Tokyo153-0064Japan0120191014or+81354379125support.
japan@freescale.
comAsia/Pacific:FreescaleSemiconductorHongKongLtd.
TechnicalInformationCenter2DaiKingStreetTaiPoIndustrialEstateTaiPo,N.
T.
,HongKong+80026668080support.
asia@freescale.
comForLiteratureRequestsOnly:FreescaleSemiconductorLiteratureDistributionCenterP.
O.
Box5405Denver,Colorado802171-800-441-2447or303-675-2140Fax:303-675-2150LDCForFreescaleSemiconductor@hibbertgroup.
comInformationinthisdocumentisprovidedsolelytoenablesystemandsoftwareimplementerstouseFreescaleSemiconductorproducts.
Therearenoexpressorimpliedcopyrightlicensesgrantedhereundertodesignorfabricateanyintegratedcircuitsorintegratedcircuitsbasedontheinformationinthisdocument.
FreescaleSemiconductorreservestherighttomakechangeswithoutfurthernoticetoanyproductsherein.
FreescaleSemiconductormakesnowarranty,representationorguaranteeregardingthesuitabilityofitsproductsforanyparticularpurpose,nordoesFreescaleSemiconductorassumeanyliabilityarisingoutoftheapplicationoruseofanyproductorcircuit,andspecificallydisclaimsanyandallliability,includingwithoutlimitationconsequentialorincidentaldamages.
"Typical"parametersthatmaybeprovidedinFreescaleSemiconductordatasheetsand/orspecificationscananddovaryindifferentapplicationsandactualperformancemayvaryovertime.
Alloperatingparameters,including"Typicals",mustbevalidatedforeachcustomerapplicationbycustomer'stechnicalexperts.
FreescaleSemiconductordoesnotconveyanylicenseunderitspatentrightsnortherightsofothers.
FreescaleSemiconductorproductsarenotdesigned,intended,orauthorizedforuseascomponentsinsystemsintendedforsurgicalimplantintothebody,orotherapplicationsintendedtosupportorsustainlife,orforanyotherapplicationinwhichthefailureoftheFreescaleSemiconductorproductcouldcreateasituationwherepersonalinjuryordeathmayoccur.
ShouldBuyerpurchaseoruseFreescaleSemiconductorproductsforanysuchunintendedorunauthorizedapplication,BuyershallindemnifyandholdFreescaleSemiconductoranditsofficers,employees,subsidiaries,affiliates,anddistributorsharmlessagainstallclaims,costs,damages,andexpenses,andreasonableattorneyfeesarisingoutof,directlyorindirectly,anyclaimofpersonalinjuryordeathassociatedwithsuchunintendedorunauthorizeduse,evenifsuchclaimallegesthatFreescaleSemiconductorwasnegligentregardingthedesignormanufactureofthepart.
FreescaleandtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.
Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.
FreescaleSemiconductor,Inc.
2006.
Allrightsreserved.
RoHS-compliantand/orPb-freeversionsofFreescaleproductshavethefunctionalityandelectricalcharacteristicsastheirnon-RoHS-compliantand/ornon-Pb-freecounterparts.
Forfurtherinformation,seehttp://www.
freescale.
comorcontactyourFreescalesalesrepresentative.
ForinformationonFreescale'sEnvironmentalProductsprogram,gotohttp://www.
freescale.
com/epp.

JustHost:俄罗斯/新西伯利亚vps,512MB内存/5GB空间/不限流量/200Mbps/KVM/自由更换IP,$1.57/月

justhost怎么样?justhost是一家俄罗斯主机商,2006年成立,提供各种主机服务,vps基于kvm,有HDD和SSD硬盘两种,特色是200Mbps不限流量(之前是100Mbps,现在升级为200Mbps)。下面是HDD硬盘的KVM VPS,性价比最高,此外还有SSD硬盘的KVM VPS,价格略高。支持Paypal付款。国内建议选择新西伯利亚或者莫斯科DataLine。支持Paypal付...

ZJI:韩国BGP+CN2线路服务器,国内三网访问速度优秀,8折优惠码每月实付440元起

zji怎么样?zji最近新上韩国BGP+CN2线路服务器,国内三网访问速度优秀,适用8折优惠码zji,优惠后韩国服务器最低每月440元起。zji主机支持安装Linux或者Windows操作系统,会员中心集成电源管理功能,8折优惠码为终身折扣,续费同价,全场适用。ZJI是原Wordpress圈知名主机商:维翔主机,成立于2011年,2018年9月启用新域名ZJI,提供中国香港、台湾、日本、美国独立服...

bgpto:BGP促销,日本日本服务器6.5折$93/月低至6.5折、$93/月

bgpto怎么样?bgp.to日本机房、新加坡机房的独立服务器在搞特价促销,日本独立服务器低至6.5折优惠,新加坡独立服务器低至7.5折优惠,所有优惠都是循环的,终身不涨价。服务器不限制流量,支持升级带宽,免费支持Linux和Windows server中文版(还包括Windows 10). 特色:自动部署,无需人工干预,用户可以在后台自己重装系统、重启、关机等操作!bgpto主打日本(东京、大阪...

javlibrary.com为你推荐
网易网盘关闭入口网易网盘 怎么没有了怎么查询商标怎样查询商标有没有被注册方法有哪些?比肩工场命比肩多 是什么意思啊?比肩工场比肩接踵的意思psbc.comwap.psbc.com网银激活冯媛甑夏如芝是康熙来了的第几期?kb123.netwww.zhmmjyw.net百度收录慢?www.175qq.com求带名字的情侣网名!ww.43994399??????????莱姿蔓请问法国的卡诗蔓比起卡地亚这种很昂贵的品牌,差别很大吗?
.cn域名注册 krypt 外国域名 京东云擎 parseerror lighttpd 512m内存 国内php空间 本网站服务器在美国 ca4249 52测评网 双线主机 腾讯实名认证中心 佛山高防服务器 香港亚马逊 外贸空间 免费asp空间 中国联通宽带测速 hostease zcloud 更多