Go Down

Topic: [DS18B20, DS18S20, and DS1822] Potential corruption issues!? (Read 147 times) previous topic - next topic

rtek1000

I was researching noise on the OneWire data bus and found this tip:

Quote
The DS18X20 B7 chip die (found in the DS18B20, DS1820S, and DS1822 products) can experience EEPROM data corruption failures during power on reset.
Quote
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.
Quote
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.
Quote
...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:
Quote
Normal operational flow procedure for handling B7 versions of the DS18X20
1. Compare serial number of device with bad list

2. If device serial number not on list, code normally... skip to number 8

3. 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 = CRC

4. If device is not in POR state, skip to 8

5. Read the DS18X20 Trim values

6. Check Trim data against known good data for the particular chip

7. 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
Quote
To tell if your DS18B20 is a B7 die, and therefore may have a potential corruption problems:
Quote
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
Quote
List of Chips with the B7 Die
Quote
1. Read the 18X20's ROM code. Look at only the serial number portion of the ROM code:

0xCC00000SSSSSSSFF
where CC is the CRC 00000 is the customer code SSSSSSS is the serial number FF is the family code

DS1822
Starting ROM code of rev B7 4A00000008978A22
Ending ROM code of rev B7 3B0000000CB81922
   Starting ROM code of rev C2 620000000CB81A22

DS18S20
Starting ROM code of rev B7 E0000800591D2010
Ending ROM code of rev B7 AB00080080885F10
   Starting ROM code of rev C2 6200080080886010

DS18B20
Starting ROM code of rev B7 0600000054501028
Ending ROM code of rev B7 5E000000662B4F28
   Starting ROM code of rev C2 21000000662B5028
Source:
Quote
SPRINGBOK DIGITRONICS
Design Guide v1.0
Understanding 1-Wire Series
https://dutta.csc.ncsu.edu/iot_spring17/wrap/1-Wire-Design%20Guide%20v1.0.pdf

Please avoid private messages, your question may be someone's answer in the future!

rtek1000

Note: I searched for DS1820S and found only DS18S20.

(I leave it commented here to help in future research)

Ref: https://www.digchip.com/datasheets/parts/datasheet/280/DS1820S-pdf.php
Please avoid private messages, your question may be someone's answer in the future!

Nick_Pyner

If you are feeling spooked, don't be. If you are trying to spook everybody else, don't bother, they won't be.

Referring to a DS1820S probably tells you a lot.

Go Up