您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 国内外标准规范 > AVR-J1850-VPW-Interface-Documentation
Title:DocumentationforAVRJ1850VPWInterfaceIssue:FAuthor:MichaelWolfPrinted:22/10/2005OverviewAVRJ1850VPWinterfacetoconnectaChryslerorGMcarbustoaPCforOnBoardDiagnostic(OBD)monitoring.MyinterfaceisbuildaroundAtmelAVRmega8controller,myfavourite“workhorse”.ThecontrollerisavailablealsoinDIPpackageforallwhonotwanttobuiltwithSMDcomponents.With8kflashmemorywehaveplentyofspaceforallkindoffeatures.Thebasicsourcecodewhichsupportsallfunctionsuses3kcodespace.Somefeatures:•SAEJ1850VPWtoRS232interface•simpleATcommandcontrol•differentBaudrates,from9600to115200Baud•4differentbusmonitorfunctions•supportfor1and3byteheadermessagesThesourcecodeforthisinterfaceisreleasedunderGNUGENERALPUBLICLICENSE.Seelicense.txtfordetails.HardwaredescriptionThecircuitisdesignedforasinglelayerPCB.K1VPWbusconnectorPin1=GroundPin7=VPWbusIn/OutPin9=12VsupplyK2RS232serialconnectorPin2=SerialoutPin3=SerialinPin5=GroundK3In-Circuit-ProgrammingconnectorCompatiblepin-outforAtmelSTK500developmentboardPin1=MISOPin2=5VsupplyPin3=SCKPin4=MOSIPin5=ResetPin6=GroundIC15VfixedvoltageconvertertosupplytheuCandRS232converterD1PoweronindicationD2,T1VPWbustrafficindication,incomingandoutgoingT2VPWinputbuffer,signalinverterandvoltageconverterD3,D4,T3,T4VPWoutputbuffer,signalinverterandvoltageconverterIC2maincontrollerIC3RS232levelconverterNote:Firmwareversion1.04andhigherrequiresacrystalwith7.3728MHzforproperfunction.Importantnote:ThevoltageregulationcircuitR8/D4isdesignedforatleast315Ohmbusload!DonotkeeptheJ1850lineinhighlevelwithoutloadresistorconnectedtoK1-7andK1-1otherwiseD4willbedestroyedimmediately.ProgrammingtheAVRThecircuitprovidesanISPconnectortoprogramthefirmware.UseyourfavouriteprogramminghardwaretoflashtheAVR.Afterflashingthefirmwareyoumustchangethefusesettingsonnewdevices.Rememberthata“clean”ATmega8isdeliveredwithinternalRCoscillatorenabled,runningat1MHz.Program(checked)thefusesinthefollowingorder:InAVR-Studio:•Bootflashsectionsize=128wordsBootstartaddress=$0F80;BOOTSZ=11•Brown-outdetectionlevelatVCC=4.0V;BODLEVEL=0•Brown-outdetectionenabled;BODEN=0•CKOPTfuse;CKOPT=0•Ext.Crystal/resonatorHighFreq.;Start-uptime:1kCK+0ms;CKSEL=1110SUT=10Allotherfusesarenotused.InPonyProg:Checkedfuses:SUT1,CKSEL0UncheckedFuses:BOOTSZ1,BOOTSZ0Leavetherestuntouched!CommunicatingwiththeinterfaceCommunicationisdoneviaserialRS232connection.Defaultconnectionsettingsare:9600(default)or19200Baud8N1-8databits,noparitybit,1stopbit,nohandshakeAllresponsesfromtheinterfaceareterminatedwithasinglecarriagereturncharacterand,bydefault,alinefeedcharacteraswell.Aftercorrectconnectionandpowerup,theinterfacewilldisplaytheinitialmessage:AVR-J1850VPWv1.04May102005/18:33:53Showingcodedescriptionandversion,dateandtimewhenthecodewascompiledandthecommandpromptcharacter‘’.Theinterfaceisnowreadyandcanreceiverusercommands.Allcommandsusedtocontroltheinterfaceareseparatedfromvehiclecommandswiththecommandtag“AT”.VehiclecommandscancontainonlywithASCIIcharactersforhexadecimaldigits(0-9andA-F).Allcommandssendtotheinterface,internalATorhexstringforVPW,mustbeterminatedwithasinglecarriagereturncharacter(0x0D)beforetheywillbeaccepted,theyarenotcasesensitive.Asingle“?”willindicatethatthemessagewasmisunderstoodbytheinterface(syntaxerror).ThisincludeswrongorincompleteATcommandsandwronghexstrings.ThisisnotasignforinvalidVPWmessagebecausetheinterfacenotvalidatesVPWmessage.ATcommanddescriptionAninterfacecontrolcommandmustbeginwiththe“AT”commandtagfollowedbyacommandcodeand,ifrequired,oneormoreparameters.AR[AutomaticReceiveaddress]Default:ONSetthereceiveaddressisequaltothethirdheaderbyteforphysicaladdressingorsecondheaderbyte+1forfunctionaladdressing.Thereceiveaddresschangeswhenevertheheaderbyteschanges.Bxx[setBaudrates]Default:115200BaudSetdesiredBaudrate.TheinterfacewillchangetheBaudrateimmediatelyafterexecutingthecommand.StatusmessageisreturnedwithnewBaudrateset.Possiblevaluesforxx:0=9600Baud1=14400Baud2=19200Baud3=28800Baud4=38400Baud5=57600BaudAnyothervalue=115200BaudNote:DefaultBaudrateisconfiguredinfilemain.hD[setDefaults]Setallinterfacevaluestodefault.E0orE1[Echoon/off]Default:ONWithechoonallcharactersreceivedviaRS232areechoedbacktouserterminal.FD[FormattedData]Default:ONAllresponsesarereturnedasstandardASCIIcharactersreadableonanyterminalprogram.Hexvaluesarereturnedas2byteASCIIvalues,separatedbyspaceandterminatedbycarriagereturnandoptionallinefeed.H0orH1[Headeron/off]Default:OFFControlswhetherornottheheaderandCRCbytesareshownforreceivedVPWmessages.I[Ident]Returnsinterfaceidentifystring.L0orL1[Linefeedon/off]Default:ONControlswhetherornotalinefeedcharacterisreturnedwitheachcarriagereturncharacter.MA[MonitorAll]Settheinterfaceinmonitormode.AllmessagereceivedviaVPWbusarereturned,optionalwithheaderandCRC.Anyserialinputwillstopthismodeandtheinterfacereturnstoidlestatewaitingforuserinputs.Note:YouwillseegarbageoutputifMAmodeisenabled,HeaderoutputisdisabledandVPWframesaretransmittedwithonebyteheaderonly.UsecommandATO1firsttoenableonebyteheadermodusforcorrectoutput!MIxx[MonitorID]Settheinterfaceinmonitormodeforaspeci
本文标题:AVR-J1850-VPW-Interface-Documentation
链接地址:https://www.777doc.com/doc-1332976 .html