Also ich habe jetzt diesen Code ausprobiert:
Code:
$regfile = "m8515.dat" 'ATmega8515-Deklarationen
$crystal = 4000000 'Quarz: 4 MHz
$baud = 9600
Dim Wert As Byte
Dim I As Byte
Config I2cdelay = 20
Config Scl = Portb.2
Config Sda = Portb.3
I2cinit
'I2cstart
'I2cwbyte &B10010000
'I2cwbyte &B00000000
'I2cstop
I2cstart
i2cwbyte &B10010000
if Err = 1 then
Print "No Ack from Device"
I2cstop
Else
I2cwbyte &B00000000
I2cstop
Print "ACK from Device"
end if
'Do
I2cstart
I2cwbyte &B10010001
I2crbyte Wert , Nack
I2cstop
Print Wert;
'Loop
Do
Loop
End
Ich bin also langsamer und bekomme im Terminal "ACK from Device".
Das ist also in Ordnung.
Ich lese jetzt erst nochmal Gerhards link durch.
Ich bekomme übrigens immer so Werte um die 50...
Lesezeichen