I have been fooling with a single DS18B20.
With the following code the raw count is correctly displayed if term 3 of the DS18B20 is tied to +5 VDC. This is true for C.0 and B.0. and for the ReadTemp12 and the OWout/OWin technique
However, if I GRD term 3 of the DS18B20 (parasitic power), the raw data using ReadTemp12 is 1360 which is 85 degrees, and this is what I would expect.
But, the OWout technique with strong pullup gives 2047 (all 1s) which baffles me.
Can anyone verify if the strong pullup works with the 20X2.
*************
***********************
Thanks.
P H Anderson
With the following code the raw count is correctly displayed if term 3 of the DS18B20 is tied to +5 VDC. This is true for C.0 and B.0. and for the ReadTemp12 and the OWout/OWin technique
However, if I GRD term 3 of the DS18B20 (parasitic power), the raw data using ReadTemp12 is 1360 which is 85 degrees, and this is what I would expect.
But, the OWout technique with strong pullup gives 2047 (all 1s) which baffles me.
Can anyone verify if the strong pullup works with the 20X2.
*************
Code:
#picaxe 20x2
' Converted by X2 Conversion Wizard Version 1.0.2
let dirsB = %11111110
let adcsetup = 0
Top:
Do
GoSub MeasTemp1
SerTxD ("1 ", #w0, CR, LF)
Pause 2500
GoSub MeasTemp2
SerTxD ("2 ", #w0, CR, LF)
Loop
MeasTemp1:
ReadTemp12 C.0, w0
Return
MeasTemp2:
OWOut C.0, %1001, ($cc, $44) ' note strong pullup
Pause 800
OWOut C.0, %0001, ($cc, $be)
OWin C.0, %0000, (b0, b1)
Return
Thanks.
P H Anderson