Durch Nutzung dieser Webseite stimmen Sie dem Einsatz von Cookies und Werbung zu. Weitere Informationen



KnowHow 11.1 ''GPIO''
Stand: 18.05.2017 16:35:46

Inhalt | Suche | Homepage | Kontakt | Impressum

- Durch Anklicken im Inhaltsverzeichnis kann direkt zum Thema gesprungen werden.
- Begriffe auf dieser Seite können mit Ihrer Browser-Funktion ''Bearbeiten -> Suchen'' oder mit den Tasten [Strg]-[F] gesucht werden.
- Des weiteren gibt es noch eine Suchfunktion über alles.
- Es sind mehr Informationen verfügbar, als hier angegeben. Falls Sie etwas vermissen, scheuen Sie sich nicht nachzufragen, wir antworten gerne.




11.1.1 GPIO


11.1.1.1 Temperatur-Sensor DS18B20

Anleitung für Einrichtung des Raspberry zur Temperatur-Messung:
http://www.sbprojects.com/projects/raspberrypi/temperature.php

Problem: Bei Nutzung des digitalen Temperatur-Sensor DS18B20 am GPIO und des Kamera-Moduls gleichzeitig,
gibt die Kamera kein Bild mehr aus.
Lösung:
http://www.raspberrypi.org/forums/viewtopic.php?t=61922
https://github.com/raspberrypi/linux/issues/435
Die Kamera nutzt den GPIO 4 und der Temperatur-Sensor DS18B20 ist auch auf dem GPIO 4 geschaltet.

Funktionsfähige Einrichtung:

Inhalt von /boot/config.txt am Ende ergänzen mit:
# device tree config
dtoverlay=w1-gpio,gpiopin=4
gpu_mem=128

Inhalt von /etc/modules vorher:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
snd-bcm2835

Inhalt von /etc/modules erweitern mit:
# /etc/modules: kernel modules to load at boot time.
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
w1-therm
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835

Inhalt von /etc/modprobe.d/raspi-blacklist.conf unverändert:
# blacklist spi and i2c by default (many users don't need them)
blacklist spi-bcm2708
blacklist i2c-bcm2708

RaspberryPi neu starten

Es wird ein Ordner mit der Seriennummer des Sensor unter /sys/bus/w1/devices/w1_bus_master1 erzeugt.

Beispiel mit der Serienmummer 28-000006377ac9:
In der Datei /sys/bus/w1/devices/w1_bus_master1/28-000006377ac9/w1_slave
steht dann die gemessene Temperatur in 1/1000 Grad:
30 00 4b 46 ff ff 0f 10 b8 : crc=b8 YES
30 00 4b 46 ff ff 0f 10 b8 t=23812



11.1.1.2 AD Converter MCP3208

Anleitungen:
http://erik-bartmann.de/component/attachments/download/22.html
http://erik-bartmann.de/component/attachments/download/21.html
http://hertaville.com/2013/07/24/interfacing-an-spi-adc-mcp3008-chip-to-the-raspberry-pi-using-c/

https://sites.google.com/a/joekamphaus.net/raspberrypi/


Anleitung:
http://hertaville.com/2013/07/24/interfacing-an-spi-adc-mcp3008-chip-to-the-raspberry-pi-using-c/

Enabling Spidev on the Raspberry Pi
    Turn on the Raspberry Pi and connect it to the network.
    Log in to the Raspberry Pi remotely over SSH.
    Open the raspi-black-list.conf  file using the following command : “sudo nano /etc/modprobe.d/raspi-blacklist.confâ€
    Comment out the “blacklist spi-bcm2708†entry by putting a hash # sign in front of it. So it looks like “#blacklist spi-bcm2708â€.
    Type “sudo rebootâ€. This should cause the Raspberry Pi to reboot. Which will terminate the SSH session.
    Start a new SSH session and type “ls /dev/spidev*†If you see the output displayed in Figure 7, then the SPI driver (spidev) has been successfully enabled on the Raspberry Pi.

C++-Dateien nach Anleitung erzeugen

cd /media/storage/spi

Build:
g++ -Wall -o getspi  mcp3208Spi.cpp mcp3208SpiGet.cpp


Run binary with:
./getspi 0   (or channel 1,2,3,4,5,6,7)



Besucher seit 30.01.2003:

© 2013 Burgermeister  | Home | Main Server | Mirror Server | Kontakt | Impressum | Datenschutz