下载
加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 DS18B20(温度传感器)

DS18B20(温度传感器).pdf

DS18B20(温度传感器)

狂奔的起司猫
2012-12-26 0人阅读 举报 0 0 暂无简介

简介:本文档为《DS18B20(温度传感器)pdf》,可适用于IT/计算机领域

ofFEATURES�UniqueWireTMinterfacerequiresonlyoneportpinforcommunication�Multidropcapabilitysimplifiesdistributedtemperaturesensingapplications�Requiresnoexternalcomponents�CanbepoweredfromdatalinePowersupplyrangeisVtoV�Zerostandbypowerrequired�Measurestemperaturesfrom°Cto°CFahrenheitequivalentis°Fto°F�±°Caccuracyfrom°Cto°C�Thermometerresolutionisprogrammablefromtobits�Convertsbittemperaturetodigitalwordinms(max)�Userdefinable,nonvolatiletemperaturealarmsettings�Alarmsearchcommandidentifiesandaddressesdeviceswhosetemperatureisoutsideofprogrammedlimits(temperaturealarmcondition)�Applicationsincludethermostaticcontrols,industrialsystems,consumerproducts,thermometers,oranythermallysensitivesystemPINASSIGNMENTPINDESCRIPTIONGNDGroundDQDataInOutVDDPowerSupplyVoltageNCNoConnectDESCRIPTIONTheDSBDigitalThermometerprovidestobit(configurable)temperaturereadingswhichindicatethetemperatureofthedeviceInformationissenttofromtheDSBoveraWireinterface,sothatonlyonewire(andground)needstobeconnectedfromacentralmicroprocessortoaDSBPowerforreading,writing,andperformingtemperatureconversionscanbederivedfromthedatalineitselfwithnoneedforanexternalpowersourceBecauseeachDSBcontainsauniquesiliconserialnumber,multipleDSBscanexistonthesameWirebusThisallowsforplacingtemperaturesensorsinmanydifferentplacesApplicationswherethisfeatureisusefulincludeHVACenvironmentalcontrols,sensingtemperaturesinsidebuildings,equipmentormachinery,andprocessmonitoringandcontrolDSBProgrammableResolutionWireDigitalThermometerwwwdalsemicomPRELIMINARYDALLASDSGNDDQVDBOTTOMVIEWDSBTOPACKAGENCNCNCGNNCNCVDDDQDSBZPINSOIC(MIL)DSBPTSOCNCDQVDDGNDNCNCDSBofDETAILEDPINDESCRIPTIONTablePINTSOCPINPINSOICPINTOSYMBOLDESCRIPTIONGNDGroundDQDataInputOutputpinForWireoperation:Opendrain(See“ParasitePower”section)VDDOptionalVDDpinSee“ParasitePower”sectionfordetailsofconnectionVDDmustbegroundedforoperationinparasitepowermodeDSBZ(pinSOIC)andDSPP(TSOC):AllpinsnotspecifiedinthistablearenottobeconnectedOVERVIEWTheblockdiagramofFigureshowsthemajorcomponentsoftheDSBTheDSBhasfourmaindatacomponents:)bitlaseredROM,)temperaturesensor,)nonvolatiletemperaturealarmtriggersTHandTL,and)aconfigurationregisterThedevicederivesitspowerfromtheWirecommunicationlinebystoringenergyonaninternalcapacitorduringperiodsoftimewhenthesignallineishighandcontinuestooperateoffthispowersourceduringthelowtimesoftheWirelineuntilitreturnshightoreplenishtheparasite(capacitor)supplyAsanalternative,theDSBmayalsobepoweredfromanexternalVVsupplyCommunicationtotheDSBisviaaWireportWiththeWireport,thememoryandcontrolfunctionswillnotbeavailablebeforetheROMfunctionprotocolhasbeenestablishedThemastermustfirstprovideoneoffiveROMfunctioncommands:)ReadROM,)MatchROM,)SearchROM,)SkipROM,or)AlarmSearchThesecommandsoperateonthebitlaseredROMportionofeachdeviceandcansingleoutaspecificdeviceifmanyarepresentontheWirelineaswellasindicatetothebusmasterhowmanyandwhattypesofdevicesarepresentAfteraROMfunctionsequencehasbeensuccessfullyexecuted,thememoryandcontrolfunctionsareaccessibleandthemastermaythenprovideanyoneofthesixmemoryandcontrolfunctioncommandsOnecontrolfunctioncommandinstructstheDSBtoperformatemperaturemeasurementTheresultofthismeasurementwillbeplacedintheDSB’sscratchpadmemory,andmaybereadbyissuingamemoryfunctioncommandwhichreadsthecontentsofthescratchpadmemoryThetemperaturealarmtriggersTHandTLconsistofbyteEEPROMeachIfthealarmsearchcommandisnotappliedtotheDSB,theseregistersmaybeusedasgeneralpurposeusermemoryThescratchpadalsocontainsaconfigurationbytetosetthedesiredresolutionofthetemperaturetodigitalconversionWritingTH,TL,andtheconfigurationbyteisdoneusingamemoryfunctioncommandReadaccesstotheseregistersisthroughthescratchpadAlldataisreadandwrittenleastsignificantbitfirstDSBofDSBBLOCKDIAGRAMFigurePARASITEPOWERTheblockdiagram(Figure)showstheparasitepoweredcircuitryThiscircuitry“steals”powerwhenevertheDQorVDDpinsarehighDQwillprovidesufficientpoweraslongasthespecifiedtimingandvoltagerequirementsaremet(seethesectiontitled“WireBusSystem”)Theadvantagesofparasitepoweraretwofold:)byparasitingoffthispin,nolocalpowersourceisneededforremotesensingoftemperature,and)theROMmaybereadinabsenceofnormalpowerInorderfortheDSBtobeabletoperformaccuratetemperatureconversions,sufficientpowermustbeprovidedovertheDQlinewhenatemperatureconversionistakingplaceSincetheoperatingcurrentoftheDSBisuptomA,theDQlinewillnothavesufficientdriveduetothekpullupresistorThisproblemisparticularlyacuteifseveralDSBsareonthesameDQandattemptingtoconvertsimultaneouslyTherearetwowaystoassurethattheDSBhassufficientsupplycurrentduringitsactiveconversioncycleThefirstistoprovideastrongpullupontheDQlinewhenevertemperatureconversionsorcopiestotheEmemoryaretakingplaceThismaybeaccomplishedbyusingaMOSFETtopulltheDQlinedirectlytothepowersupplyasshowninFigureTheDQlinemustbeswitchedovertothestrongpullupwithinµsmaximumafterissuinganyprotocolthatinvolvescopyingtotheEmemoryorinitiatestemperatureconversionsWhenusingtheparasitepowermode,theVDDpinmustbetiedtogroundAnothermethodofsupplyingcurrenttotheDSBisthroughtheuseofanexternalpowersupplytiedtotheVDDpin,asshowninFigureTheadvantagetothisisthatthestrongpullupisnotrequiredontheDQline,andthebusmasterneednotbetiedupholdingthatlinehighduringtemperatureconversionsThisallowsotherdatatrafficontheWirebusduringtheconversiontimeInaddition,anynumberofDSBsmaybeplacedontheWirebus,andiftheyalluseexternalpower,theymayallsimultaneouslyperformtemperatureconversionsbyissuingtheSkipROMcommandandthenissuingtheConvertTcommandNotethataslongastheexternalpowersupplyisactive,theGNDpinmaynotbefloatingTheuseofparasitepowerisnotrecommendedabove°C,sinceitmaynotbeabletosustaincommunicationsgiventhehigherleakagecurrentstheDSBexhibitsatthesetemperaturesForBITROMANDWIREPORTMEMORYANDCONTROLLOGICSCRATCHPADBITCRCGENERATORTEMPERATURESENSORHIGHTEMPERATURETRIGGER,THLOWTEMPERATURETRIGGER,TLCONFIGURATIONREGISTERPOWERSUPPLYSENSEINTERNALVDDDQVDDDSBofapplicationsinwhichsuchtemperaturesarelikely,itisstronglyrecommendedthatVDDbeappliedtotheDSBForsituationswherethebusmasterdoesnotknowwhethertheDSBsonthebusareparasitepoweredorsuppliedwithexternalVDD,aprovisionismadeintheDSBtosignalthepowersupplyschemeusedThebusmastercandetermineifanyDSBsareonthebuswhichrequirethestrongpullupbysendingaSkipROMprotocol,thenissuingthereadpowersupplycommandAfterthiscommandisissued,themasterthenissuesreadtimeslotsTheDSBwillsendback“”ontheWirebusifitisparasitepowereditwillsendbacka“”ifitispoweredfromtheVDDpinIfthemasterreceivesa“,”itknowsthatitmustsupplythestrongpullupontheDQlineduringtemperatureconversionsSee“MemoryCommandFunctions”sectionformoredetailonthiscommandprotocolSTRONGPULLUPFORSUPPLYINGDSBDURINGTEMPERATURECONVERSIONFigureUSINGVDDTOSUPPLYTEMPERATURECONVERSIONCURRENTFigureµPVVVVDSBGNDVDDIOKµPDSBVDDIOVVKEXTERNALVVSUPPLYTOOTHERWIREDEVICESDSBofOPERATIONMEASURINGTEMPERATUREThecorefunctionalityoftheDSBisitsdirecttodigitaltemperaturesensorTheresolutionoftheDSBisconfigurable(,,,orbits),withbitreadingsthefactorydefaultstateThisequatestoatemperatureresolutionof°C,°C,°C,or°CFollowingtheissuanceoftheConvertThcommand,atemperatureconversionisperformedandthethermaldataisstoredinthescratchpadmemoryinabit,signextendedtwo’scomplementformatThetemperatureinformationcanberetrievedovertheWire™interfacebyissuingaReadScratchpadBEhcommandoncetheconversionhasbeenperformedThedataistransferredovertheWire™bus,LSBfirstTheMSBofthetemperatureregistercontainsthe“sign”(S)bit,denotingwhetherthetemperatureispositiveornegativeTabledescribestheexactrelationshipofoutputdatatomeasuredtemperatureThetableassumesbitresolutionIftheDSBisconfiguredforalowerresolution,insignificantbitswillcontainzerosForFahrenheitusage,alookuptableorconversionroutinemustbeusedTemperatureDataRelationshipsTableLSBMSb(unit=°C)LSbSSSSSMSBTEMPERATUREDIGITALOUTPUT(Binary)DIGITALOUTPUT(Hex)°CDh°Ch*°Ch°CAh°Ch°Ch°CFFFh°CFFEh°CFFFh°CFCh*Thepoweronresetregistervalueis°COPERATIONALARMSIGNALINGAftertheDSBhasperformedatemperatureconversion,thetemperaturevalueiscomparedtothetriggervaluesstoredinTHandTLSincetheseregistersarebitonly,bitsareignoredforcomparisonThemostsignificantbitofTHorTLdirectlycorrespondstothesignbitofthebittemperatureregisterIftheresultofatemperaturemeasurementishigherthanTHorlowerthanTL,analarmflaginsidethedeviceissetThisflagisupdatedwitheverytemperaturemeasurementAslongasthealarmflagisset,theDSBwillrespondtothealarmsearchcommandThisallowsmanyDSBstobeconnectedinparalleldoingsimultaneoustemperaturemeasurementsIfsomewherethetemperatureexceedsthelimits,thealarmingdevice(s)canbeidentifiedandreadimmediatelywithouthavingtoreadnonalarmingdevicesDSBofBITLASEREDROMEachDSBcontainsauniqueROMcodethatisbitslongThefirstbitsareaWirefamilycode(DSBcodeish)ThenextbitsareauniqueserialnumberThelastbitsareaCRCofthefirstbits(SeeFigure)ThebitROMandROMFunctionControlsectionallowtheDSBtooperateasaWiredeviceandfollowtheWireprotocoldetailedinthesection“WireBusSystem”ThefunctionsrequiredtocontrolsectionsoftheDSBarenotaccessibleuntiltheROMfunctionprotocolhasbeensatisfiedThisprotocolisdescribedintheROMfunctionprotocolflowchart(Figure)TheWirebusmastermustfirstprovideoneoffiveROMfunctioncommands:)ReadROM,)MatchROM,)SearchROM,)SkipROM,or)AlarmSearchAfteraROMfunctionsequencehasbeensuccessfullyexecuted,thefunctionsspecifictotheDSBareaccessibleandthebusmastermaythenprovideoneofthesixmemoryandcontrolfunctioncommandsCRCGENERATIONTheDSBhasanbitCRCstoredinthemostsignificantbyteofthebitROMThebusmastercancomputeaCRCvaluefromthefirstbitsofthebitROMandcompareittothevaluestoredwithintheDSBtodetermineiftheROMdatahasbeenreceivederrorfreebythebusmasterTheequivalentpolynomialfunctionofthisCRCis:CRC=XXXTheDSBalsogeneratesanbitCRCvalueusingthesamepolynomialfunctionshownaboveandprovidesthisvaluetothebusmastertovalidatethetransferofdatabytesIneachcasewhereaCRCisusedfordatatransfervalidation,thebusmastermustcalculateaCRCvalueusingthepolynomialfunctiongivenaboveandcomparethecalculatedvaluetoeitherthebitCRCvaluestoredinthebitROMportionoftheDSB(forROMreads)orthebitCRCvaluecomputedwithintheDSB(whichisreadasaninthbytewhenthescratchpadisread)ThecomparisonofCRCvaluesanddecisiontocontinuewithanoperationaredeterminedentirelybythebusmasterThereisnocircuitryinsidetheDSBthatpreventsacommandsequencefromproceedingiftheCRCstoredinorcalculatedbytheDSBdoesnotmatchthevaluegeneratedbythebusmasterTheWireCRCcanbegeneratedusingapolynomialgeneratorconsistingofashiftregisterandXORgatesasshowninFigureAdditionalinformationabouttheDallasWireCyclicRedundancyCheckisavailableinApplicationNoteentitled“UnderstandingandUsingCyclicRedundancyCheckswithDallasSemiconductorTouchMemoryProducts”TheshiftregisterbitsareinitializedtoThenstartingwiththeleastsignificantbitofthefamilycode,bitatatimeisshiftedinAftertheeighthbitofthefamilycodehasbeenentered,thentheserialnumberisenteredAfterthethbitoftheserialnumberhasbeenentered,theshiftregistercontainstheCRCvalueShiftinginthebitsofCRCshouldreturntheshiftregistertoallsBITLASEREDROMFigureBITCRCCODEBITSERIALNUMBERBITFAMILYCODE(h)MSBLSBMSBLSBMSBLSBDSBofROMFUNCTIONSFLOWCHARTFigureDSBofWIRECRCCODEFigureMEMORYTheDSB’smemoryisorganizedasshowninFigureThememoryconsistsofascratchpadRAMandanonvolatile,electricallyerasable(E)RAM,whichstoresthehighandlowtemperaturetriggersTHandTL,andtheconfigurationregisterThescratchpadhelpsinsuredataintegritywhencommunicatingovertheWirebusDataisfirstwrittentothescratchpadusingtheWriteScratchpadEhcommandItcanthenbeverifiedbyusingtheReadScratchpadBEhcommandAfterthedatahasbeenverified,aCopyScratchpadhcommandwilltransferthedatatothenonvolatile(E)RAMThisprocessinsuresdataintegritywhenmodifyingmemoryThescratchpadisorganizedaseightbytesofmemoryThefirsttwobytescontaintheLSBandtheMSBofthemeasuredtemperatureinformation,respectivelyThethirdandfourthbytesarevolatilecopiesofTHandTLandarerefreshedwitheverypoweronresetThefifthbyteisavolatilecopyoftheconfigurationregisterandisrefreshedwitheverypoweronresetTheconfigurationregisterwillbeexplainedinmoredetaillaterinthissectionofthedatasheetThesixth,seventh,andeighthbytesareusedforinternalcomputations,andthuswillnotreadoutanypredictablepatternItisimperativethatonewritesTH,TL,andconfiginsuccessionieawriteisnotvalidifonewritesonlytoTHandTL,forexample,andthenissuesaresetIfanyofthesebytesmustbewritten,allthreemustbewrittenbeforearesetisissuedThereisaninthbytewhichmaybereadwithaReadScratchpadBEhcommandThisbytecontainsacyclicredundancycheck(CRC)bytewhichistheCRCoveralloftheeightpreviousbytesThisCRCisimplementedinthefashiondescribedinthesectiontitled“CRCGeneration”ConfigurationRegisterThefifthbyteofthescratchpadmemoryistheconfigurationregisterItcontainsinformationwhichwillbeusedbythedevicetodeterminetheresolutionofthetemperaturetodigitalconversionThebitsareorganizedasshowninFigureDSBCONFIGURATIONREGISTERFigureRRMSbLSbBitsaredon’tcaresonawritebutwillalwaysreadout“”Bitisadon’tcareonawritebutwillalwaysreadout“”(MSB)XORXORXOR(LSB)INPUTDSBofR,R:ThermometerresolutionbitsTablebelowdefinestheresolutionofthedigitalthermometer,basedonthesettingsofthesetwobitsThereisadirecttradeoffbetweenresolutionandconversiontime,asdepictedintheACElectricalCharacteristicsThefactorydefaultoftheseEEPROMbitsisR=andR=(bitconversions)ThermometerResolutionConfigurationTableRRThermometerResolutionMaxConversionTimebitms(tconv)bitms(tconv)bitms(tconv)bitms(tconv)DSBMEMORYMAPFigureTEMPERATURELSBTEMPERATUREMSBTHUSERBYTETLUSERBYTECONFIGRESERVEDRESERVEDCRCTHUSERBYTETLUSERBYTERESERVEDSCRATCHPADBYTEERAMCONFIGDSBofWIREBUSSYSTEMTheWirebusisasystemwhichhasasinglebusmasterandoneormoreslavesTheDSBbehavesasaslaveThediscussionofthisbussystemisbrokendownintothreetopics:hardwareconfiguration,transactionsequence,andWiresignaling(signaltypesandtiming)HARDWARECONFIGURATIONTheWirebushasonlyasinglelinebydefinitionitisimportantthateachdeviceonthebusbeabletodriveitattheappropriatetimeTofacilitatethis,eachdeviceattachedtotheWirebusmusthaveopendrainorstateoutputsTheWireportoftheDSB(DQpin)isopendrainwithaninternalcircuitequivalenttothatshowninFigureAmultidropbusconsistsofaWirebuswithmultipleslavesattachedTheWirebusrequiresapullupresistorofapproximatelykΩHARDWARECONFIGURATIONFigureTheidlestatefortheWirebusishighIfforanyreasonatransactionneedstobesuspended,thebusMUSTbeleftintheidlestateifthetransactionistoresumeInfiniterecoverytimecanoccurbetweenbitssolongastheWirebusisintheinactive(high)stateduringtherecoveryperiodIfthisdoesnotoccurandthebusisleftlowformorethanµs,allcomponentsonthebuswillberesetTRANSACTIONSEQUENCETheprotocolforaccessingtheDSBviatheWireportisasfollows:�Initialization�ROMFunctionCommand�MemoryFunctionCommand�TransactionDataVVKBUSMASTERRXTXDSBWIREPORTµATypRXTXOHMMOSFETRX=RECEIVETX=TRANSMITDSBofINITIALIZATIONAlltransactionsontheWirebusbeginwithaninitializationsequenceTheinitializationsequenceconsistsofaresetpulsetransmittedbythebusmasterfollowedbypresencepulse(s)transmittedbytheslave(s)ThepresencepulseletsthebusmasterknowthattheDSBisonthebusandisreadytooperateFormoredetails,seethe“WireSignaling”sectionROMFUNCTIONCOMMANDSOncethebusmasterhasdetectedapresence,itcanissueoneofthefiveROMfunctioncommandsAllROMfunctioncommandsarebitslongAlistofthesecommandsfollows(refertoflowchartinFigure):ReadROMhThiscommandallowsthe

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/26

DS18B20(温度传感器)

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利