DS18B20中英文手册12pWord文档下载推荐.docx

上传人:b****1 文档编号:3858441 上传时间:2023-05-02 格式:DOCX 页数:11 大小:255.57KB
下载 相关 举报
DS18B20中英文手册12pWord文档下载推荐.docx_第1页
第1页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第2页
第2页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第3页
第3页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第4页
第4页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第5页
第5页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第6页
第6页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第7页
第7页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第8页
第8页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第9页
第9页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第10页
第10页 / 共11页
DS18B20中英文手册12pWord文档下载推荐.docx_第11页
第11页 / 共11页
亲,该文档总共11页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

DS18B20中英文手册12pWord文档下载推荐.docx

《DS18B20中英文手册12pWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《DS18B20中英文手册12pWord文档下载推荐.docx(11页珍藏版)》请在冰点文库上搜索。

DS18B20中英文手册12pWord文档下载推荐.docx

Figure1showsablockdiagramoftheDS18B20,andpindescriptionsaregiveninTable1.The64-bitROMstoresthedevice’suniqueserialcode.Thescratchpadmemorycontainsthe2-bytetemperatureregisterthatstoresthedigitaloutputfromthetemperaturesensor.Inaddition,thescratchpadprovidesaccesstothe1-byteupperandloweralarmtriggerregisters(THandTL),andthe1-byteconfigurationregister.Theconfigurationregisterallowstheusertosettheresolutionofthetemperature-to-digitalconversionto9,10,11,or12bits.TheTH,TLandconfigurationregistersarenonvolatile(EEPROM),sotheywillretaindatawhenthedeviceispowereddown.

TheDS18B20usesDallas’exclusive1-wirebusprotocolthatimplementsbuscommunicationusingonecontrolsignal.Thecontrollinerequiresaweakpullupresistorsincealldevicesarelinkedtothebusviaa3-stateoropen-drainport(theDQpininthecaseoftheDS18B20).Inthisbussystem,themicroprocessor(themasterdevice)identifiesandaddressesdevicesonthebususingeachdevice’sunique

64-bitcode.Becauseeachdevicehasauniquecode,thenumberofdevicesthatcanbeaddressedononebusisvirtuallyunlimited.The1-wirebusprotocol,includingdetailedexplanationsofthecommandsand

“timeslots,”iscoveredinthe1-WIREBUSSYSTEMsectionofthisdatasheet.

AnotherfeatureoftheDS18B20istheabilitytooperatewithoutanexternalpowersupply.Powerisinsteadsuppliedthroughthe1-wirepullupresistorviatheDQpinwhenthebusishigh.Thehighbussignalalsochargesaninternalcapacitor(CPP),whichthensuppliespowertothedevicewhenthebusislow.Thismethodofderivingpowerfromthe1-wirebusisreferredtoas“parasitepower.”Asanalternative,theDS18B20mayalsobepoweredbyanexternalsupplyonVDD.

DS18B20BLOCKDIAGRAMFigure1

PINASSIGNMENT

PINDESCRIPTION

GND-Ground

DQ-DataIn/OutAlsoprovidespowertothedevicewhenusedinparasitepowermode(see“ParasitePower”section.)

VDD-PowerSupplyVoltage

NC-NoConnect

1-WIRESIGNALING

TheDS18B20usesastrict1-wirecommunicationprotocoltoinsuredataintegrity.Severalsignaltypesaredefinedbythisprotocol:

resetpulse,presencepulse,write0,write1,read0,andread1.Allofthesesignals,withtheexceptionofthepresencepulse,areinitiatedbythebusmaster.

INITIALIZATIONPROCEDURE:

RESETANDPRESENCEPULSES

AllcommunicationwiththeDS18B20beginswithaninitializationsequencethatconsistsofaresetpulsefromthemasterfollowedbyapresencepulsefromtheDS18B20.ThisisillustratedinFigure13.WhentheDS18B20sendsthepresencepulseinresponsetothereset,itisindicatingtothemasterthatitisonthebusandreadytooperate.Duringtheinitializationsequencethebusmastertransmits(TX)theresetpulsebypullingthe1-wirebuslowforaminimumof480µ

s.Thebusmasterthenreleasesthebusandgoesintoreceivemode(RX).Whenthebusisreleased,the5kpullupresistorpullsthe1-wirebushigh.WhentheDS18B20detectsthisrisingedge,itwaits15–60µ

sandthentransmitsapresencepulsebypullingthe1-wirebuslowfor60–240µ

s.

INITIALIZATIONTIMINGFigure13

READ/WRITETIMESLOTS

