【正文】
he 8bit CRC value puted within the DS18B20(which is read as a ninth byte when the scratchpad is read). The parison of CRC values and decision to continue with an operation are determined entirely by the bus master. There is no circuitry inside the DS18B20 that prevents a mand sequence from proceeding if the CRC stored in or calculated by the DS18B20 does not match the value generated by the bus master.The 1Wire CRC can be generated using a polynomial generator consisting of a shift register and XOR gates as shown in Figure 6. Additional information about the Dallas 1Wire Cyclic Redundancy Check is available in Application Note 27 entitled “Understanding and Using Cyclic Redundancy Checks with Dallas Semiconductor Touch Memory Products.”The shift register bits are initialized to 0. Then starting with the least significant bit of the family code, 1 bit at a time is shifted in. After the 8th bit of the family code has been entered, then the serial number is entered. After the 48th bit of the serial number has been entered, the shift register contains the CRC value. Shifting in the 8 bits of CRC should return the shift register to all 0s.7 MEMORYThe DS18B20’s memory is organized as shown in Figure 8. The memory consists of a scratchpad RAM and a nonvolatile, electrically erasable RAM, which stores the high and low temperature triggers TH and TL, and the configuration register. The scratchpad helps insure data integrity when municating over the 1Wire bus. Data is first written to the scratchpad using the Write Scratchpad mand. It can then be verified by using the Read Scratchpad mand. After the data has been verified, a Copy Scratchpad mand will transfer the data to the nonvolatile RAM. This process insures data integrity when modifying memory. The DS18B20 EEPROM is rated for a minimum of 50,000 writes and 10 years data retention at T = +55176。TINRT,TRC 和TSAMPLE 之和必須小于15us。如果線為低電平,便發(fā)生寫0。暫存存貯器是按8位字節(jié)存儲器來組織的,頭兩個字節(jié)包含測得溫度信息,第三和第四個字節(jié)是TH和TL的易失性拷貝,在每一次上電復(fù)位時被刷新。在序列號的第48 位進(jìn)入之后,移位寄存器便包含了CRC值。 5CRC GENERATION CRC生成The DS18B20 has an 8bit CRC stored in the most significant byte of the 64bit ROM. The bus master can pute a CRC value from the first 56bits of the 64bit ROM and pare it to the value stored within the DS18B20 to determine if the ROM data has been received errorfree by the bus master. The equivalent polynomial function of this CRC is:DS1820 有一存貯在64 位ROM 的最高有效字節(jié)內(nèi)的8 位CRC。如果主機(jī)接收到一個(0),它知道它必須在溫度變換期間在I/O 線上供一個強(qiáng)的上拉。The first is to provide a strong pullup on the DQ line whenever temperature conversions or copies to the E 2 memory are taking ,This may be acplished by using a MOSFET to pull the DQ line directly to the power supply as shown in Figur通過使用一個MOSFET把I/O線直接拉到電源可達(dá)到這一點(diǎn),當(dāng)使用寄生電源方式時VDD引腳必須連接到地。對這些寄存器的訪問是通過高速暫存存儲器,所有數(shù)據(jù)均以最低有效位在前的方式被讀寫PARASITE POWER。主機(jī)必須首先提供五種ROM 操作命令之一:1)Read ROM(讀ROM), 2)Match ROM(符合ROM),3)Search ROM(搜索ROM),4)Skip ROM(跳過ROM),或5) Alarm Search(告警搜索)。由于每個DS18B20的包含一個唯一的序列號,因此任意多個DSl820可以存放在同一條單線總線上。這允許在不同的地方放置溫度傳感器。 這些命令對每一器件的64 位激光ROM 部分進(jìn)行操作。2 寄生電源寄生電源電路當(dāng)I/O或VDD引腳為高電平時,這個電路便“取”得電源。Another method of supplying current to the DS18B20 is through the use of an external power supply tied to the V DD pin, as shown in Figure 供電的另外一種方法是通過使用連接到VDD 引腳的外部電源,這種方法的優(yōu)點(diǎn)是在I/O 線上不要求強(qiáng)的上拉電阻,總線上主機(jī)不需向上連接便在溫度變換期間使線保持高電平,這就允許在變換時間內(nèi)其它數(shù)據(jù)在單線上傳送。3 OPERATION ALARM SIGNAL3運(yùn)算報警信號After the DS18B20 has performed a temperature conversion, the temperature value is pared to the trigger values stored in TH and 完成溫度變換之后,溫度值與貯存在TH和TL內(nèi)的觸發(fā)值相比較,因為這些寄存器僅僅是8位。總線上的主機(jī)可以根據(jù)64 位ROM 的前56 位計算機(jī)CRC 的值并把它與存貯在DS1820 內(nèi)的值進(jìn)行比較以決定ROM 的數(shù)據(jù)是否已被主機(jī)正確地接收。移入CRC的8 位應(yīng)該使移位寄存器返回至全零。還有第九個字節(jié)它可用Read Scratchpad(讀暫存存貯器)命令讀出,該字節(jié)包含一個循環(huán)冗余校驗(CRC)字節(jié),它是前面所有8個字節(jié)的CRC值,此CRC值以(CRC產(chǎn)生)一節(jié)中所述的方式產(chǎn)生。 Time Slots讀時隙 當(dāng)從DS1820 讀數(shù)據(jù)時,主機(jī)產(chǎn)生讀時間片段。C, since it may not be able to sustain munications given the higher leakage currents the DS18B20 exhibits at these temperatures. For applications in which such temperatures are likely, it is strongly remended