OMG how can i be so dumb sometimes!
it was So obvious that I just didn't see it
Thank you
umm btw what do you mean about the trailing bracket? ]
OMG how can i be so dumb sometimes!
it was So obvious that I just didn't see it
Thank you
umm btw what do you mean about the trailing bracket? ]
Am I right in assuming IF i dont use the constants then it would default to 0.0625°C resolution and take 750ms to take a reading?
BUT IF I want to change the resolution I'd use the constants, but the code would beand this would take 187.5ms?Code:OWOUT DQ, 1, [$CC, $4E, 0, 0, DS18B20_9bit] OR OWOUT DQ, 1, [$CC, $4E, 0, 0, DS18B20_10bit] etc?
OK figured out $33 is skip rom command, and $4E is Write scratchpad
but what's the 0,0 after it?
ANd IF I was using more than 1 temp sensor then it would be something likeAssuming the ROM address is $B1,$FE,$22,$00,$00,$00?Code:OWOUT DQ, 1, [$55,$28,$B1,$FE,$22,$00,$00,$00,$5D,$44, $3F ] ; or do I HAVE to use the DS18B20_10bit instead of $3F?
I know that Match ROM is $55, Read ROM is $33, and Search Rom is $F0
And I know the $44 at the end is telling it to start a temperature conversion
Sorry for asking so many questions
Last edited by karenhornby; - 18th June 2008 at 15:30.
THINK I've sussed a bit more:
IF I want to change the resolution from the default I can use something likeand to address individual 1wire devices I'd use something likeCode:OWOUT DQ, 1, [$CC, $4E, 0, 0, $5F] ' 11 bit resolution
Code:OWOUT DQ, 1, [$55,$28,$B1,$FE,$22,$00,$00,$00,$5D,$44,$5F] THEN OWIN DQ, 4, [Stat] ' Stat is constant + Check for still busy converting IF Stat = 0 THEN W1 ' Still busy?, then loop OWOUT DQ, 1,[$55,$28,$B1,$FE,$22,$00,$00,$00,$5D,$BE] OWIN DQ, 2, [Temp.LOWBYTE,Temp.HIGHBYTE] 'Read two bytes, + end communications GOSUB Convert_Temp
Bookmarks