Guten Abend zusammen,
Mein Ziel:
Bei einem Raspberry Pi (B+ V1.2 512MB) am I2C-0 Bus beliebige
I2C-Endgeräte anzuschließen.
Was bisher geschah:
Ich habe durch mit Hilfe diverser Anleitungen aus dem Internet beide
Busse zum laufen bekommen, wie man an dieser Ausgabe sehen kann:
pi@rasphat ~ $ ls -l /dev/*i2c*
crw-rw---T 1 root i2c 89, 0 Jan 10 17:34 /dev/i2c-0
crw-rw---T 1 root i2c 89, 1 Jan 10 17:34 /dev/i2c-1
Der Versuchsaufbau besteht aus einem 24c32 Eeprom welches an dem i2c-0
BUS angeschlossen wird, Adresse 0x50 (HAT EEP Simulation).
Mit i2cdetect -y 0 bekomme ich folgendes Ergebnis:
pi@rasphat ~ $ i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Man sieht kein Device wird erkannt!
Wenn ich die Verdrahtung des EEPROM von i2c-0 auf i2c-1 tausche erhalte
ich mit i2cdetect -y 1 folgendes Ergebnis:
pi@rasphat ~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Hier wird das selbe EEPROM auf der korrekten Adresse erkannt!
Ferner ist es möglich, das EEPROM an i2c-0 mit dem tool "eepromutil" zu
beschreiben https://github.com/raspberrypi/hats/tree/master/eepromutils
:
pi@rasphat ~/Desktop/hats-master/eepromutils $ sudo ./eepflash.sh -w
-f=test.eep -t=24c32
This will disable the camera so you will need to REBOOT after this
process completes.
This will attempt to write to i2c address 0x50. Make sure there is an
eeprom at this address.
This script comes with ABSOLUTELY no warranty. Continue only if you know
what you are doing.
Do you wish to continue? (yes/no): yes
Writing...
0+1 records in
0+1 records out
132 bytes (132 B) copied, 2.29606 s, 0.1 kB/s
Done.
Nach einem Neustart ist mit more /proc/device-tree/hat/vendor der
Schreiberfolg überprüfbar:
pi@rasphat ~ $ more /proc/device-tree/hat/vendor
Test for mikrocontroller.net
pi@rasphat ~ $
"Test for mikrocontroller.net" habe ich zuvor in der eeprom-setting.txt
Datei eingegeben.
Damit ist bewiesen, dass sowohl das EEPROM als auch der BUS i2c-0
funktioniert.
Conclutions:
- BUS I2C-0 funktioniert, EEP mit i2cdetect -y 0 nicht ansprechbar
- BUS I2C-0 und EEP (0x50) mit eepromutils beschreibbar und auslesbar
- BUS I2C-1 funktioniert, EEP mit i2cdetect -y 1 ansprechbar
Hat irgend jemand eine Idee woran es liegt, dass über i2cdetect -y 0 die
I2C Devices nicht angezeigt werden? Obwohl diese funktionieren?
Gruß Markus
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.