ThebusmasterwritesdatatotheDS18B20duringwritetimeslotsandreadsdatafromtheDS18B20duringreadtimeslots.Onebitofdataistransmittedoverthe1-wirebuspertimeslot.

WRITETIMESLOTS

Therearetwotypesofwritetimeslots:

“Write1”timeslotsand“Write0”timeslots.ThebusmasterusesaWrite1timeslottowritealogic1totheDS18B20andaWrite0timeslottowritealogic0totheDS18B20.Allwritetimeslotsmustbeaminimumof60µ

sindurationwithaminimumofa1µ

srecoverytimebetweenindividualwriteslots.Bothtypesofwritetimeslotsareinitiatedbythemasterpullingthe1-wirebuslow(seeFigure14).

TogenerateaWrite1timeslot,afterpullingthe1-wirebuslow,thebusmastermustreleasethe1-wirebuswithin15µ

s.Whenthebusisreleased,the5kpullupresistorwillpullthebushigh.TogenerateaWrite0timeslot,afterpullingthe1-wirebuslow,thebusmastermustcontinuetoholdthebuslowforthedurationofthetimeslot(atleast60µ

s).TheDS18B20samplesthe1-wirebusduringawindowthatlastsfrom15µ

sto60µ

safterthemasterinitiatesthewritetimeslot.Ifthebusishighduringthesamplingwindow,a1iswrittentotheDS18B20.Ifthelineislow,a0iswrittentotheDS18B20.

READ/WRITETIMESLOTTIMINGDIAGRAMFigure14

READTIMESLOTS

TheDS18B20canonlytransmitdatatothemasterwhenthemasterissuesreadtimeslots.Therefore,themastermustgeneratereadtimeslotsimmediatelyafterissuingaReadScratchpad[BEh]orReadPowerSupply[B4h]command,sothattheDS18B20canprovidetherequesteddata.Inaddition,themastercangeneratereadtimeslotsafterissuingConvertT[44h]orRecallE2[B8h]commandstofindoutthestatusoftheoperationasexplainedintheDS18B20FUNCTIONCOMMANDsection.Allreadtimeslotsmustbeaminimumof60µ

srecoverytimebetweenslots.Areadtimeslotisinitiatedbythemasterdevicepullingthe1-wirebuslowforaminimumof1µ

sandthenreleasingthebus(seeFigure14).Afterthemasterinitiatesthereadtimeslot,theDS18B20willbegintransmittinga1or0onbus.TheDS18B20transmitsa1byleavingthebushighandtransmitsa0bypullingthebuslow.Whentransmittinga0,theDS18B20willreleasethebusbytheendofthetimeslot,andthebuswillbepulledbacktoitshighidlestatebythepullupresister.OutputdatafromtheDS18B20isvalidfor15µ

safterthefallingedgethatinitiatedthereadtimeslot.Therefore,themastermustreleasethebusandthensamplethebusstatewithin15µ

sfromthestartoftheslot.Figure15illustratesthatthesumofTINIT,TRC,andTSAMPLEmustbelessthan15µ

sforareadtimeslot.Figure16showsthatsystemtimingmarginismaximizedbykeepingTINITandTRCasshortaspossibleandbylocatingthemastersampletimeduringreadtimeslotstowardstheendofthe15µ

speriod.

DETAILEDMASTERREAD1TIMINGFigure15

RECOMMENDEDMASTERREAD1TIMINGFigure16

DS18B20可编程分辨率的单总线数字温度计

说明

DS18B20数字温度计提供9-12位摄氏温度测量而且有一个由高低电平触发的可编程的不因电源消失而改变的报警功能。

DS18B20通过一个单线接口发送或接受信息,因此在中央处理器和DS18B20之间仅需一条连接线(加上地线)。

它的测温范围为-55~+125℃,并且在-10~+85℃精度为±

5℃。

除此之外,DS18B20能直接从单线通讯线上汲取能量,除去了对外部电源的需求。

每个DS18B20都有一个独特的64位序列号,从而允许多只DS18B20同时连在一根单线总线上;

因此,很简单就可以用一个微控制器去控制很多覆盖在一大片区域的DS18B20。

这一特性在HVAC环境控制、探测建筑物、仪器或机器的温度以及过程监测和控制等方面非常有用。

概览

图1是表示DS18B20的方框图,表1已经给出了引脚说明。

64位只读存储器储存器件的唯一片序列号。

高速暂存器含有两个字节的温度寄存器,这两个寄存器用来存储温度传感器输出的数据。

