Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/onewire/ds18x20.py: Mask power-on reset value 0550h #5338

Closed

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Nov 17, 2019

According to the specification of the DS18B20 sensor [1] (Page 6),

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

This commit prevents propagating this accidentally as a valid reading when starting the conversion has been missed.

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

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

This commit prevents propagating this accidentally as a valid reading
when starting the conversion has been missed.

[1] https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf
@amotl
Copy link
Contributor Author

amotl commented Nov 17, 2019

Dear Damien,

this synchronizes the DS18B20 driver with a pending pull request to its pure-Python variant [1,2], which is the only thing which can be used by people unable to use the native variant yet, e.g. on Pycom MicroPython.

With kind regards,
Andreas.

cc @robert-hh

[1] robert-hh/Onewire_DS18X20#7
[2] robert-hh/Onewire_DS18X20#8

@amotl
Copy link
Contributor Author

amotl commented Nov 17, 2019

Dear Damien,

a little bit off-topic to this, we also wanted to let you know that we just have been able to unlock native 1-Wire/DS18X20-support for Pycom MicroPython through pycom/pycom-micropython-sigfox#356.

Thankfully, Pycom upgraded to MicroPython 1.11 the other day so the patch was rather small.

Thanks again for your hard work on Genuine MicroPython and keep up the spirit.

With kind regards,
Andreas.

@amotl
Copy link
Contributor Author

amotl commented Nov 18, 2019

Also trying to add this to @robert-hh's pure-Python driver at https://github.com/robert-hh/Onewire_DS18X20, he commented on robert-hh/Onewire_DS18X20#8:

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.

He is absolutely right, so I will retract this PR. Sorry for the noise.


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

@amotl amotl closed this Nov 18, 2019
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Sep 13, 2021
…s-readinto

Correct the 24bit decoding in bitmaptools.readinto()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant