温度传感器DS18B20_外文翻译
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
DS18B20Programmable Resolution1-Wire
Digital Thermometer
1、DS18B20FEATURES
(1)Unique1-Wire interface requires only one Port pin for communication,requires no external components
(2)Each device has a unique64-bit serial code stored in an onboard ROM
(3)Can be powered form data line.Power supply range is3.0Vto5.5V
(4)Measures temperatures form-55℃to+125℃,±0.5℃accuracy from-10℃to +85℃
(5)Thermometer resolution is user-selected from9to12bits
(6)Converts temperature to12-bit digital word in750ms(max)
(7)Alarm search command identifies and addresses devices whose temperature is outside of programmed limits(temperature alarm condition)
(8)Available in8-pin SOIC,and3-bin TO-92packages
2、DS18B20BLOCK DIAFRAM
Figure1shows a block diagram of the DS18B20,The64-bite ROM stores the device’s serial code.The scratchpad memory contains the2-byte temperature egister that stores the digital output from the temperature sensor.In addition,the scratchpad provides access to the1-byte upper and lower alarm trigger register(TH and TL),and the1-byte configuratuion register.The configuration register allows the user to set the resolution of the temperature-to-digital conversion to9,10,11or12bits.The TH,TL and configuration registers are nonvolatile(EEPROM),so they will retain data when the device is powered down.
Figure1block diagram of the DS18B20
3、DS18B20ROM COMMANDS
(1)SEARCH ROM[0F0H]
When a system is initially powered up,the master must identify the ROM codes of all slave devices on the bus,which allows the master to determine the number of slaves and their device types.The master learns the ROM codes through a process of elimination that requires the master to perform a Search ROM cycle as many times as necessary to identify all of the slave’s64-bit ROM devices.
(2)READ ROM[55H]
This command can only be used when there is one slave on the bus.It allows the bus master to read the slave`64-bit ROM code without using the Search ROM procedure.If this command is used when there is more than one slave present on the bus,a data collision will occur when all the slaves attempt to respond at the same time.
(3)MATCH ROM[55H]
The match ROM command followed by a64-bit ROM code sequence allows the bus master to address a specific DS18B20on a multidrop or single-drop bus.Only the DS18B20that exactly matches the64-bitROM code sequence will respond to the
function command issued by the master;all other slaves on the bus will wait for a reset pulse.
(4)SKIP ROM[0CCH]
The master can use this command to address all devices on the bus simultaneously without sending out any ROM code information.Note that the Read Scratchpad command can follow the Skip ROM command only if there is a single slave device on the bus.In this case time is saved by allowing the master to read from the slave without sending the device’s64-bit ROM code.A Skip ROM command followed by a Read Scratchpad command will cause a data collision on the bus if there is more than one slave since multiple devices will attempt to transmit data simultaneously.
(5)ALARM SEARCH[0ECH]
The operation of this command is identical to the operation of the Search ROM command except that only slaves with a set alarm flag will respond.This command allows the master device to determine if any DS18B20s experienced an alarm condition during the most recent temperature conversion.Refer to the OPERATION-ALARM SIGNAING section for an explanation of alarm flag operation.
(6)CONVERTT[44H]
This command initiates a single temperature conversion.Following the conversion,the resulting thermal data is stored in the2-bute temperature register in the scratchpad memory and the DS18B20returns to its low-power idle state.If the device is being used in parasite power mode,within10us after this command is issued the master must enable a strong pullup on the1-Wire bus for the duration of the conversion as described in the POWERING THE DS18320section.If the DS18B20 is powered by an external supply,the master can issue read time slots after the Convert T command and the DS18B20will respond by transmitting a0while the temperature conversion is in Progress and a1when the conversion is done.In parasite power mode this notification technique cannot be used since the bus1is pulled high by the strong pullup during the conversion.
(7)WRITE SCRACHPAD[4EH]
This command allows the master to write3bytes of the data to the DS18B20’s scratchpad.The first data byte is writer into the TH register,the second byte is written into the TL register,and the third byte is written into the configuration register. Data must be transmitted least significant bit first.All three bytes must be written before the master issues a reset,or the data may be corrupted.
(8)READ SCRACHPAD[0BEH]
This command allows the master to read the contents of the scratchpad.The data transfer starts with the least significant bit of byte0and continues through the scratchpad until9byte(byte8-CRC)is read.The master may issue a reset to terminate reading at any time if only partof the scratchpad data is needed.
(9)COPY SCRATCHPAD[48H]
This command copies the contents of the scratchpad TH,TL and configuration registers to EEPROM.If the device is being used in parasite power mode,within 10us(max)after this command is issued the master must enable a strong pullup on the 1-Wire bus for at least10ms as described in the POWERING THE DS18B20section.
(10)RECALL E2[B8H]
This command recalls the alarm trigger values(TH and TL)and configuration data from EEPROM,respectively,in the scratchpad memory.The master device can issue read time slots following the Recall E2command and the DS18B20will indicate the status of the recall by transmitting0while the recall is in progress and1 when the recall is done.The recall operation happens automatically at power-up,so valid data is available in the scratchpad as soon as power is applied to the device.
DS18B20单总线数字温度计
1、DS18B20的特性
(1)独特的单总线接口只占用一个I/O端口,而无需外围元件;
(2)可以由总线提供电源,电压适用范围为3.0V~5.5V;
(3)测量温度范围为-55℃~+125℃,在-10℃~+85℃范围内精度为±0.5℃;(4)每个DS18B20含有一个唯一的64位ROM编码;
(5)用户可以通过编程实现9~12位的温度分辨率;
(6)分辨率为12时最大转换时间为750ms;
(7)报警搜索命令可识别哪片DS18B20温度超限;
(8)采用3脚T0-92或8脚SOIC封装。
2、DS18B20的内部结构
DS18B20的内部结构如图1所示。
主要包括:寄生电源、温度传感器、64位激光ROM和单总线接口、存放中间数据的高速暂存器RAM、用于存储用户设定温度上下限值的TM和TL触发器、存储和控制逻辑、8位循环冗余校验码发生器等。
温度转换位数的改变是通过改变寄存器的值来实现的,用户可以根据需要将DS18B20的温度转化位数设置为9,10,11,12位。
温度报警触发器的设置寄存器都由非易失性电可擦写存储器(EEROM)组成,设置值可以通过相应命令写入,一旦写入后不会因为掉电而丢失。
图1DS18B20的结构框图
3、DS18B20的各个ROM命令
(1)Search ROM[0F0H]
当一个系统初次启动时,总线控制器可能并不知道单线总线上有多少器件或它们的64位ROM编码。
搜索ROM命令允许总线控制器用排除法识别总线上的所有从机的64位编码。
(2)Read ROM[33H]
这个命令允许总线控制器读到DS18B20的8位系列编码、唯一的序列号和8位CRC码。
只有在总线上存在单只DS18B20的时候才能使用这个命令。
如果总线上有不止一个从机,当所有从机试图同时传送信号时就会发生数据冲突。
(3)Match ROM[55H]
这个是匹配ROM命令,后跟64位ROM序列,让总线控制器在多点总线上定位一只特定的DS18B20。
只有和64位ROM序列完全匹配的DS18B20才能响应随后的存储器操作。
所有和64位ROM序列不匹配的从机都将等待复位脉冲。
这条命令在总线上有单个或多个器件时都可以使用。
(4)Skip ROM[0CCH]
这条命令允许总线控制器不用提供64位ROM编码就使用存储器操作命令,在单点总线情况下,可以节约时间。
如果总线上不止一个从机,在Skip ROM 命令之后跟着发一条读命令,由于多个从机同时发送信号。
总线上就会发生数据冲突。
(5)Alarm Search[0ECH]
这条命令的流程和Search ROM相同。
然而,只有在最近一次测温后遇到符合报警条件的情况,DS18B20才会响应这条命令。
报警条件定义为温度高于TH 或温度低于TL。
只要DS18B20不掉电,报警状态将一直保持,直到再一次测得的温度值达不到报警条件。
(6)Convert T[44H]
这条命令启动一次温度转换无需其它数据。
温度转换命令被执行,而后DS18B20保持等待状态。
如果总线控制器在这条命令之后跟着发出时间隙,而DS18B20又忙于做时间转换的话,DS18B20将在总线上输出0,若温度转换完成,则输出1。
如果使用寄生电源,总线控制器必须在发出这条命令后立即启动强
上拉,并保持500ms以上的时间。
(7)Write Scratchpad[4EH]
这条命令向DS18B20的暂存器TH和TL中写入数据。
可以在任何时候发出复位命令来中止写入。
(8)Read Scratchpad[0BEH]
这个命令读暂存器的内容。
读取从第1个字节开始,一直进行下去,直到9(CRC)字节读完。
如果不想读完所有字节,控制器可以在任何时候发出复位命令来中止读取。
(9)Copy Scratchpad[48H]
这个命令把暂存器的内容拷贝到DS18B20的EEPROM存储器里,即把温度报警触发字节存入非易失性存储器里。
如果总线控制器在这条命令之后跟着发出读时间隙,而DS18B20又忙于把存储器拷贝到EEROM存储器,DS18B20就会输出一个0,如果拷贝结束的话,DS18B20则输出1。
如果使用寄生电源,总线控制器必须在这条命令发出后立即启动强上拉并最少保持10ms。
(10)Recall E2[0B8H]
这条命令把报警触发器里的值拷贝回暂存器。
这种拷贝操作在DS18B20上电时自动执行,这样器件一上电暂存器里马上就存在有效数据了。
若在这条命令之后发出数据隙,器件会输出温度转换忙的标识:0为忙,1为完成。