Erstmals Danke für eure hilfe

Pullup´s sind dran nur bin ich drauf gekommen das der Code hinten und vorne nicht stimmt!

Früher ist in dieser Schaltung ne C-Controll gehangen und jetzt über enen Adapter ein Mega 16 der Fühler war schon in Betrieb hat auch funktioniert.
Jetzt hab ich den C Cod mal umgeschrieben in Bascom Tut sich aber gar nichts.
Datenblatt vom DS1631: http://www.datasheetcatalog.com/data...6/DS1631.shtml

der alte Code:
http://www.csslabs.de/ccontrol/lib/b...S1631_READ.htm

(Libery):
http://www.fdos.de/ccforum/codelib/b...31_GENERIC.htm

neue Code:
Code:
      $regfile = "m16def.dat"
$framesize = 60
$swstack = 60
$hwstack = 60
$crystal = 8000000
$baud = 4800

Config Scl = Portc.0
Config Sda = Portc.1

Dim Ds1631 As Byte
Dim Ds1631r As Byte
Ds1631 = 158
Ds1631r = 159
Const Addr = 159
Const Convert = &H51
Const Read_temp = &HAA
Const Conf = &HAC
Const Rese = &H54

Declare Sub Ds1631reset
Declare Sub Ds1631set_status
Declare Sub Ds1631convert
Declare Sub Ds1631wait_rady
Declare Sub Ds1631get_temp
Declare Sub Ds1631get_status
Dim A As Integer

Dim Dat As Byte
Dim Temp As Byte
Dim Tempold As Byte
A = 1


Do
Ds1631reset
Waitms 10
Ds1631set_status
Waitms 10
Ds1631convert
Waitms 10
Ds1631wait_rady
Wait 1
Ds1631get_temp

Print Temp ; "  "
Print Tempold
Print " gh " ; A
Print
Print
A = A + 1
Tempold = Temp
Wait 1
Loop





Sub Ds1631reset
I2cstart
I2cwbyte Ds1631
I2cwbyte Rese
I2cstop
End Sub

Sub Ds1631set_status
I2cstart
I2cwbyte Addr
I2cwbyte Conf
I2cwbyte Dat
I2cstop
End Sub

Sub Ds1631convert
I2cstart
I2cwbyte Ds1631
I2cwbyte Convert
I2cstop
End Sub

Sub Ds1631get_status(data As Byte)
I2cstart
I2cwbyte Ds1631
I2cwbyte Conf
I2cstop
I2cstart
I2cwbyte Ds1631r
I2crbyte Dat , Nack
I2cstop
End Sub



Sub Ds1631wait_rady

End Sub

Sub Ds1631get_temp(temp As Word ; Dat As Byte)

I2cstart
I2cwbyte Ds1631
I2cwbyte Read_temp
I2cstop
I2cstart
I2cwbyte Ds1631r
I2crbyte Dat
Temp = Dat * 256
Print "1    " ; Dat
I2crbyte Dat
Temp = Temp + Dat
Print "2    " ; Dat
I2cstop
End Sub