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 #8

Closed amotl closed 4 years ago

amotl commented 4 years ago

According to the specification [1], the power-on reset value of the temperature register is +85°C (Page 6).

Resolve #7.

[1] https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

robert-hh commented 4 years ago

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.

amotl commented 4 years ago

I see your point here. Thanks!

amotl commented 4 years ago

I also retracted the corresponding pull request https://github.com/micropython/micropython/pull/5338 to Genuine MicroPython.

As a final note, a member of our community showed us [1] how the corresponding ethersex driver uses a semaphore for propagating the conversion error. This way, it the condition can be implemented within the driver, but the caller may decide about its outcome. Thanks @weef!

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