Max's Application #1 - DS1620 Temperature Sensor

Use this forum to post your latest creation using products from Comfile Technology

Max's Application #1 - DS1620 Temperature Sensor

Postby max » Thu Oct 27, 2005 9:33 am

Max's Application #1 - DS1620 Example




This is an example of connecting CUBLOC to DS1620 that spits
out current temperature to a GHLCD.

This is version 0.0.1. I will hope to make it better and all.


Heres a pic of debug screen that outputs the current temp:
Image

Source code included here


Download Here:


http://cubloc.com/max/DS1620.zip
User avatar
max
Site Admin
 
Posts: 886
Joined: Wed Aug 31, 2005 9:21 am
Location: San Francisco

Postby Aspectus » Thu Nov 23, 2006 9:09 am

HI max ....
I used this code .. and it works ..
Untill i reech 0C
Then the temperature goes negative it starts to show 256C and slowly going down ...
i didnt' do any mods to it ... can you take a look ?
User avatar
Aspectus
Super
 
Posts: 47
Joined: Tue Oct 24, 2006 10:07 am
Location: FLORIDA

Postby Aspectus » Thu Aug 16, 2007 7:03 am

here is the fix
Code: Select all
Function Get9bits() As Integer
   Dim Bit As Byte
   Dim Temperature As Byte
   Dim sign As String
Dim test As Byte
Dim temp As Single
Dim temps As String

'      Temperature=Temperature/2
      Out CLK,0
      Temperature.bit0=In(DQ)
      Out CLK,1
      Out CLK,0
      Temperature.bit1=In(DQ)
      Out CLK,1   
      Out CLK,0
      Temperature.bit2=In(DQ)
      Out CLK,1
      Out CLK,0
      Temperature.bit3=In(DQ)
      Out CLK,1      
      Out CLK,0
      Temperature.bit4=In(DQ)
      Out CLK,1
      Out CLK,0
      Temperature.bit5=In(DQ)
      Out CLK,1
      Out CLK,0
      Temperature.bit6=In(DQ)
      Out CLK,1
      Out CLK,0
      Temperature.bit7=In(DQ)
      Out CLK,1
      Out CLK,0
      test=In(DQ)
      Out CLK,1

       '      Delay 1
   Glocate 0,0
   Clear 1
   sign = "+"
If test = 1 Then
Temperature = Temperature Xor 128
Temperature = Temperature Xor 64
Temperature = Temperature Xor 32
Temperature = Temperature Xor 16
Temperature = Temperature Xor 8
Temperature = Temperature Xor 4
Temperature = Temperature Xor 2
Temperature = Temperature Xor 1
sign = "-"
End If
temp = Temperature/2
temps = Float temp
temps=Left(temps,4)



   Get9bits=Temperature

End Function
User avatar
Aspectus
Super
 
Posts: 47
Joined: Tue Oct 24, 2006 10:07 am
Location: FLORIDA


Return to Applications and Examples

Who is online

Users browsing this forum: No registered users and 2 guests