Citrus Perl and Raspberry Pi

Enabling I2C, SPI and 1 Wire

| 0 Comments
If you have some hardware with an I2C, SPI or 1 Wire interface connected to your Raspberry Pi you need to enable the kernel modules that drive these interfaces.

The Raspbian Wheezy images from 2012-10-28-wheezy-raspbian.zip onwards contain the necessary kernel modules but they are not enabled by default. You must edit a couple of configuration files and install the i2c-tools package first.

You need to remove the 'blacklist' entries from raspi-blacklist.conf.

sudo nano /etc/modprobe.d/raspi-blacklist.conf

i2cblacklist.png
You need to comment out the two blacklist entries as above. Save and exit from the editor (ctrl O and ctrl X).

Next you need to add the i2c-dev and 1 wire modules to /etc/modules.

sudo nano /etc/modules

i2cmodules.png

Add the lines 'i2c-dev', 'w1-gpio' and 'w1-therm' as above. Save and exit from the editor (ctrl O and ctrl X ). Install the i2c-tools package.

sudo apt-get install i2c-tools

You should now reboot your Raspberry Pi

sudo shutdown -r now

Once rebooted you can detect i2c devices attached to your Raspberry Pi (if any).

sudo i2cdetect -y 1

If you have a Revision 1 board you will need to use 
         sudo i2cdetect -y 0

Leave a comment

About this Entry

This page contains a single entry by Mark Dootson published on February 2, 2013 3:56 AM.

Citrus Perl on Raspberry was the previous entry in this blog.

New HiPi Distribution is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.