




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
苏州大学本科生毕业设计(论文)附件:外文文献资料与中文翻译稿外文文献资料收集:苏州大学 应用技术学院 11电子班(学号1116405045)颜媛TheintroductiontotheDS18B201.DESCRIPTIONTheDS18B20digitalthermometerprovides9-bitto12-bitCelsiustemperaturemeasurementsandhasanalarmfunctionwithnonvolatileuserprogrammableupperandlowertriggerpoints.TheDS18B20communicatesovera1-Wirebusthatbydefinitionrequiresonlyonedatalineforcommunicationwithacentralmicroprocessor.Ithasanoperatingtemperaturerangeof-55Cto+125Candisaccurateto0.5Covertherangeof-10Cto+85C.Inaddition,theDS18B20canderivepowerdirectlyfromthedataline(“parasitepower”),eliminatingtheneedforanexternalpowersupply.EachDS18B20hasaunique64-bitserialcode,whichallowsmultipleDS18B20stofunctiononthesame1-Wirebus.Thus,itissimpletouseonemicroprocessortocontrolmanyDS18B20sdistributedoveralargearea.ApplicationsthatcanbenefitfromthisfeatureincludeHVACenvironmentalcontrols,temperaturemonitoringsystemsinsidebuildings,equipment,ormachinery,andprocessmonitoringandcontrolsystems.2. FEATURESUnique1-WireInterfaceRequiresOnlyOnePortPinforCommunicationlEachDevicehasaUnique64-BitSerialCodeStoredinanOn-BoardROMlMulti-dropCapabilitySimplifiesDistributedTemperature-SensingApplicationslRequiresNoExternalComponentsCanBePoweredfromDataLine;PowerSupplyRangeis3.0Vto5.5VlMeasuresTemperaturesfrom-55Cto+125C(-67Fto+257F)l0.5CAccuracyfrom-10Cto+85CThermometerResolutionisUserSelectablefrom9to12BitslConvertsTemperatureto12-BitDigitalWordin750ms(Max)lUser-DefinableNonvolatile(NV)AlarmSettingsAlarmSearchCommandIdentifiesandAddressesDevicesWhoseTemperatureisOutsideProgrammedLimitsSoftwareCompatiblewiththeDS1822ApplicationsIncludeThermostaticControls,IndustrialSystems,ConsumerProducts,Thermometers,orAnyThermallySensitiveSystem3. OVERVIEWFigure1showsablockdiagramoftheDS18B20,andpindescriptionsaregiveninthePinDescriptiontable.The64-bitROMstoresthedevicesuniqueserialcode.Thescratchpadmemorycontainsthe2-bytetemperatureregisterthatstoresthedigitaloutputfromthetemperaturesensor.Inaddition,thescratchpadprovidesaccesstothe1-byteupperandloweralarmtriggerregisters(THandTL)andthe1-byteconfigurationregister.Theconfigurationregisterallowstheusertosettheresolutionofthetemperatureto-digitalconversionto9,10,11,or12bits.TheTH,TL,andconfigurationregistersarenonvolatile(EEPROM),sotheywillretaindatawhenthedeviceispowereddown.TheDS18B20usesMaximsexclusive1-Wirebusprotocolthatimplementsbuscommunicationusingonecontrolsignal.Thecontrollinerequiresaweakpullupresistorsincealldevicesarelinkedtothebusviaa3-stateoropen-drainport(theDQpininthecaseoftheDS18B20).Inthisbussystem,themicroprocessor(themasterdevice)identifiesandaddressesdevicesonthebususingeachdevicesunique64-bitcode.Becauseeachdevicehasauniquecode,thenumberofdevicesthatcanbeaddressedononeDS18B20busisvirtuallyunlimited.The1-Wirebusprotocol,includingdetailedexplanationsofthecommandsand“timeslots,”iscoveredinthe1-WireBusSystemsection.AnotherfeatureoftheDS18B20istheabilitytooperatewithoutanexternalpowersupply.Powerisinsteadsuppliedthroughthe1-WirepullupresistorviatheDQpinwhenthebusishigh.Thehighbussignalalsochargesaninternalcapacitor(CPP),whichthensuppliespowertothedevicewhenthebusislow.Thismethodofderivingpowerfromthe1-Wirebusisreferredtoas“parasitepower.”Asanalternative,theDS18B20mayalsobepoweredbyanexternalsupplyonVDD.Figure1.DS18B20 Block Diagram4. OPERATIONMEASURINGTEMPERATURThecorefunctionalityoftheDS18B20isitsdirect-to-digitaltemperaturesensor.Theresolutionofthetemperaturesensorisuser-configurableto9,10,11,or12bits,correspondingtoincrementsof0.5C,0.25C,0.125C,and0.0625C,respectively.Thedefaultresolutionatpower-upis12-bit.TheDS18B20powersupinalow-poweridlestate.ToinitiateatemperaturemeasurementandA-to-Dconversion,themastermustissueaConvertT44hcommand.Followingtheconversion,theresultingthermaldataisstoredinthe2-bytetemperatureregisterinthescratchpadmemoryandtheDS18B20returnstoitsidlestate.IftheDS18B20ispoweredbyanexternalsupply,themastercanissue“readtimeslots”(seethe1-WireBusSystemsection)aftertheConvertTcommandandtheDS18B20willrespondbytransmitting0while thetemperatureconversionisinprogressand1whentheconversionisdone.IftheDS18B20ispoweredwithparasitepower,thisnotificationtechniquecannotbeusedsincethebusmustbepulledhighbyastrongpullupduringtheentiretemperatureconversion.TheDS18B20outputtemperaturedataiscalibratedindegreesCelsius;forFahrenheitapplications,alookuptableorconversionroutinemustbeused.Thetemperaturedataisstoredasa16-bitsign-extendedtwoscomplementnumberinthetemperatureregister(seeFigure2).Thesignbits(S)indicateifthetemperatureispositiveornegative:forpositivenumbersS=0andfornegativenumbersS=1.IftheDS18B20isconfiguredfor12-bitresolution,allbitsinthetemperatureregisterwillcontainvaliddata.For11-bitresolution,bit0isundefined.For10-bitresolution,bits1and0areundefined,andfor9-bitresolutionbits2,1,and0areundefined.Table1givesexamplesofdigitaloutputdataandthecorrespondingtemperaturereadingfor12-bitresolutionconversions.Figure2.Temperature Register FormatTable1. Temperature/Data Relationship5. 64-BITLASEREDROMCODEEachDS18B20containsaunique64bitcode(seeFigure3)storedinROM.Theleastsignificant8bitsoftheROMcodecontaintheDS18B20s1-Wirefamilycode:28h.Thenext48bitscontainauniqueserialnumber.Themostsignificant8bitscontainacyclicredundancycheck(CRC)bytethatiscalculatedfromthefirst56bitsoftheROMcode.The64-bitROMcodeandassociatedROMfunctioncontrollogicallowtheDS18B20tooperateasa1-Wiredeviceusingtheprotocoldetailedinthe1-WireBusSystemsection.Figure3.64-Bit Lasered ROM Code6. MEMORYTheDS18B20smemoryisorganizedasshowninFigure4.ThememoryconsistsofanSRAMscratchpadwithnonvolatileEEPROMstorageforthehighandlowalarmtriggerregisters(THandTL)andconfigurationregister.NotethatiftheDS18B20alarmfunctionisnotused,theTHandTLregisterscanserveasgeneral-purposememory.Byte0andbyte1ofthescratchpadcontaintheLSBandtheMSBofthetemperatureregister,respectively.Thesebytesareread-only.Bytes2and3provideaccesstoTHandTLregisters.Byte4containstheconfigurationregisterdata.Bytes5,6,and7arereservedforinternalusebythedeviceandcannotbeoverwritten.Byte8ofthescratchpadisread-onlyandcontainstheCRCcodeforbytes0through7ofthescratchpad.TheDS18B20generatesthisCRCusingthemethoddescribedintheCRCGenerationsection.Dataiswrittentobytes2,3,and4ofthescratchpadusingtheWriteScratchpad4Ehcommand;thedatamustbetransmittedtotheDS18B20startingwiththeleastsignificantbitofbyte2.Toverifydataintegrity,thescratchpadcanberead(usingtheReadScratchpadBEhcommand)afterthedataiswritten.Whenreadingthescratchpad,dataistransferredoverthe1-Wirebusstartingwiththeleastsignificant bitofbyte0.TotransfertheTH,TLandconfigurationdatafromthescratchpadtoEEPROM,themastermustissuetheCopyScratchpad48hcommand.Figure4.DS18B20 Memory Map7. CONFIGURATIONREGISTERByte4ofthescratchpadmemorycontainstheconfigurationregister,whichisorganizedasillustratedinFigure5.TheusercansettheconversionresolutionoftheDS18B20usingtheR0andR1bitsinthisregisterasshowninTable2.Thepower-updefaultofthesebitsisR0=1andR1=1(12-bitresolution).Notethatthereisadirecttradeoffbetweenresolutionandconversiontime.Bit7andbits0to4intheconfigurationregisterarereservedforinternalusebythedeviceandcannotbeoverwritten.Figure5.Configuration RegisterTable2.Thermometer Resolution Configuration8. 1-WIREBUSSYSTEMThe1-Wirebussystemusesasinglebusmastertocontroloneormoreslavedevices.TheDS18B20isalwaysaslave.Whenthereisonlyoneslaveonthebus,thesystemisreferredtoasa“single-drop”system;thesystemis“multi-drop”iftherearemultipleslavesonthebus.Alldataandcommandsaretransmittedleastsignificantbitfirstoverthe1-Wirebus.Thefollowingdiscussionofthe1-Wirebussystemisbrokendownintothreetopics:hardwareconfiguration,transactionsequence,and1-Wiresignaling(signaltypesandtiming).9. TRANSACTIONSEQUENCEThetransactionsequenceforaccessingtheDS18B20isasfollows:Step1.InitializationStep2.ROMCommand(followedbyanyrequireddataexchange)Step3.DS18B20FunctionCommand(followedbyanyrequireddataexchange)ItisveryimportanttofollowthissequenceeverytimetheDS18B20isaccessed,astheDS18B20willnotrespondifanystepsinthesequencearemissingoroutoforder.ExceptionstothisrulearetheSearchROMF0handAlarmSearchEChcommands.AfterissuingeitheroftheseROMcommands,themastermustreturntoStep1inthesequence.(1)INITIALIZATIONAlltransactionsonthe1-Wirebusbeginwithaninitializationsequence.Theinitializationsequenceconsistsofaresetpulsetransmittedbythebusmasterfollowed bypresencepulse(s)transmittedbytheslave(s).Thepresencepulseletsthebusmasterknowthatslavedevices(suchastheDS18B20)areonthebusandarereadytooperate.(2)ROMCOMMANDSAfterthebusmasterhasdetectedapresencepulse,itcanissueaROMcommand.Thesecommandsoperateontheunique64-bitROMcodesofeachslavedeviceandallowthemastertosingleoutaspecificdeviceifmanyarepresentonthe1-Wirebus.Thesecommandsalsoallowthemastertodeterminehowmanyandwhattypesofdevicesarepresentonthebusorifanydevicehasexperiencedanalarmcondition.TherearefiveROMcommands,andeachcommandis8bitslong.ThemasterdevicemustissueanappropriateROMcommandbeforeissuingaDS18B20functioncommand.1. SEARCHROMF0hWhenasystemisinitiallypoweredup,themastermustidentifytheROMcodesofallslavedevicesonthebus,whichallowsthemastertodeterminethenumberofslavesandtheirdevicetypes.ThemasterlearnstheROMcodesthroughaprocessofeliminationthatrequiresthemastertoperformaSearchROMcycle(i.e.,SearchROMcommandfollowedbydataexchange)asmanytimesasnecessarytoidentifyalloftheslavedevices.Ifthereisonlyoneslaveonthebus,thesimplerReadROMcommandcanbeusedinplaceoftheSearchROMprocess.2. READROM33hThiscommandcanonlybeusedwhenthereisoneslaveonthebus.Itallowsthebusmastertoreadtheslaves64-bitROMcodewithoutusingtheSearchROMprocedure.Ifthiscommandisusedwhenthereismorethanoneslavepresentonthebus,adatacollisionwilloccurwhenalltheslavesattempttorespondatthesametime.3. MATCHROM55hThematchROMcommandfollowedbya64-bitROMcodesequenceallows thebusmastertoaddressaspecificslavedeviceonamulti-droporsingle-dropbus.Onlytheslavethatexactlymatchesthe64-bitROMcodesequencewillrespondtothefunctioncommandissuedbythemaster;allotherslavesonthebuswillwaitforaresetpulse.4. SKIPROMCChThemastercanusethiscommandtoaddressalldevicesonthebussimultaneouslywithoutsendingoutanyROMcodeinformation.Forexample,themastercanmakeallDS18B20sonthebusperformsimultaneoustemperatureconversionsbyissuingaSkipROMcommandfollowedbyaConvertT44hcommand.NotethattheReadScratchpadBEhcommandcanfollowtheSkipROMcommandonlyifthereisasingleslavedeviceonthebus.Inthiscase,timeissavedbyallowingthemastertoreadfromtheslavewithoutsendingthedevices64-bitROMcode.ASkipROMcommandfollowedbyaReadScratchpadcommandwillcauseadatacollisiononthebusifthereismorethanoneslavesincemultipledeviceswillattempttotransmitdatasimultaneously.5. ALARMSEARCHEChTheoperationofthiscommandisidenticaltotheoperationoftheSearchROMcommandexceptthatonlyslaveswithasetalarmflagwillrespond.ThiscommandallowsthemasterdevicetodetermineifanyDS18B20sexperiencedanalarmconditionduringthemostrecenttemperatureconversion.AftereveryAlarmSearchcycle(i.e.,AlarmSearchcommandfollowedbydataexchange),thebusmastermustreturntoStep1(Initialization)inthetransactionsequence. (3)DS18B20FUNCTIONCOMMANDSAfterthebusmasterhasusedaROMcommandtoaddresstheDS18B20withwhichitwishestocommunicate,themastercanissueoneoftheDS18B20functioncommands.ThesecommandsallowthemastertowritetoandreadfromtheDS18B20sscratchpadmemory,initiatetemperatureconversionsanddeterminethepowersupplymode.1. CONVERTT44hThiscommandinitiatesasingletemperatureconversion.Followingtheconversion,theresultingthermaldataisstoredinthe2-bytetemperatureregisterinthescratchpadmemoryandtheDS18B20returnstoitslow-poweridlestate.Ifthedeviceisbeingusedinparasitepowermode,within10s(max)afterthiscommandisissuedthemastermustenableastrongpulluponthe1-Wirebus.IftheDS18B20ispoweredbyanexternalsupply,themastercanissuereadtimeslotsaftertheConvertTcommandandtheDS18B20willrespondbytransmittinga0whilethetemperatureconversionisinprogressanda1whentheconversionisdone.Inparasitepowermodethisnotificationtechniquecannotbeusedsincethebusispulledhighbythestrongpullupduringtheconversion.2. READSCRATCHPADBEhThiscommandallowsthemastertoreadthecontentsofthescratchpad.Thedatatransferstartswiththeleastsignificantbitofbyte0andcontinuesthroughthescratchpaduntilthe9thbyte(byte8CRC)isread.Themastermayissuearesettoterminatereadingatanytimeifonlypartofthescratchpaddataisneeded.3. WRITESCRATCHPAD4EhThiscommandallowsthemastertowrite3bytesofdatatotheDS18B20sscratchpad.ThefirstdatabyteiswrittenintotheTHregister(byte2ofthescratchpad),thesecondbyteiswrittenintotheTLregister(byte3),andthethirdbyteiswrittenintotheconfigurationregister(byte4).Datamustbetransmittedleastsignificantbitfirst.AllthreebytesMUSTbewrittenbeforethemasterissuesareset,orthedatamaybecorrupted.4. COPYSCRATCHPAD48hThiscommandcopiesthecontentsofthescratchpadTH,TLandconfigurationregisters(bytes2,3and4)toEEPROM.Ifthedeviceisbeingusedinparasitepowermode,within10s(max)afterthiscommandisissuedthemastermustenablea strongpull-uponthe1-Wirebus.5. RECALLE2B8hThiscommandrecallsthealarmtriggervalues(THandTL)andconfigurationdatafromEEPROMandplacesthedatainbytes2,3,and4,respectively,inthescratchpadmemory.ThemasterdevicecanissuereadtimeslotsfollowingtheRecallE2commandandtheDS18B20willindicatethestatusoftherecallbytransmitting0whiletherecallisinprogressand1whentherecallisdone.Therecalloperationhappensautomaticallyatpower-up,sovaliddataisavailableinthescratchpadassoonaspowerisappliedtothedevice.6READPOWERSUPPLYB4hThemasterdeviceissuesthiscommandfollowedbyareadtimeslottodetermineifanyDS18B20sonthebusareusingparasitepower.Duringthereadtimeslot,parasitepoweredDS18B20swillpullthebuslow,andexternallypoweredDS18B20swillletthebusremainhigh.10. WIRESIGNALINGTheDS18B20usesastrict1-Wirecommunicationprotocoltoensuredataintegrity.Severalsignaltypesaredefinedbythisprotocol:resetpulse,presencepulse,write0,write1,read0,andread1.Thebusmasterinitiatesallthesesignals,withtheexceptionofthepresencepulse. (1)INITIALIZATIONPROCEDURERESETANDPRESENCEPULSESAllcommunicationwiththeDS18B20beginswithaninitializationsequencethatconsistsofaresetpulsefromthemasterfollowedbyapresencepulsefromtheDS18B20.ThisisillustratedinFigure6.WhentheDS18B20sendsthepresencepulseinresponsetothereset,itisindicatingtothemasterthatitisonthebusandreadytooperate.Duringtheinitializationsequencethebusmastertransmits(TX)theresetpulsebypullingthe1-Wirebuslowforaminimumof480s.Thebusmasterthenreleases thebusandgoesintoreceivemode(RX).Whenthebusisreleased,the5kpull-upresistorpullsthe1-Wirebushigh.WhentheDS18B20detectsthisrisingedge,itwaits15sto60sandthentransmitsapresencepulsebypullingthe1-Wirebuslowfor60sto240s.Figure6.Initialization Timing(2)READ/WRITETIMESLOTSThebusmasterwritesdatatotheDS18B20duringwritetimeslotsandreadsdatafromtheDS18B20duringreadtimeslots.Onebitofdataistransmittedoverthe1-Wirebuspertimeslot.1. WRITETIMESLOTSTherearetwotypesofwritetimeslots:“Write1”timeslotsand
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 年产550台血液成分分离机项目可行性研究报告
- 类脑神经形态CPU项目可行性研究报告
- (一检)泉州市2026届高中毕业班质量监测(一)语文试卷(含标准答案)
- 新房装修合同
- 防暴警察原理知识培训总结
- 网购服务协议范本
- 浙江省湖州2025年九年级上学期月考数学试题附答案
- 云平台协同管理-洞察及研究
- 园区工厂建设工程承包合同2篇
- 公司工业借款担保合同书3篇
- 部编高教版2023·职业模块 中职语文 2.《宁夏闽宁镇:昔日干沙滩今日金沙滩》 课件
- 检验科标本采集手册
- 毒品与毒品的危害课件
- 空转耕地占用税和契税课件
- 物理因子治疗技术 压力疗法课件
- 烧结基础知识课件
- 锅炉煮炉方案
- (中职)工业机器人应用编程(FANUC) 初级 项目六 任务三 码垛程序编制电子课件
- 合肥工业大学推免生综合评价加分细则
- 数学人教A版(2019)必修第一册1.3集合的基本运算(共17张ppt)
- (完整PPT)半导体物理与器件物理课件
评论
0/150
提交评论