Thanks a lot for the complete code.
Unfortunately I am not yet able to read the correct temperature (see below):
_____ _
| __|___ ___ ___ _ _|_|___ ___
| __|_ -| . | _| | | | | . |
|_____|___| _|_| |___|_|_|_|___|
|_| http://espruino.com
1v93 Copyright 2016 G.Williams
Espruino is Open Source. Our work is supported
only by sales of official boards and donations:
http://espruino.com/Donate
>
=undefined
Temp is -0.0625°C
Temp is -0.0625°C
Temp is -0.0625°C
Temp is -0.0625°C
Temp is -0.0625°C
Temp is -0.0625°C
Temp is -0.0625°C
The device returns a negative temp value that seems compatible with a scratchpad reading like FF ... FF.
Also changing the value of the pull up resistor between data and 3.3V (e.g. 3.3K or 2K) the result does not change (note: the "native code" also works fine without pull-up connected!)
At this point, I try to focus on the low level differences between the two implementations (the one that works and Espruino).
I see so far slight differences in the low-level commutation timings (e.g. in reset pulse, write bit "0" or "1"), though both implementations seem compatible with device sampling / response times.
Maybe these differences combined with the fact that I'm using a sensor with only a 1m cable can determine the different behavior.
Obviously to go deep I have to recover an oscilloscope that can help me in the analysis of the low level signals between the two cases (not immediately unfortunately).
Any other suggestion from you is welcome!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks a lot for the complete code.
Unfortunately I am not yet able to read the correct temperature (see below):
The device returns a negative temp value that seems compatible with a scratchpad reading like FF ... FF.
Also changing the value of the pull up resistor between data and 3.3V (e.g. 3.3K or 2K) the result does not change (note: the "native code" also works fine without pull-up connected!)
At this point, I try to focus on the low level differences between the two implementations (the one that works and Espruino).
I see so far slight differences in the low-level commutation timings (e.g. in reset pulse, write bit "0" or "1"), though both implementations seem compatible with device sampling / response times.
Maybe these differences combined with the fact that I'm using a sensor with only a 1m cable can determine the different behavior.
Obviously to go deep I have to recover an oscilloscope that can help me in the analysis of the low level signals between the two cases (not immediately unfortunately).
Any other suggestion from you is welcome!