【正文】
it is important that each device on the bus be able to drive it at the appropriate time. To facilitate this, each device attached to the 1–Wire bus must have open drain or 3–state outputs.The 1–Wire port of the DS1820 (I/Opin) is open drain with an internal circuit equivalent to that shown in Figure 9. A multidrop bus consists of a 1–Wire bus with multiple slaves attached. The 1–Wire bus requires a pullup resistor of approximately 5KW.The idle state for the 1–Wire bus is high. If for any reason a transaction needs to be suspended, the bus MUST be left in the idle state if the transaction is to resume. Infinite recovery time can occur between bits so long as the 1–Wire bus is in the inactive (high) state during the recovery period. If this does not occur and the bus is left low for more than 480 ms, all ponents on the bus will be reset. TRANSACTION SEQUENCEThe protocol for accessing the DS1820 via the 1–Wire port is as follows:? Initialization? ROM Function Command? Memory Function Command? Transaction/DataINITIALIZATIONAll transactions on the 1–Wire bus begin with an initialization sequence. The initialization sequence consists of a reset pulse transmitted by the bus master followed by presence 。C LSB, yielding the following 9–bit format:The most significant (sign) bit is duplicated into all of the bits in the upper MSB of the two–byte temperature register in memory. This “sign–extension” yields the 16–bit temperature readings as shown in Table 1. Higher resolutions may be obtained by the following procedure. First, read the temperature, and truncate the 176。C in 176。C resolution. The temperature reading is provided in a 16–bit, sign–extended two’s plement reading. Table 1 describes the exact relationship of output data to measured temperature. The data is transmitted serially over the 1–Wire interface. The DS1820 can measure temperature over the range of –55176。C value, is incremented, indicating that the temperature is higher than –55176。 it will send back a “1” if it is powered from the VDD pin. If the master receives a “0”, it knows that it must supply the strong pull–up on the I/O line during temperature conversions. See “Memory Command Functions” section for more detail on this mand protocol.OPERATION – MEASURING TEMPERATUREThe DS1820 measures temperature through the use of an on–board proprietary temperature measurement technique. A block diagram of the temperature measurement circuitry is shown in Figure 4. The DS1820 measures temperature by counting the number of clock cycles that an oscillator with a low temperature coefficient goes through during a gate period determined by a high temperature coefficient oscillator. The counter is preset with a base count that corresponds to –55176。F increments? Temperature is read as a 9–bit digital value.? Converts temperature to digital word in 200 ms (typ.)? User–definable, nonvolatile temperature alarm settings? Alarm search mand identifies and addressesdevices whose temperature is outside of programmedlimits (temperature alarm condition)? Applications include thermostatic controls, industrialsystems, consumer products, thermometers, or anythermally sensitive systemDESCRIPTIONThe DS1820 Digital Thermometer provides 9–bit temperature readings which indicate the temperature of the device. Information is sent to/from the DS1820 over a 1–Wire interface, so that only one wire (and ground) needs to be connected from a central microprocessor to a DS1820. Power for reading, writing, and performing temperature conversions can be derived from the data line itself with no need for an external power source. Because each DS1820 contains a unique silicon serial number, multiple DS1820s can exist on the same 1–Wire bus. This allows for placing temperature sensors in many different where this feature is useful include HVAC environmental controls, sensing temperatures inside buildings, equipment or machinery, and in process monitoring and control.DETAILED PIN DESCRIPTIONOVERVIEWThe block diagram of Figure 1 shows the major ponentsof the DS1820. The DS1820 has three main data ponents: 1) 64–bit lasered ROM, 2) temperature and sensor, 3) nonvolatile temperature alarm triggers TH and TL. The device derives its power from the 1–Wire munication line by storing energy on an internal capacitor during periods of time when the signal line is high and continues to operate off this power source during the low times of the 1–Wire line until it returns high to replenish the parasite (capacitor) supply. As an alternative, the DS1820 may also be powered from an external 5 volts supply. Communication to the DS1820 is via a 1–Wire port. With the 1–Wire port, the memory and control functions will not be available before the ROM function protocol has been established. The master must first provide one of five ROM function mands: 1) Read ROM, 2) Match ROM, 3) Search ROM, 4) Skip ROM, or 5) Alarm Search. These mands operate on the 64–bit lasered ROM portion of each device and can single out a specific device if many are present on the 1–Wire line as well as indicate to the Bus Master how many and what types of devices are present. After a ROM function sequence has been successfully executed, the memory and control functions are accessible and the mastermay then provide any one of the six memory and control function mands. One control function mand instructs the DS1820 to perform a temperature measurement. The result of this measurement will be placed in the DS1820’s scratchpad memory, and may be read by issuing a memory function mand which reads the contents of the scratchpad memory. The temperature alarm triggers TH and TL consist of one byte EEPROM each. If the alarm search mand is not applied to the DS1820, these registers may be used as general purpose user memory. Writing TH and TL is done using a memory function mand. Read access to these registers is through the scratchpad. All data is read and written least s