robert-hh / Onewire_DS18X20

Classes for driving the DS18x20 sensor with the onewire protocol for Pycom MicroPython
11 stars 6 forks source link

DS18B20: Mask power-on reset value 0550h within the scratch memory of the temperature register #7

Closed amotl closed 4 years ago

amotl commented 4 years ago

Hi there,

according to the specification of the DS18B20 sensor,

The power-on reset value of the temperature register is +85°C (Page 6).

So, we might think about checking for this value (0550h) and masking it appropriately in order to prevent propagating this reading accidentally as a valid one.

See also https://community.hiveeyes.org/t/untersuchung-und-verbesserung-des-timings-bei-der-ansteuerung-der-ds18b20-sensoren-unter-micropython/2309/77.

With kind regards, Andreas.

amotl commented 4 years ago

See also the respective implementation elsewhere [1].

[1] https://github.com/timofurrer/w1thermsensor

amotl commented 4 years ago

@robert-hh said within #8:

In the new version I intentionally did not implement this test. 85°C is a valid result, which must not be suppressed by the driver. Checking must be done by the calling code, which knows the context.

I see your point here. Thanks!

amotl commented 4 years ago

I've channeled this back to our community and just wanted to drop the response [1] here which might be an interesting read in this very context.

[1] https://community.hiveeyes.org/t/untersuchung-und-verbesserung-des-timings-bei-der-ansteuerung-der-ds18b20-sensoren-unter-micropython/2309/103