I2C and SPI on Raspberry Pi Configuration

As I am going to use I2C (BMP180) and SPI (DS1722) sensors with my Raspberry Pi (wheezy distribution) I need to enable them. Real easy to do, start by editing the file /etc/modprobe.d/raspi-blacklist.conf and make sure that the lines containing blacklist spi-bcm2708 and blacklist i2c-bcm2708 are commented out

Then edit the /etc/modules file so it contains the following two lines (it may contain more lines): i2c-dev, i2c-bcm2708 and spi-bcm2708.


Reboot!

Execute the command lsmod, and you should see spi_bcm2708 and i2c_bcm2708 in the list


The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be able to see which devices are connected to your Pi as a way of making sure everything is working. To be able to do this execute sudo apt-get install python-smbus and sudo apt-get install i2c-tools.

And the last step is to execute sudo apt-get update and sudo apt-get upgrade to get the latest and greatest libraries.

That's it for now, next post should contain some code I hope.

--Andy

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Andy's blog about the world of embedded Java, Oracle Java Cloud Service and my more fun things!

Search

Categories
Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
     
Today