1、英文参考资料 The DS18B20 Digital Thermometer provides 9 to 12bit centigrade temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for commu
2、nication with a central microprocessor. It has an operating temperature range of 55C to +125C and is accurate to 0.5 C over the range of 10C to +85C. In addition, the DS18B20 can derive power directly from the data line (parasite power), eliminating the need for an external power supply. Each DS18B2
3、0 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same 1wire 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 m
4、onitoring systems inside buildings, equipment or machinery, and process monitoring and control systems. OVERVIEW The 64-bit ROM stores the devices unique serial code. The scratchpad memory contains the 2-byte temperature register that stores the digital output from the temperature sensor. In additio
5、n, the scratchpad provides access to the 1-byte upper and lower alarm trigger registers (T and T ), and the 1-byte configuration H L register. The configuration register allows the user to set the resolution of the temperature-to-digital conversion to 9, 10, 11, or 12 bits. The T, T and configuratio
6、n registers are nonvolatile (EEPROM), so H L they will retain data when the device is powered down. The DS18B20 uses Dallas exclusive 1-Wire bus protocol that implements bus communication using one control signal. The control line requires a weak pull up resistor since all devices are linked to the
7、bus via a 3-state or open-drain 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 devices unique 64-bit code. Because each device has a unique code, the number of devices that can be address
8、ed on one bus is virtually unlimited Another feature of the DS18B20 is the ability to operate without an external power supply. Power is instead supplied through the 1-Wire pull up resistor via the DQ pin when the bus is high. The high bus signal also charges an internal capacitor (C ), which then s
9、upplies power to the device when the bus is PP low. This method of deriving power from the 1-Wire bus is referred to as parasite power. As an alternative, the DS18B20 may also be powered by an external supply on VDD OPERATION MEASURING TEMPERATURE The core functionality of the DS18B20 is its direct-
10、to-digital temperature sensor. The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5 C, 0.25 C, 0.125 C, and 0.0625 C, respectively. The default resolution at power-up is 12-bit. The DS18B20 powers-up in a low-power idle state; to
11、initiate a temperature measurement and A-to-D conversion, the master must issue a Convert T 44h command. Following the conversion, the resulting thermal data is stored in the 2-byte temperature register in the scratchpad memory and the DS18B20 returns to its idle state. If the DS18B20 is powered by
12、an external supply, the master can issue read time slots (see the 1-WIRE BUS SYSTEM section) after the Convert T command 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, th
13、is notification technique cannot be used since the bus must be pulled high by a strong pull up during the entire temperature conversion. The DS18B20 output temperature data is calibrated in degrees centigrade; for Fahrenheit applications, a lookup table or conversion routine must be used. The temper
14、ature data is stored as a 16-bit sign-extended twos complement 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 12-bit resolution, all
15、bits in the temperature register will contain valid data. For 11-bit resolution, bit 0 is undefined. For 10-bit resolution, bits 1 and 0 are undefined, and for 9-bit resolution bits 2, 1 and 0 are undefined. POWERING THE DS18B20 The DS18B20 can be powered by an external supply on the VDD pin, or it
16、can operate in parasite power mode, which allows the DS18B20 to function without a local external supply. Parasite power is very useful for applications that require remote temperature sensing or that are very space constrained. DS18B20s parasite-power control circuitry, which steals power from the
17、1-Wire bus via the DQ pin when the bus is high. The stolen charge powers the DS18B20 while the bus is high, and some of the charge is stored on the parasite power capacitor (C ) to provide power when the bus is low. When the DS18B20 is used in parasite power mode, the VDD pin must be connected to gr
18、ound. In parasite power mode, the 1-Wire bus and CPP can provide sufficient current to the DS18B20 for most operations as long as the specified timing and voltage requirements are met. However, when the DS18B20 is performing temperature conversions or copying data from the scratchpad memory to EEPRO
19、M, the operating current can be as high as 1.5mA. This current can cause an unacceptable voltage drop across the weak 1-Wire pull up resistor and is more current than can be supplied by CPP. To assure that the DS18B20 has sufficient supply current, it is necessary to provide a strong pull up on the 1-Wire bus whenever temperature conversions are taking place or data is being copied from the scratchpad to EEPROM.