外文翻译--串行通信接口.doc
SerialcommunicationinterfaceRS-232andRS-485isthenormallyusedinterfacesatanytime,itnotonlybuiltineveryPC-set,butalsobuiltinanytypesofcomputerswhicharefrommicrocontrollertohostcomputers,andequipmentconnectedwiththem.ThegeneralusageofRS-232istoconnectamodern,theotherarrangementswithRS-232interfacesincludeprinter,datacollectionmodule,testingdeviceandcontrolloop.RS-232canbealsousedinthesimplelinkofanytypeofcomputer.But,RS-485canbelinkwithseveraldevicesbymeansofalonglead,ithavesamefunction.RS-232isdesignedtodealwiththecommunicationbetweentwoarrangementswithdistancelimitationfrom50to100ft,whichdependonPotterrateandtypeofelectriccable.BecauseofwideapplicationofRS-232port,itsotherusageistolinkanothertypeofadapterconvertedformtheport.Forexample,asimpleloopchangesaRS-232intoaRS-485port.Theportcanbelinkwithseveraldevicesbymeansofalonglead.Non-equilibriumleadisusedtolinkedtoRS-232.Althoughnon-equilibriumshouldsomethingavoidable,itonlyreferstotheelectricpropertyofthesignalinlead.Inanon-equilibriumlead,signalvoltageisappliedtoanotherlead,allhasanothertechnicalterm“signalend”.AdvantagesinRS-232RS-232isusedeverywhere.EveryPC-sethasoneormoreRS-232ports.TherenewedcomputerssustainotherserialinterfaceslikeUSB.ButRS-232candomanythingswhichUSBcantdo.Inthemicro-controllerinterfacechipcanbeeasilyusedtochangeintoRS-232.Thejointingdistancecanreach50-100ft.Manyexternalinterfacesarenotusedfortoolongdistance.ThelongestdistancejointofUSBcanreach16ft.ThedistancebetweenparallelprinterinterfaceonthePC-setandthehostcomputercanreach10to15ft,or30ftbyusingTypeTEEE-1284Bdriver.ButRS-232canusethelongerelectriccable.IfeveryRS-232portislinkedwithamodern,Telephonenetworkcanusedtosenddataintherageoftheworld.Foradoublelink,3leadsareneeded.Aparallelcircuitgenerallyneeds8datalines,twoormorecontrolsignallinesandgroundwires。Itismoreexpensiveifmoreleadsandbiggerconnectorsareused.DisadvantagesinRS-232Ifonesideoflinkneedsparalleldata,ithastotransformserialintoparalleldata.ButifitiseasilyrealizedaUARTisused.Becauseoftheserialportsouseful,itismaybehardertolookforafreeserialportPC-setmayhavemanyserialports,butasystemmaybecantdistributeasolebreakingenquiringsignaltoeveryserialport.Mostmicro-controlleronlyhasonehardwareserialport.Nomorethan2setinonelink.Thebiggestdesignatedtransmittingrateofdatais2000bits/s.Butmanyinterfacechipcansurpassthisnumericalvalue,especiallyintheshortdistancelink.Alongerlinkneedsadifferentinterface.3basicsignalsofthedoubleRS-232communicationasfollows:TD.TransformdataDTEtoDCEItsalsocalledTXandTXD.RD.TransformdataDCEtoDTEItsalsocalledRXandRXD.SG.Signalland.ItsalsocalledGNDandSGND.VoltageLogic0isapositiveRS-232voltage,thelogicelectriclevelofRS-232isindicatedwithpositive-negative,andnotonlyusethepositivevoltagesignalofthe5VTTLandCMOSlogictoindicate.Inthedatalogger(TD)ofRS-232,alogic0isdefinedequaltoorhigherthan+5V,andaLogic1definedequalto-5Vorlowerthan-5V.Inanotherword,signalusethenegativelogic,inthislogic,thenegativevoltageisLogic1.Controlsignalusesthesamevoltage,butitusespositivelogic.Apositivevoltageindicatesthisfunctionisonandanegativevoltageindicatesthisfunctionisoff.RS-232interfacechiptransformthesesignalsinreverse.InoutputpinofoneUART,Alogic1datumoraoffcontrolsignaliscloseto5V,itproducesnegativevoltageontheinterfaceofRS-232.Alogic0datumoranon-controlsignaliscloseto0V,itproducesapositivevoltageontheinterfaceofRS-232.BecauseoftheRS-232receptormaybeattheendofalongelectricalcable,whenthesignalreachesthereceiver,itsvoltageisprobablyweakerorwiththenoisesignal.Inconsiderationofthiscircumstanceminimumatthereceivershouldbelowerthanthevoltageatthedriver.Aninputhigherthan+3VontheRDareaLogic0,oronacontrolinputisopen.Aninputlowerthan-3VontheRDareaLogic1,oronacontrolinputisoff.Accordingtothisstandard,inputlogicelectricallevelbetween-3Vand+3VhavenodefinitionNoisetolerablelimitationorvoltagetolerablelimitationisdifferenceoutputvoltageandinputvoltage.ThebigvoltageundulationfromRS-232leadtoanoisetolerablelimitationwiderthanlogic5TTL.Forexample,eventhoughtaoutputfromRS-232driveristhesmallest+5V,itsalsobeweakeninthereceiverorthenoisepeakriseto2V,andstillisaeffectiveLogic0.ManyoutputsfromRS-232havethewidervoltageundulation:±9Vand±12Vareverycommonaffairs.Alltheseaffairscanleadtoanoiselimitation.Thebiggestpermittingvoltageundulationis±15V,eventhoughthereceivemusthavenoharmtodealwiththevoltagehigherto±25V.TheothertwotechnicaltermsconcernwithRS-232tobeusedisMarkandSpace.SpaceisLogic0andMarkisLogic1.Thesetwotechnicaltermswhichwasusedbythemachinerecordinginstrumenttorecordbinarydatainmanyyearsago,eachofthemarerepresentationphysicalandblank.ClockingLimitation:TIA/EIA-232includingsmallestandbiggestclockingstipulate.AllouttheRS-232interfacechipsallaccordthisstipulate.AppointedrevolvingspeedlimitedthebiggestPotterrateofinterface.Therevolvingrateismeasuretotherateofspeedchangewhenoutputcut-overvoltage,anddescribethechangeofinstantaneousvelocityinTheadvantageinlimitedtherevolvingisforimprovesignalqualitybyinthematteroffacttolimitedtheproblemwhichisduetovoltagedeflection,voltagedeflectionoccurthesignalinthelongdistancelinkwhichhashigh-speedriseanddescend.Theremoredetailednarrationstothisproblemareincapter10.Butrevolvingvelocityalsolimitedtothebiggestspeedofalink.Underspeedof30V/s,aoutputneed0.3stocut-overtimein166times.Actually,becausetheUARTtoreadinputdatainnearthemiddleofthedigit,andalsobecausemanytimesconsultclockinveryaccurate,usuallycanmayusethedigitwidthforcut-overtimeasshort5to10timesafety.Consideredtheseconditions,someinterfacechipspermitting115kbpsormorehigherPotterrate,eventhoughitsinfringethesuggestionthisstandard.Exceptforhasabiggestcut-overvelocity,RS-232driveralsomustaccordingtheloweststandardtoensurethesignalnostopoverintheundefinedareabetweenthelogicalcondition.Tocontrolsignalother40bpsandthelowersignal.Signallinesmustspendtimenotsurpass1sinthetransmitareabetweentheeffectiveLogic1andLogic0.Tootherdataandtimesignalthislimitationplacewideis4%orunder20bpsis2s.Frequenciesofsignalriseanddescendalsoprobablyclosetobeequal.Transformationbetween5VlogicalandRS-232Manymicro-controllershaveasynchronousserialports,buttheirinputandoutputrathertouse5VlogicthantoRS-232voltage.Tolink5VlogictoaRS-232portneedtotransformintoRS-232electricallevelandtransformfromRS-232electricallevelinto5Vlogic.Touseof5Vlogic,IsupposedtotheuseofelectricallevelofTTLorCMOSlogicchips,thesechipsaresupplyelectricitybyasingle+5Velectrical,signalelectricallevelrefertogroundingelectricallevel.Tables6-2indicatethis.Ialsosupposedtopositivelogic,inhere,thelogicalhighelectriclevelislogic1.ToTTLlogic,alogicallowoutputmustbelow0.4V,alogicallowinputmustbelow0.8V.Alogicalhighoutputmustbe2.4Vatleastandalogicalhighinputmustbe2Vatleast.Touseoftheselogicalelectricallevels,aninterfacemayhavenoisesignalat0.4Vandnotnecessarilytomakemistake.TheselogicalelectricallevelsareusedintoTTLlogicofearlydaysstandard7400seriesandotherdriversseries,including74LS74Fand74ALSTTL.TheNMOStechnologyearlyisusedtomakemicro-controllersalsousethesehelicalelectricallevels.MostCMOSchipsdefinitedifferentlogicalelectricallevelsandhavewidernoisetolerable.AlogicallowCMOSoutputbelow0.1Vandlogicallowinputmayhigherto20%electricalvoltage,ortoelectricalvoltagein5Vcanreachto1V.Alogicalhighoutputtobe4.9Vatleastandlogicalhighinputmustreachtoelectronicallyvoltages70%atleast,orto5Velectricalinputreachto3.5V.Touseofthisseriesoflogicalelectricallevel,including4000series,74HCand74AClogic.SomeofCMOSchipshaveTTLcompatibleinputandCMOScompatibleoutput.ItsmakethemcanlinkwithCMOSorTTLlogicdirectly.Thechipsoffollowtothisusualpracticeincluding74HClogicseriesandmostofmicro-controllers。串行通信接口RS-232和RS-485是在任何时候都常用的接口。它们不仅已经被内置于每台PC,而且已被内置于从微控制器到主机的多种类型的电脑和与它们连接的设备。RS-232的最通常得用处是连接到一个Modem,其他拥有RS-232接口的设备包括打印机,数据采集模块,测试装置和控制回路。你也可以将RS-232用在任何类型得计算机之间的简单连接中。RS-485则是用于线路比较长的情况下使用,其作用和RS-232一样。RS-232是设计来处理两台设备之间的通信的,距离限制为50到100f,这决定于波特率和电缆类型。因为RS-232端口被广泛应用,它的另一个用途是与一个将这个接口转换成另一种类型的适配器相连。例如,一个简单的回路将一个RS-232端口转换成一个RS-485端口,这个端口可以和多台设备相连并且可以使用更长的导线连线。RS-232连接使用非平衡导线。尽管一个非平衡的状态听起来像是一些应该避免的东西,在这里它仅仅是指导线中的信号的电气特性。在一条非平衡导线中,信号电压加到一条导线上,所有的信号电压都使用一个公共的接地线。这种类型的接口的另一个术语是单端。特性RS-232有几个优点:它是无处不在的。每一台PC机都有一个或更多的RS-232端口。更新的计算机现在支持其他诸如USB这样的串行接口,但是RS-232可以做很多USB无法做的事情。在微控制器中,接口芯片使得将一个5V串口转换成RS-232变得很容易。连接距离可以达到50到100ft。大多数的外设接口都不会用于太长的距离。USB连接最长可以达到16ft,PC机的并口打印机接口与主机的距离可以达到10到15ft,或者利用IEEE-1284B型驱动器可以达到30ft。但是RS-232可以使用更长的电缆。如果每一个RS-232端口与一个Modem相连,你可以使用电话网在世界范围内发送数据。对于一个双向连接,你只需要3条导线。一个并行连接一般需要8条数据线,两条或者更多的控制信号线,和几条接地线。所有的导线和更大的连接器使得价格累计起来就比较高了。RS-232的缺点包括以下这些:如果连接的另一头需要并行数据,它不得不将这个串口数据转换成并行数据。但是利用一个UART,这很容易实现。串口是如此的有用,以至于寻找一个未用的串口可能会比较困难。PC机可以有多个串口,但是一个系统可能无法为每一个串口分配一个唯一的中断请求信号。大多数的微控制器只有一个硬件串口。在一个连接中不能有超过2台以上的设备。指定的最大数据传输速率是每秒20000位。但是,很多接口芯片可以超过这个数值,尤其是在短程连接上。很长的连接需要一个不同的接口。双向RS-232通信的3个基本信号如下:TD:将数据从DCE传输到DCE也被称作TX和TXD。