Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

EE World Online Articles

Loading
Top