Has any one using a Beaglebone or Beaglebone Black (Debian) successfully used both the # 1 buss pins 19 & 20 as well as any other buss & pin combination?
Please advise me as to how to get the second (other) buss functioning.
Have been testing using I2c detect - r (x) and an Adafruit BMP180 breakout.
No problem with # 1
$ sudo i2cdetect -l 0
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
$ sudo i2cdetect -r 1
[sudo] password for michael:
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- UU
$ sudo i2cdetect -r 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Unable to succeed on pins 17 & 18 or pins 21 & 22 using the original Beaglebone
I would really appreciate any assistance.
michael
i2c Two Operating
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: i2c Two Operating
So, the BMP180 doesn't show up on either bus?
- maxelrad
- Posts: 5
- Joined: Thu Aug 07, 2014 4:44 pm
Re: i2c Two Operating
It does show on buss 1 - note the UU at address 77 on the map
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: i2c Two Operating
Have a look at this blog post:
http://datko.net/2013/11/03/bbb_i2c/
http://datko.net/2013/11/03/bbb_i2c/
- maxelrad
- Posts: 5
- Joined: Thu Aug 07, 2014 4:44 pm
Re: i2c Two Operating
Thanks for your interest - I had researched that post and Derek Malloy's posts/youtube. My feeling is that this is a pin mux / device tree issue. I have not been able to find any documentation (understandable by me) that would allow me to assign pins to the i2c busses. Please give me any further thoughts you may have. Thanks.again.
michael
michael
- jstampfl
- Posts: 25
- Joined: Mon Sep 17, 2012 2:15 am
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: i2c Two Operating
Unfortunately the device tree is still kind of new and growing, so there's not a ton of good info on using it yet. However here's the source for a device tree overlay that looks like it should enable the I2C bus on pins 17 and 18: https://github.com/beagleboard/devicetr ... 1-00A0.dts Notice this section that defines which pins and hardware will be used:
To load this device tree overlay you can manually do it by executing:
echo BB-I2C1 > /sys/devices/bone_capemgr.*/slots
You can see that it (and other overlays) are loaded by running:
cat /sys/devices/bone_capemgr.*/slots
Try running the command above to load the overlay, then run something like this to list all the I2C devices:
ls /dev/i2c*
After the device tree overlay is loaded you should hopefully see a new device listed using that command. Give it a shot and let me know if you see any issues.
Code: Select all
/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P9.18", /* i2c1_sda */
"P9.17", /* i2c1_scl */
/* the hardware ip uses */
"i2c1";
echo BB-I2C1 > /sys/devices/bone_capemgr.*/slots
You can see that it (and other overlays) are loaded by running:
cat /sys/devices/bone_capemgr.*/slots
Try running the command above to load the overlay, then run something like this to list all the I2C devices:
ls /dev/i2c*
After the device tree overlay is loaded you should hopefully see a new device listed using that command. Give it a shot and let me know if you see any issues.
- maxelrad
- Posts: 5
- Joined: Thu Aug 07, 2014 4:44 pm
Re: i2c Two Operating
Thanks for your help! This is the command line transcript...
root@beaglebone:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
root@beaglebone:~# echo BB-I2C1 > /sys/devices/bone_capemgr.8/slots
root@beaglebone:~# cat /sys/devices/bone_capemgr.8/slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-I2C1
root@beaglebone:~# ls /dev/i2c
ls: cannot access /dev/i2c: No such file or directory
root@beaglebone:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
root@beaglebone:~#
I added your suggested line to the simpletest.py program and moved the connection to pins 17-18:
sensor = BMP085.BMP085(busnum=2)
It works fine - both I2c 1 & I2c 2 are available.
Thanks for your capable assistance.
michael
root@beaglebone:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
root@beaglebone:~# echo BB-I2C1 > /sys/devices/bone_capemgr.8/slots
root@beaglebone:~# cat /sys/devices/bone_capemgr.8/slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-I2C1
root@beaglebone:~# ls /dev/i2c
ls: cannot access /dev/i2c: No such file or directory
root@beaglebone:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
root@beaglebone:~#
I added your suggested line to the simpletest.py program and moved the connection to pins 17-18:
sensor = BMP085.BMP085(busnum=2)
It works fine - both I2c 1 & I2c 2 are available.
Thanks for your capable assistance.
michael
Please be positive and constructive with your questions and comments.