RS-422-485协议英文介绍.doc_第1页
RS-422-485协议英文介绍.doc_第2页
RS-422-485协议英文介绍.doc_第3页
RS-422-485协议英文介绍.doc_第4页
RS-422-485协议英文介绍.doc_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

RS-422andRS-485applicationnoteChapter1:OverviewIntroductionThepurposeofthisapplicationnoteistodescribethemainelementsofanRS-422andRS-485system.Thisapplicationnoteattemptstocoverenoughtechnicaldetailssothatthesystemdesignerwillhaveconsideredalltheimportantaspectsinhisdatasystemdesign.SincebothRS-422andRS-485aredatatransmissionsystemsthatusebalanceddifferentialsignals,itisappropriatetodiscussbothsystemsinthesameapplicationnote.ThroughoutthisapplicationnotethegenerictermsofRS-422andRS-485willbeusedtorepresenttheEIA/TIA-422andEIA/TIA-485Standards.DataTransmissionSignalsUnbalancedLineDriversEachsignalthattransmitsinanRS-232unbalanceddatatransmissionsystemappearsontheinterfaceconnectorasavoltagewithreferencetoasignalground.Forexample,thetransmitteddata(TD)fromaDTEdeviceappearsonpin2withrespecttopin7(signalground)onaDB-25connector.Thisvoltagewillbenegativeifthelineisidleandalternatebetweenthatnegativelevelandapositivelevelwhendataissentwithamagnitudeof5to15volts.TheRS-232receivertypicallyoperateswithinthevoltagerangeof+3to+12and-3to-12voltsasshowninFigure1.1.BalancedLineDriversInabalanceddifferentialsystemthevoltageproducedbythedriverappearsacrossapairofsignallinesthattransmitonlyonesignal.Figure1.2showsaschematicsymbolforabalancedlinedriverandthevoltagesthatexist.Abalancedlinedriverwillproduceavoltagefrom2to6voltsacrossitsAandBoutputterminalsandwillhaveasignalground(C)connection.Althoughproperconnectiontothesignalgroundisimportant,itisntusedbyabalancedlinereceiverindeterminingthelogicstateofthedataline.Abalancedlinedrivercanalsohaveaninputsignalcalledan“Enable”signal.Thepurposeofthissignalistoconnectthedrivertoitsoutputterminals,AandB.Ifthe“Enable”signalisOFF,onecanconsiderthedriverasdisconnectedfromthetransmissionline.AnRS-485drivermusthavethe“Enable”controlsignal.AnRS-422drivermayhavethissignal,butitisnotalwaysrequired.Thedisconnectedordisabledconditionofthelinedriverusuallyisreferredtoasthe“tristate1”conditionofthedriver.1Theterm“tristate”comesfromthefactthatthereisathirdoutputstateofanRS-485driver,inadditiontotheoutputstatesof“1”and“0.”BalancedLineReceiversAbalanceddifferentiallinereceiversensesthevoltagestateofthetransmissionlineacrosstwosignalinputlines,AandB.Itwillalsohaveasignalground(C)thatisnecessaryinmakingtheproperinterfaceconnection.Figure1.3isaschematicsymbolforabalanceddifferentiallinereceiver.Figure1.3alsoshowsthevoltagesthatareimportanttothebalancedlinereceiver.IfthedifferentialinputvoltageVabisgreaterthan+200mVthereceiverwillhaveaspecificlogicstateonitsoutputterminal.Iftheinputvoltageisreversedtolessthan-200mVthereceiverwillcreatetheoppositelogicstateonitsoutputterminal.TheinputvoltagesthatabalancedlinereceivermustsenseareshowninFigure1.3.The200mVto6Vrangeisrequiredtoallowforattenuationonthetransmissionline.EIAStandardRS-422DataTransmissionTheEIAStandardRS-422-Aentitled“ElectricalCharacteristicsofBalancedVoltageDigitalInterfaceCircuits”definesthecharacteristicsofRS-422interfacecircuits.Figure1.4isatypicalRS-422four-wireinterface.Noticethatfiveconductorsareused.Eachgeneratorordrivercandriveuptoten(10)receivers.Thetwosignalingstatesofthelinearedefinedasfollows:a.Whenthe“A”terminalofthedriverisnegativewithrespecttothe“B”terminal,thelineisinabinary1(MARKorOFF)state.b.Whenthe“A”terminalofthedriverispositivewithrespecttothe“B”terminal,thelineisinabinary0(SPACEorON)state.Figure1.5showstheconditionofthevoltageofthebalancedlineforanRS-232toRS-422converterwhenthelineisinthe“idle”conditionorOFFstate.Italsoshowstherelationshipofthe“A” and“B”terminalsofanRS-422systemandthe“-”and“+”terminalmarkingsusedonmanytypesofequipment.The“A”terminalisequivalenttothe“-”designation,andthe“B”terminalequivalenttothe“+”designation.ThesamerelationshipshowninFigure1.5alsoappliesforRS-485systems.RS-422canwithstandacommonmodevoltage(Vcm)of7volts.CommonmodevoltageisdefinedasthemeanvoltageoftheAandBterminalswithrespecttosignalground.EIAStandardRS-485DataTransmissionTheRS-485Standardpermitsabalancedtransmissionlinetobesharedinapartylineormultidropmode.Asmanyas32driver/receiverpairscanshareamultidropnetwork.ManycharacteristicsofthedriversandreceiversarethesameasRS-422.TherangeofthecommonmodevoltageVcmthatthedriverandreceivercantolerateisexpandedto+12to-7volts.Sincethedrivercanbedisconnectedortristatedfromtheline,itmustwithstandthiscommonmodevoltagerangewhileinthetristatecondition.SomeRS-422drivers,evenwithtristatecapability,willnotwithstandthefullVcmvoltagerangeof+12to-7volts.Figure1.6showsatypicaltwo-wiremultidropnetwork.Notethatthetransmissionlineisterminatedonbothendsofthelinebutnotatdroppointsinthemiddleoftheline.Terminationshouldonlybeusedwithhighdataratesandlongwiringruns.AdetaileddiscussionofterminationcanbefoundinChapter2ofthisapplicationnote.ThesignalgroundlineisalsorecommendedinanRS-485systemtokeepthecommonmodevoltagethatthereceivermustacceptwithinthe-7to+12voltrange.FurtherdiscussionofgroundingcanbefoundinChapter3ofthisapplicationnote.AnRS-485networkcanalsobeconnectedinafour-wiremodeasshowninFigure1.7.Notethatfourdatawiresandanadditionalsignalgroundwireareusedina“four-wire”connection.Inafour-wirenetworkitisnecessarythatonenodebeamasternodeandallothersbeslaves.Thenetworkisconnectedsothatthemasternodecommunicatestoallslavenodes.Allslavenodescommunicateonlywiththemasternode.Thisnetworkhassomeadvantageswithequipmentwithmixedprotocolcommunications.Sincetheslavenodesneverlistentoanotherslaveresponsetothemaster,aslavenodecannotreplyincorrectlytoanotherslavenode.TristateControlofanRS-485DeviceusingRTSAsdiscussedpreviously,anRS-485systemmusthaveadriverthatcanbedisconnectedfromthetransmissionlinewhenaparticularnodeisnottransmitting.InanRS-232toRS-485converteroranRS-485serialcard,thismaybeimplementedusingtheRTScontrolsignalfromanasynchronousserialporttoenabletheRS-485driver.TheRTSlineisconnectedtotheRS-485driverenablesuchthatsettingtheRTSlinetoahigh(logic1)stateenablestheRS-485driver.SettingtheRTSlinelow(logic0)putsthedriverintothetristatecondition.Thisineffectdisconnectsthedriverfromthebus,allowingothernodestotransmitoverthesamewirepair.Figure1.8showsatimingdiagramforatypicalRS-232toRS-485converter.ThewaveformsshowwhathappensiftheVRTSwaveformisnarrowerthanthedataVSD.Thisisnotthenormalsituation,butisshownheretoillustratethelossofaportionofthedatawaveform.WhenRTScontrolisused,itisimportanttobecertainthatRTSissethighbeforedataissent.Also,theRTSlinemustthenbesetlowafterthelastdatabitissent.Thistimingisdonebythesoftwareusedtocontroltheserialportandnotbytheconverter.WhenanRS-485networkisconnectedinatwo-wiremultidroppartylinemode,thereceiverateachnodewillbeconnectedtotheline(seeFigure1.6).Thereceivercanoftenbeconfiguredtoreceiveanechoofitsowndatatransmission.Thisisdesirableinsomesystems,andtroublesomeinothers.Besuretocheckthedatasheetforyourconvertertodeterminehowthereceiver“enable”functionisconnected.Send Data Control of an rs-485 DeviceMany of B&B Electronics RS-232 to RS-485 converters and RS-485 serial cards include special circuitry ,which is triggered from the data signal to enable the RS-485 driver.Figure 1.9 is a timing diagram of the important signals used to control a converter of this type.It is important to note that the transmit data line is “disabled”at a fixed interval after the last bit ,typically one character length.If this interval after the is too short,you can miss parts of each character being sent .If this time is too long,your system may try to turn the data lone around from transmit to receive before the node (with the Send Data converter) is ready to receive data.If the latter is the case,you will miss portions (or complete characters) at the beginning of a response.Chapter2:SystemConfigurationNetworkTopologiesNetworkconfigurationisntdefinedintheRS-422orRS-485specification.Inmostcasesthedesignercanuseaconfigurationthatbestfitsthephysicalrequirementsofthesystem.TwoWireorFourWireSystemsRS-422systemsrequireadedicatedpairofwiresforeachsignal,atransmitpair,areceivepairandanadditionalpairforeachhandshake/controlsignalused(ifrequired).ThetristatecapabilitiesofRS-485allowasinglepairofwirestosharetransmitandreceivesignalsforhalf-duplexcommunications.This“twowire”configuration(notethatanadditionalgroundconductorshouldbeused)reducescablingcost.RS-485devicesmaybeinternallyorexternallyconfiguredfortwowiresystems.InternallyconfiguredRS-485devicessimplyprovideAandBconnections(sometimeslabeled“-“and“+”).DevicesconfiguredforfourwirecommunicationsbringoutAandBconnectionsforboththetransmitandthereceivepairs.Theusercanconnectthetransmitlinestothereceivelinestocreateatwowireconfiguration.Thelattertypedeviceprovidesthesystemdesignerwiththemostconfigurationflexibility.Notethatthesignalgroundlineshouldalsobeconnectedinthesystem.ThisconnectionisnecessarytokeeptheVcmcommonmodevoltageatthereceiverwithinasaferange.Theinterfacecircuitmayoperatewithoutthesignalgroundconnection,butmaysacrificereliabilityandnoiseimmunity.Figures2.0and2.1illustrateconnectionsoftwoandfourwiresystems.TerminationTerminationisusedtomatchimpedanceofanodetotheimpedanceofthetransmissionlinebeingused.Whenimpedancearemismatched,thetransmittedsignalisnotcompletelyabsorbedbytheloadandaportionisreflectedbackintothetransmissionline.Ifthesource,transmissionlineandloadimpedanceareequalthesereflectionsareeliminated.Therearedisadvantagesofterminationaswell.Terminationincreasesloadonthedrivers,increasesinstallationcomplexity,changesbiasingrequirementsandmakessystemmodificationmoredifficult.Thedecisionwhetherornottouseterminationshouldbebasedonthecablelengthanddatarateusedbythesystem.Agoodruleofthumbisifthepropagationdelayofthedatalineismuchlessthanonebitwidth,terminationisnotneeded.Thisrulemakestheassumptionthatreflectionswilldampoutinseveraltripsupanddownthedataline.SincethereceivingUARTwillsamplethedatainthemiddleofthebit,itisimportantthatthesignallevelbesolidatthatpoint.Forexample,inasystemwith2000feetofdatalinethepropagationdelaycanbecalculatedbymultiplyingthecablelengthbythepropagationvelocityofthecable.Thisvalue,typically66to75%ofthespeedoflight(c),isspecifiedbythecablemanufacture.Forourexample,aroundtripcovers4000feetofcable.Usingpropagationvelocity of0.66c,oneroundtripiscompletedinapproximately6.2s.Ifweassumethereflectionswilldampoutinthree“roundtrips”upanddownthecablelength,thesignalwillstabilize18.6saftertheleadingedgeofabit.At9600baudonebitis104swide.Sincethereflectionsaredampedoutmuchbeforethecenterofthebit,terminationisnotrequired.Thereareseveralmethodsofterminatingdatalines.ThemethodrecommendedbyB&Bisparalleltermination.Aresistorisaddedinparallelwiththereceivers“A”and“B”linesinordertomatchthedatalinecharacteristicimpedancespecifiedbythecablemanufacture(120isacommonvalue).Thisvaluedescribestheintrinsicimpedanceofthetransmissionlineandisnotafunctionofthelinelength.Aterminatingresistoroflessthan90shouldnotbeused.Terminationresistorsshouldbeplacedonlyattheextremeendsofthedataline,andnomorethantwoterminationsshouldbeplacedinanysystemthatdoesnotuserepeaters.ThistypeofterminationclearlyaddsheavyDCloadingtoasystemandmayoverloadportpoweredRS-232toRS-485converters.Anothertypeoftermination,ACcoupledtermination,addsasmallcapacitorinserieswiththeterminationresistortoeliminatetheDCloadingeffect.AlthoughthismethodeliminatesDCloading,capacitorselectionishighlydependentonthesystemproperties.SystemdesignersinterestedinACterminationareencouragedtoreadNationalSemiconductorsApplicationNote9032forfurtherinformation.Figure2.2illustratesbothparallelandACterminationonanRS-485two-wirenode.Infour-wiresystems,theterminationisplacedacrossthereceiverof thenode.BiasinganRS-485NetworkWhenanRS-485networkisinanidlestate,allnodesareinlisten(receive)mode.Underthisconditiontherearenoactivedriversonthenetwork,alldriversaretristated.Withoutanythingdrivingthenetwork,thestateofthelineisunknown.Ifthevoltage level atthereceiversAandBinputsis less than200mVthelogiclevelattheoutputofthereceiverswillbethevalueofthelastbitreceived.Inordertomaintaintheproperidlevoltagestate,biasresistorsmustbeappliedtoforcethedatalinestotheidlecondition.BiasresistorsarenothingmorethanapullupresistoronthedataBline(typicallyto5volts)andapulldown(toground)onthedataAline.Figure2.3illustratestheplacementofbiasresistorsonatransceiverinatwo-wireconfiguration.NotethatinanRS-485four-wireconfiguration,thebiasresistorsshouldbeplacedonthereceiverlines.Thevalueofthebiasresistorsisdependentonterminationandnumberofnodesinthesystem.ThegoalistogenerateenoughDCbiascurrentinthenetworktomaintainaminimumof200mVbetweentheBandAdataline.Considerthefollowingtwoexamplesofbiasresistorcalculation.Example1.10node,RS-485networkwithtwo120terminationresistorsEachRS-485nodehasaloadimpedanceof12K.10nodesinparallelgivealoadof1200.Additionally,thetwo120terminationresistorsresultinanother60Wload,foratotalloadof57.Clearlytheterminationresistorsareresponsibleforamajorityoftheloading.Inordertomaintainatleast200mVbetweentheBandAline,weneedabiascurrentof3.5mAtoflowthroughtheload.Tocreatethisbiasfroma5Vsupplyatotalseriesresistanceof1428orlessisrequired.Subtractthe57thatisalreadypartoftheload,andweareleftwith1371.Placinghalfofthisvalueasapullupto5Vandhalfasapulldowntogroundgivesamaximumbiasresistorvalueof685foreachofthetwobiasingresistors.Example2.32node,RS-485networkwithoutterminationEachRS-485nodehasaloadimpedanceof12K.32nodesinparallelgivesatotalloadof375.Inordertomaintainatleast200mVacross375weneedacurrentof0.53mA.Togeneratethiscurrentfroma5Vsupplyrequiresatotalresistance of9375maximum.Since375ofthistotalisinthereceiverload,ourbiasresistorsmustaddto9Korless.Noticethatverylittlebiascurrentisrequiredinsystemswithouttermination.Biasresistorscanbeplacedanywhereinthenetworkorcanbesplitamongmultiplenodes.Theparallelcombinationofallbiasresistorsinasystemmustbeequaltoorlessthanthecalculatedbiasingrequirements.B&BElectronicsuses4.7KbiasresistorsinallRS-485products.Thisvalueisadequateformostsystemswithouttermination.Thesystemdesignershouldalwayscalculatethebiasingrequirementsofthenetwork.Symptomsofunderbiasingrangefromdecreasednoiseimmunitytocompletedatafailure.Overbiasinghaslesseffectonasystem,theprimaryresultisincreasedloadonthedrivers.SystemsusingportpoweredRS-232toRS-485converterscanbesensitivetooverbiasing.ExtendingtheSpecificationSomesystemsrequirelongerdistancesorhighernumbersofnodesthansupportedbyRS-422orRS-485.Repeatersarecommonlyusedtoovercomethesebarriers.AnRS-485repeatersuchasB&BElectronics485OPcanbeplacedinasystemtodividetheloadintomultiplesegments.Each“refreshed”signaliscapableofdrivinganother4000feetofcableandanadditional31RS-485loads.AnothermethodofincreasingthenumberofRS-485nodesistouselowloadtypeRS-485receivers.ThesereceiversuseahigherinputimpedancetoreducetheloadontheRS-485driverstoincreasethetotalnumberofnodes.Therearecurrentlyhalfandquarterloadintegratedcircuitreceiversavailable,extendingthetotalallowablenumberofnodesto64and128.RS-422和RS-485应用第一章概论引言本文的目的是描述RS-422和RS-485系统的主要构成。本文尽量包含足够的技术细节以便系统设计师在数据系统设计时能考虑到所有的重要方面。因为RS-422和RS-485都是使用平衡差分信号的数据传输系统,所以将二者放在一起讨论是合适的。在本文中,RS-422和RS-485通用术语被用于代表EIA/TIA-422和EIA/TIA-485标准。数据传输信号非平衡线驱动器在不平衡数据传输系统RS-232中传输的各个信号,其出现在接口连接器的电压是以信号地为参考的。例如,对于DB-25连接器,从DTE设备传送的数据(TD)是2脚上的电压,它以信号地7脚为参考电平,如果总线为空闲状态,其电压为负,如果正在发送数据,其电压则在515伏的正电平和负电平之间反复切换。如图1.1所示,RS-232接收器的典型工作电压为+3+

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论