Hallo,
ich habe den PCF 8574 P (von reichelt).
Mein Problem ist, dass er nicht reagiert.
Ich benutze einen ATMEGA32, 16Mhz.
Das ist mein code:
Ich habe die Pins A0-A2 alle auf vcc, habe vorher 10K Pull-ups drangehabt, dann habe ich allerdings gehört da müssten keine dran.Code:$regfile = "m32def.dat" $crystal = 16000000 $baud = 9600 Config Scl = Portc.0 Config Sda = Portc.1 Config I2cdelay = 10 Const Adresswrite = &H4E 'Slaveadresse Config Porta = Output Dim X As Byte Dim Wert As Byte Declare Function Pcfwrite(byval Adress As Byte , Wert As Byte) As Byte I2cinit X = 1 Wert = &B01010101 Print "Atmega32 I2C Master" Waitms 1000 Print "Motoren anschalten" Waitms 1000 X = Pcfwrite(adresswrite , Wert) Do If X <> 0 Then Print "I2C Fehler" Else Print "Übertragung erfolgreich" End If Waitms 500 Loop End Function Pcfwrite(byval Adresswrite As Byte , Wert As Byte) As Byte I2cstart I2cwbyte Adresswrite I2cwbyte Wert I2cstop Pcfwrite = 0 End Function
Ich komme dann auf die Adresse:
01001110 oder auch 4E.
Trotzdem funktioniert das ganze nicht.
Vielleicht kann mir ja jemand helfen.
Mfg
Nils
Lesezeichen