JUnebug with OW device

Status
Not open for further replies.
I had no trouble using the Par type's myself. To my recollection it was just a matter of supplying power during the temp conversion process (and ???), then reading back the scratchpad. No difference in timing of write and read routines between the two.

I think ghostman11 is right on the Maxim samples being Par type, and that's how I learned to use them.

Here is the main function for the two in basic syntax. I used a 2n7000 to supply the power.

Code:
 function ReadTemp
  MasterRST
  PPulse
  OWout SkipRom
  OWout ConvertT
  #IFDEF Bus PARasitic
   Set Pullup On
  #ENDIF
  wait 1 s     'Need at least 750 ms for conversion?
  #IFDEF Bus PARasitic
    Set Pullup Off
  #ENDIF
  MasterRST
  PPulse
  OWout SkipRom
  OWout ReadScratch
  #IFDEF OWDevice ds18b20
   OWin12
    ReadTemp = RxData  ;whole integer no. with sign bit
  #ENDIF
  #IFDEF OWDevice ds18s20
   OWin
   ReadTemp = RxData/2  ;whole integer no. with NO sign bit
  #ENDIF
end function
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…