User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 572
Joined: Sat Nov 02, 2013 2:06 pm

Enable I2C

Fri Jun 26, 2015 2:49 pm

Hi;

I am trying to connect my Model B Pi to an Arduino Nano ATMega328 via I2C.
This is the guide I am using:
http://blog.oscarliang.net/raspberry-pi ... nected-i2c

However when I started to following the guide on enabling I2C I could not find the configuration files that the guide was referring to, the raspi-blacklist.conf file did not exist.

I read this post:
viewtopic.php?f=44&t=98318

And loaded up raspi-config and followed the onscreen prompts to enable I2C and the Kernel.

Was this correct.

The guide then says to add i2c-dev to the modules script and install i2c tools and allow the Pi user to access i2c devices.

Is this all still correct?

Thanks
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Enable I2C

Fri Jun 26, 2015 2:52 pm

Add the following line to /boot/config.txt

dtparam=i2c_arm=on

Add the following line to /etc/modules

i2c_dev

Reboot.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 572
Joined: Sat Nov 02, 2013 2:06 pm

Re: Enable I2C

Fri Jun 26, 2015 3:02 pm

Thanks joan;

The next line in the guide says to enter:
ll /dev/i2c*

At the command prompt, after I received a bash error I figured this was a type or character problem and entered:
ls/dev/i2c*

This only lists one item:
/dev/i2c-1

The guide suggests that there is also:

/dev/i2c-0

???
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Enable I2C

Fri Jun 26, 2015 3:06 pm

The other bus (i2c-0) isn't normally enabled as it's used for HAT EEPROMS and, I think, for internal control of the Pi camera.

You can enable it if you want in /boot/config.txt. Look in /boot/overlays/README for details.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 572
Joined: Sat Nov 02, 2013 2:06 pm

Re: Enable I2C

Fri Jun 26, 2015 3:19 pm

I found other errors in the guide (written 2013!!!)
So I did a Google date refined search and found another guide on setting up i2c:

http://www.raspberrypi-spy.co.uk/2014/1 ... pberry-pi/

Just need to find an up to date guide on connected RPi to Arduino using i2c now :-)
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Enable I2C

Fri Jun 26, 2015 3:24 pm

JonnyAlpha wrote:I found other errors in the guide (written 2013!!!)
So I did a Google date refined search and found another guide on setting up i2c:

http://www.raspberrypi-spy.co.uk/2014/1 ... pberry-pi/

Just need to find an up to date guide on connected RPi to Arduino using i2c now :-)
That guide is out of date as well. It predates device tree, you should not add an entry for i2c_bcm2708 in /etc/modules.

Return to “Interfacing (DSI, CSI, I2C, etc.)”