Enabling I2C buses on BeagleBone expansion connector

Hi, I've been experimenting with the BeagleBone, and I'm very excited
that it just works with a USB high-speed analog waveform digitizer
board we have. The collection of interfaces is really quite
impressive.

Moving onto a more mundane applications, I'm trying access some I2C
magnetic field sensors that we have used with Arduinos in the past.
As I understand it, the BeagleBone has three I2C buses, two of which
are available on the P9 expansion connector. However, I only see one
I2C interface identified by i2cdetect, which I assume is I2C0. There
are a lot of troubleshooting wiki pages and email posts on I2C for the
other BeagleBoard models, but I'm not sure how much of it applies to
the BeagleBone.

So, I have a few questions that would help me get started with I2C on
the BeagleBone:

1. Is it correct that the I2C bus is 3.3V on the BeagleBone, unlike
the 1.8V interfaces for the other BeagleBoards?

2. The older boards needed pull-up resistors on the SDA and SCL
lines. Is that true for the BeagleBone?

3. I found a page (http://elinux.org/Interfacing_with_I2C_Devices)
that indicates that one of the I2C interfaces on the older boards were
disabled in the kernel driver due to the lack of pull-up resistors.
Is this why I don't see all three I2C buses on my BeagleBone, and will
the directions on that wiki for how to recompile my kernel to enable
those interfaces also work on the BeagleBone?

Thanks for any help. Is there a central wiki where BeagleBone-
specific user documentation should go? I'd be more than happy to
write-up a quick "How to use I2C peripherals on your BeagleBone" page
once I figure it out myself. :slight_smile:

Hi, I've been experimenting with the BeagleBone, and I'm very excited
that it just works with a USB high-speed analog waveform digitizer
board we have. The collection of interfaces is really quite
impressive.

Moving onto a more mundane applications, I'm trying access some I2C
magnetic field sensors that we have used with Arduinos in the past.
As I understand it, the BeagleBone has three I2C buses, two of which
are available on the P9 expansion connector. However, I only see one
I2C interface identified by i2cdetect, which I assume is I2C0. There
are a lot of troubleshooting wiki pages and email posts on I2C for the
other BeagleBoard models, but I'm not sure how much of it applies to
the BeagleBone.

So, I have a few questions that would help me get started with I2C on
the BeagleBone:

1. Is it correct that the I2C bus is 3.3V on the BeagleBone, unlike
the 1.8V interfaces for the other BeagleBoards?

Correct, every pin except the analog in and 5V ones are 3.3V, including SPI, I2C and GPIO.

2. The older boards needed pull-up resistors on the SDA and SCL
lines. Is that true for the BeagleBone?

I'm not sure anyone has tested the strength of the internal pullups yet.

3. I found a page (http://elinux.org/Interfacing_with_I2C_Devices)
that indicates that one of the I2C interfaces on the older boards were
disabled in the kernel driver due to the lack of pull-up resistors.
Is this why I don't see all three I2C buses on my BeagleBone, and will
the directions on that wiki for how to recompile my kernel to enable
those interfaces also work on the BeagleBone?

I2C2 is enabled on recent kernels, give http://dominion.thruhere.net/koen/angstrom/beaglebone/Angstrom-Cloud9-IDE-eglibc-ipk-v2011.12-core-beaglebone-2011.12.22.img.gz a try.

Thanks for any help. Is there a central wiki where BeagleBone-
specific user documentation should go? I'd be more than happy to
write-up a quick "How to use I2C peripherals on your BeagleBone" page
once I figure it out myself. :slight_smile:

Have a look at http://dominion.thruhere.net/koen/cms/using-the-beaglebone-as-a-weatherstation and http://dominion.thruhere.net/koen/angstrom/beaglebone/vcnl4000.sh . Both are pretty much my first attempts at using I2C so it might not be the best example.

The patches mentioned there are already integrated into the image I linked above.

regards,

Koen

Thanks for the info! I'm having some trouble with the 2011.12.22
image, though.

After copying it onto another MicroSD card and booting up the
BeagleBone, I see some blinkenlights like I would expect, but I don't
get any response on the serial terminal, and I can't get any response
from the USB-to-Ethernet device or from the regular ethernet device.
Just to check, I flipped back to the 2011.11.16 image I was using
before, and serial/ethernet communication on all channels works
again. I'm recopying the 2011.12.22 image to the SD card just to make
sure I didn't accidentally corrupt the image somehow.

Are there SHA1 or MD5 sums available for these files so I can be sure
I didn't truncate the download?

I've just installed your latest image and see /dev/i2c1 and i2c3. How
do these correspond to the pins on the BeagleBone?

When I scan i2c1 I get:

root@beaglebone:~# i2cdetect -y -r 1
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Is this really i2c0 which is used internally?

I have connected a DS2482 on i2c1 (P9 pins 17, 18) with 4.7k pull-ups.
What do I need to do to access this device?

thanks,

Wayne

It's recommended to use i2c (pins 19 and 20) on the expansion port, since that's where the cape EEPROM will live. A recent bone kernel has that enabled.

Thanks for the updated image and the help. I now have access to the
device.

OK, I just wanted to report that using Koen's 2011.12.26 image I was
able to access my I2C magnetometer device using /dev/i2c-3 which maps
to pins 19 and 20 on P9, as mentioned elsewhere in this thread.
Interestingly, the driver reported timeouts accessing i2c-3 until I
added external 4.7kOhm pull-up resistors to the SDA and SDL lines,
then everything worked.

Unfortunately, I'm finding Angstrom too stripped down for my tastes
(can't get python-virtualenv to work, no search in less?!, opkg is
pretty weak compared to dpkg, etc...), so I'm now experimenting with
getting the BeagleBone working with Ubuntu 11.10 for ARM, following
the directions here:

http://elinux.org/BeagleBoardUbuntu#Oneiric_11.10

So far the distribution has booted up fine, but I lost i2c-3, so now I
need to pick through Koen's blog post and figure out how to apply his
patches to u-boot and the kernel in my Ubuntu image... :slight_smile:

OK, I just wanted to report that using Koen's 2011.12.26 image I was
able to access my I2C magnetometer device using /dev/i2c-3 which maps
to pins 19 and 20 on P9, as mentioned elsewhere in this thread.
Interestingly, the driver reported timeouts accessing i2c-3 until I
added external 4.7kOhm pull-up resistors to the SDA and SDL lines,
then everything worked.

Unfortunately, I'm finding Angstrom too stripped down for my tastes
(can't get python-virtualenv to work, no search in less?!, opkg is
pretty weak compared to dpkg, etc...), so I'm now experimenting with
getting the BeagleBone working with Ubuntu 11.10 for ARM, following
the directions here:

http://elinux.org/BeagleBoardUbuntu#Oneiric_11.10

So far the distribution has booted up fine, but I lost i2c-3, so now I
need to pick through Koen's blog post and figure out how to apply his
patches to u-boot and the kernel in my Ubuntu image... :slight_smile:

you can copy the uImage/modules from the working "angstrom" image to
the ubuntu image created by my scripts...

Regards,

Dpkg does dependency resolving nowadays?!??!

Hah, OK, I'm being sloppy in my terminology. I should say dpkg +
apt. :slight_smile: opkg is impressively compact, but Ubuntu runs great on the
BeagleBone, so I'd rather not mess with opkg.

Dear all,

I am new to BeagleBone. I, too, faced the issue of I2C and wishes to
use the Ubuntu.

I would like to check, how do we copy the uImage/modules from working
"angstrom" image to the ubuntu image.

Thanks

Kim Loon

Dear all,

I am new to BeagleBone. I, too, faced the issue of I2C and wishes to
use the Ubuntu.

I would like to check, how do we copy the uImage/modules from working
"angstrom" image to the ubuntu image.

You don't, just use angstrom