Da die I2C verindung nun endlich funktioniert möchte ich den MLX nicht nur auslesen sondern auch neu Konfigurieren
Ich habe etwas herum Probiert bekomme aber leider keine daten Geändert.
Im Datenblatt 8.4.5 steht das die ersten/letzten bits angeben ob man auf den Ram oder EEProm zugreifen möchte.
Ich vermute das ich ein Fehler beim ansprechen habe.
Opcode Command
000x xxxx* RAM Access
001x xxxx* EEPROM Access
1111_0000** Read Flags
1111_1111 Enter SLEEP mode
Ich habe versucht werte zu ändern, jedoch gelingt mir das nicht.
Übrigens ist die SM Adresse wirklich 5A ! Er reagiert darauf aber nicht, sondern nur auf 0X00
Mein neuer Code:
Alles anzeigen
Ich habe etwas herum Probiert bekomme aber leider keine daten Geändert.
Im Datenblatt 8.4.5 steht das die ersten/letzten bits angeben ob man auf den Ram oder EEProm zugreifen möchte.
Ich vermute das ich ein Fehler beim ansprechen habe.
Opcode Command
000x xxxx* RAM Access
001x xxxx* EEPROM Access
1111_0000** Read Flags
1111_1111 Enter SLEEP mode
Ich habe versucht werte zu ändern, jedoch gelingt mir das nicht.
Übrigens ist die SM Adresse wirklich 5A ! Er reagiert darauf aber nicht, sondern nur auf 0X00
Mein neuer Code:
BASCOM-Quellcode
- Call Read_mlx(Addr , cmd , Rlbyte , Rhbyte , Crc)
- Call Write_mlx(addr , Cmd , Rlbyte , Rhbyte , Crc)
- Sub Read_mlx(byval Addr As Byte , Byval Command As Byte , Rlbyte As Byte , Rhbyte As Byte , Crc As Byte)
- I2cstart 'start
- I2cwbyte Addr 'address
- I2cwbyte Cmd 'command
- I2crepstart 'repeat start
- I2cwbyte Addr 'repeat adress
- I2crbyte Rlbyte , Ack 'lowbyte
- I2crbyte Rhbyte , Ack 'highbyte
- I2crbyte Crc , Nack 'crc error
- I2cstop
- End Sub
- Sub Write_mlx(byval Addr As Byte , Byval Command As Byte , Byval Rlbyte As Byte , Byval Rhbyte As Byte , Crc As Byte)
- I2cstart 'start
- I2cwbyte Addr 'address
- I2cwbyte Cmd 'command
- I2cwbyte Rlbyte 'lowbyte
- I2cwbyte Rhbyte 'highbyte
- I2crbyte Crc , Nack 'crc error
- I2cstop
- End Sub