The DS18X20 B7 chip die (found in the DS18B20, DS1820S, and DS1822 products) can experience EEPROM data corruption failures during power on reset.
Since the EEPROM holds internal trim values (in addition to the user data in the TH and TL registers) that control the conversion process of the DS18X20 this may show up as inaccuracy of temperature readings. And can cause temperature measurement errors of up to ±60°C.
Since there are a large number of BS18X20 B7 chips in service around the world so you never know when you may be dealing with one on a network so all software writers are recommended to code their software to handle this problem. A replacement die, the C2 version of the chip will be available later this year but it would still be good coding practice to handle the older chips correctly.
...recommended solution is to read known good trim values once and then store in either EEPROM or in an initialization file for later use. During actual operations the procedure would then be something like the following:
Normal operational flow procedure for handling B7 versions of the DS18X201. Compare serial number of device with bad list2. If device serial number not on list, code normally... skip to number 83. If on bad list, read the scratch pad (8 bytes) a. This tells you if device is in power on reset state, like this: Byte 0 = 50h Byte 1 = 05h Byte 2 = TH Byte 3 = TL Byte 4 = Config Register Byte 5 = FFh Byte 6 = 0Ch Byte 7 = 10h Byte 8 = CRC4. If device is not in POR state, skip to 85. Read the DS18X20 Trim values6. Check Trim data against known good data for the particular chip7. If not same as saved data, Write new Trim values, etc., (you may wish to keep track of number of times you have updated the EEPROM so if needed you could replace chip when exceeding the lifetime of the EEPROM.)8. Do regular temperature conversion sequence
To tell if your DS18B20 is a B7 die, and therefore may have a potential corruption problems:
1. Read the 18X20's ROM code. Look at only the serial number portion of the ROM code: List of Chips with the B7 Die
List of Chips with the B7 Die
1. Read the 18X20's ROM code. Look at only the serial number portion of the ROM code:0xCC00000SSSSSSSFFwhere CC is the CRC 00000 is the customer code SSSSSSS is the serial number FF is the family codeDS1822Starting ROM code of rev B7 4A00000008978A22Ending ROM code of rev B7 3B0000000CB81922 Starting ROM code of rev C2 620000000CB81A22DS18S20Starting ROM code of rev B7 E0000800591D2010Ending ROM code of rev B7 AB00080080885F10 Starting ROM code of rev C2 6200080080886010DS18B20Starting ROM code of rev B7 0600000054501028Ending ROM code of rev B7 5E000000662B4F28 Starting ROM code of rev C2 21000000662B5028
SPRINGBOK DIGITRONICSDesign Guide v1.0Understanding 1-Wire Series