除此之外,高速暂存器提供一个直接的温度报警值寄存器(TH和TL),和一个字节的的配置寄存器。

配置寄存器允许用户将温度的精度设定为9,10,11或12位。

TH,TL和配置寄存器是非易失性的可擦除程序寄存器(EEPROM),所以存储的数据在器件掉电时不会消失。

DS18B20通过达拉斯公司独有的单总线协议依靠一个单线端口通讯。

当全部器件经由一个3态端口或者漏极开路端口(DQ引脚在DS18B20上的情况下)与总线连接的时候,控制线需要连接一个弱上拉电阻。

在这个总线系统中,微控制器(主器件)依靠每个器件独有的64位片序列号辨认总线上的器件和记录总线上的器件地址。

由于每个装置有一个独特的片序列码,总线可以连接的器件数目事实上是无限的。

单总线协议,包括指令的详细解释和“时序”单总线系统。

DS18B20的另一个功能是可以在没有外部电源供电的情况下工作。

当总线处于高电平状态,DQ与上拉电阻连接通过单总线对器件供电。

同时处于高电平状态的总线信号对内部电容(Cpp)充电,在总线处于低电平状态时,该电容提供能量给器件。

这种提供能量的形式被称为“寄生电源”。

作为替代选择,DS18B20同样可以通过VDD引脚连接外部电源供电。

DS18B20方框图图1

引脚排列

引脚说明

GND-地

DQ-数据I/O对于单线操作:

漏极开路。

当工作在寄生电源模式时

用来提供电源(建“寄生电源”节)。

VDD-可选电源电压

NC-无连接

单总线信号

DS18B20需要严格的单总线协议以确保数据的完整性。

协议包括集中单总线信号类型:

复位脉冲、存在脉冲、写0、写1、读0和读1。

所有这些信号,除存在脉冲外,都是由总线控制器发出的。

复位序列:

复位和存在脉冲

和DS18B20间的任何通讯都需要以初始化序列开始,初始化序列见图13。

一个

复位脉冲跟着一个存在脉冲表明DS18B20已经准备好发送和接收数据。

在初始化序列期间,总线控制器拉低总线并保持480us以发出(TX)一个复位脉冲,然后释放总线,进入接收状态(RX)。

单总线由5K上拉电阻拉到高电平。

当DS18B20探测到I/O引脚上的上升沿后,等待15-60us,然后发出一个由60-240us低电平信号构成的存在脉冲。

初始化时序图13

读/写时序

DS18B20的数据读写是通过时序处理位来确认信息交换的。

写时序

由两种写时序:

写1时序和写0时序。

总线控制器通过写1时序写逻辑1到DS18B20,写0时序写逻辑0到DS18B20。

所有写时序必须最少持续60us,包括两个写周期之间至少1us的恢复时间。

当总线控制器把数据线从逻辑高电平拉到低电平的时候,写时序开始(见图14)。

总线控制器要生产一个写时序,必须把数据线拉到低电平然后释放,在写时序开始后的15us释放总线。

当总线被释放的时候,5K的上拉电阻将拉高总线。

总控制器要生成一个写0时序,必须把数据线拉到低电平并持续保持(至少60us)。

总线控制器初始化写时序后,DS18B20在一个15us到60us的窗口内对I/O线采

样。

如果线上是高电平,就是写1。

如果线上是低电平,就是写0。

读时序

总线控制器发起读时序时,DS18B20仅被用来传输数据给控制器。

因此,总线控制器在发出读暂存器指令[BEh]或读电源模式指令[B4H]后必须立刻开始读时序,DS18B20可以提供请求信息。

除此之外,总线控制器在发出发送温度转换指令[44h]或召回EEPROM指令[B8h]之后读时序,详见DS18B20功能指令节。

所有读时序必须最少60us,包括两个读周期间至少1us的恢复时间。

当总线控制器把数据线从高电平拉到低电平时,读时序开始,数据线必须至少保持1us,然后总线被释放(见图14)。

在总线控制器发出读时序后,DS18B20通过拉高或拉低总线上来传输1或0。

当传输逻辑0结束后,总线将被释放,通过上拉电阻回到上升沿状态。

从DS18B20输出的数据在读时序的下降沿出现后15us内有效。

因此,总线控制器在读时序开始后必须停止把I/O脚驱动为低电平15us,以读取I/O脚状态。

图15标识TINIT,TRC和TSAMPLE之和必须小于15us。

图16指出,系统时间可以用下面办法达到最大:

TINIT和TRC保持时间尽可能校;

把控制器采样时间放控制器读1的详细时序图15

推荐控制器读1时序图16

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2