pkedvessy
Member level 5
Hy!
I connect a DS1621 thermometer to 90s2313 with this little code, developed in BASCOM-AVR:
$crystal = 4000000
Config Portb = Output
Config Sda = Portd.6
Config Scl = Portd.5
Config I2cdelay = 10
I2cinit
Dim B1 As Byte
Dim B2 As Byte
Portb = 0
Do
I2cstart
I2cwbyte &H90
I2cwbyte &HAA
I2cstart
I2cwbyte &H91
I2crbyte B1 , Ack
I2crbyte B2 , Nack
I2cstop
Portb = B1
Waitms 200
Loop
End
I hope, this code read out the temperature from the DS1621 and put it's first byte to the PortB, but it doesnt work! Anyone can halp me what's the problem???
I connect a DS1621 thermometer to 90s2313 with this little code, developed in BASCOM-AVR:
$crystal = 4000000
Config Portb = Output
Config Sda = Portd.6
Config Scl = Portd.5
Config I2cdelay = 10
I2cinit
Dim B1 As Byte
Dim B2 As Byte
Portb = 0
Do
I2cstart
I2cwbyte &H90
I2cwbyte &HAA
I2cstart
I2cwbyte &H91
I2crbyte B1 , Ack
I2crbyte B2 , Nack
I2cstop
Portb = B1
Waitms 200
Loop
End
I hope, this code read out the temperature from the DS1621 and put it's first byte to the PortB, but it doesnt work! Anyone can halp me what's the problem???