BeanieBots
Moderator
I have done many projects involving PICAXE and DS18B20s but have always had the luxury of not needing to worry about negative temperatures.
As many of these projects involve 'consequences' if there is a sensor failure, I have traditionally used the return value to determine if there is a sensor failure or disconnect.
No sensor returns Value = 0 if using ReadTemp or Value = $FFFF if using one-wire commands.
I now have a project that requires the measurement of negative temperatures.
Thanks to some code snippets by Marks, I have all the issues with handling the negative values sorted with one exception. A value of $FFFF when using one-wire commands is a legitimate value and can no longer be used to determine if the sensor is really there.
I had thought of using the command Readowsn and checking something like the family code but that uses up too many variables which I cannot afford to do. Pushing/popping all those variables might be an option but it seems a bit extreme.
Is there a simple one-wire command that can use just a single variable that I could use to reliably determine the presence of a DS18B20?
I've had a look at the Dallas datasheet but all I managed to get was a headache!
Any help much appreciated.
PS this is using a 28X2
As many of these projects involve 'consequences' if there is a sensor failure, I have traditionally used the return value to determine if there is a sensor failure or disconnect.
No sensor returns Value = 0 if using ReadTemp or Value = $FFFF if using one-wire commands.
I now have a project that requires the measurement of negative temperatures.
Thanks to some code snippets by Marks, I have all the issues with handling the negative values sorted with one exception. A value of $FFFF when using one-wire commands is a legitimate value and can no longer be used to determine if the sensor is really there.
I had thought of using the command Readowsn and checking something like the family code but that uses up too many variables which I cannot afford to do. Pushing/popping all those variables might be an option but it seems a bit extreme.
Is there a simple one-wire command that can use just a single variable that I could use to reliably determine the presence of a DS18B20?
I've had a look at the Dallas datasheet but all I managed to get was a headache!
Any help much appreciated.
PS this is using a 28X2