【正文】
ition requires only one data line (and ground) for munication with a central microprocessor. It has an operating temperature range of –55176。C to +125176。C and is accurate to 177。176。C over the range of –10176。C to +85176。C. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.Each DS18B20 has a unique 64bit serial code, which allows multiple DS18B20s to function on the same 1–wire bus。 thus, it is simple to use one microprocessor to control many DS18B20s distributed over a large area. Applications that can benefit from this feature include HVAC environmental controls,temperature monitoring systems inside buildings, equipment or machinery, and process monitoring and control systems.DETAILED PIN DESCRIPTIONS Table 18PIN SOIC*TO92SYMBOLDESCRIPTION51GNDGround.42DQData Input/Output pin. Opendrain 1wire interface pin. Also provides power to the device when used in parasite power mode(see “Parasite Power” section.)33VDDOptional VDD pin. VDD must be grounded for operation in parasite power mode.*All pins not specified in this table are “No Connect” pins.OVERVIEW Figure 1 shows a block diagram of the DS18B20, and pin descriptions are given in Table 1. The 64bit ROM stores the device’s unique serial code. The scratchpad memory contains the 2byte temperature register that stores the digital output from the temperature sensor. In addition, the scratchpad provides access to the 1byte upper and lower alarm trigger registers (TH and TL), and the 1byte configuration register. The configuration register allows the user to set the resolution of the temperaturetodigital conversion to 9, 10, 11, or 12 bits. The TH, TL and configuration registers are nonvolatile (EEPROM), so they will retain data when the device is powered down.The DS18B20 uses Dallas’ exclusive 1wire bus protocol that implements bus munication using one control signal. The control line requires a weak pull up resistor since all devices are linked to the bus via a 3state or opendrain port (the DQ pin in the case of the DS18B20). In this bus system, the microprocessor (the master device) identifies and addresses devices on the bus using each device’s unique 64bit code. Because each device has a unique code, the number of devices that can be addressed on one bus is virtually unlimited. The 1wire bus protocol, including detailed explanations of the mands and “time slots,” is covered in the 1WIRE BUS SYSTEM section of this data sheet.Another feature of the DS18B20 is the ability to operate without an external power supply. Power is instead supplied through the 1wire pull up resistor via the DQ pin when the bus is high. The high bus signal also charges an internal capacitor (CPP), which then supplies power to the device when the bus is low. This method of deriving power from the 1wire bus is referred to as “parasite power.” As an alternative, the DS18B20 may also be powered by an external supply on VDD.DS18B20 BLOCK DIAGRAMFigure 1OPERATION–MEASURING TEMPERATURE The core functionality of the DS18B20 is its directtodigital temperature sensor. The resolution of the temperature sensor is userconfigurable to 9, 10, 11, or 12 bits, corresponding to increments of , , and , respectively. The default resolution at powerup is 12 DS18B20 powersup in a lowpower idle state。 to initiate a temperature measurement and AtoD conversion, the master must issue a Convert T [44h] mand. Following the conversion, the resulting thermal data is stored in the 2byte temperature register in the scratchpad memory and the DS18B20 returns to its idle state. If the DS18B20 is powered by an external supply, the master can issue “read time slots” (see the 1WIRE BUS SYSTEM section) after the Convert T mand and the DS18B20 will respond by transmitting 0 while the temperature conversion is in progress and 1 when the conversion is done. If the DS18B20 is powered with parasite power, this notification technique cannot be used since the bus must be pulled high by a strong pullup during the entire temperature conversion. The bus requirements for parasite power are explained in detail in the POWERING THE DS18B20 section of this datasheet. The DS18B20 output temperature data is calibrated in degrees centigrade。 for Fahrenheit applications, a lookup table or conversion routine must be used. The temperature data is stored as a 16bit signextended two’s plement number in the temperature register (see Figure 2). The sign bits (S) indicate if the temperature is positive or negative: for positive numbers S = 0 and for negative numbers S = 1. If the DS18B20 is configured for 12bit resolution, all bits in the temperature register will contain valid 11bit resolution, bit 0 is undefined. For 10bit resolution, bits 1 and 0 are undefined, and for 9bit resolution bits 2, 1 and 0 are undefined. Table 2 gives examples of digital output data and the corresponding temperature reading for 12bit resolution conversions.TEMPERATURE REGISTER FORMAT Figure 2EMPERATURE/DATA RELATIONSHIP TEMPERATUREDIGITAL OUTPUT(Binary)DIGITAL OUTPUT(Hex)+125176。C0000 0111 1101 000007D0h+85176。C*0000 0101 0101 00000550h+176。C0000 0001 1001 00010191h+176。C0000 0000 1010 001000A2h+176。C0000 0000 0000 10000008h0176。C0000 0000 0000 00000000h176。C1111 1111 1111 1000FFF8h176。C1111 1111 0101 1110FF5Eh176。C1111 1110 0110 1111FE6Fh55176。C1111 1100 1001 0000FC90hTable 2*The poweron reset value of the temperature register is +85176。COPERATION – ALARM SIGNALING After the DS18B20 performs a temperature conversion, the temperature value is pared to the userdefined two’s plement alarm trigger values stored in the 1byte TH and TL registers (see Figure 3).The sign bit (S) indicates if the value is positive or negative: for positive numbers S = 0 and for negative numbers S = 1. The TH and TL registers