custom cape i2c bus

I managed to make my own cape (for two XBee modules). It works very well (even sending between the two modules and to the third one on the computer), but:

if I use node ./eeprom.js

I suspect that my cape is expected to be connected to the fourth (or third if you start counting at 0) i2c bus:

/sys/bus/i2c/drivers/at24/3-0057/eeprom instead of /sys/bus/i2c/drivers/at24/1-0057/eeprom

So should I fix that in my cape (my cape is default at /sys/bus/i2c/drivers/at24/1-0057 but can be configured to go from /sys/bus/i2c/drivers/at24/1-0054 … /sys/bus/i2c/drivers/at24/1-0057)

Apart from that, I managed to program the eeprom and get it working, but since it uses UART 2 and UART 5 I needed to change /boot/uboot/uEnv.txt to get that working (BBB Rev B so that is why I needed to change /boot/uboot/uEnv.txt instead of /media/BEAGLEBONE/uEnv.txt), but do I need to supply that with my final version somewhere or is it enough to put that in the manual?

Sincerely,
Johan

Hi !!

I’m facing problem with Custom I2C cape. It’s I/o Expander using NXP’s PCF8574T Expander chip. I’m unable to detect it. I tried every thing available on web. Can you help me ? please ?

Here is some output.

root@beaglebone:~# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux

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

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

I’m using Beaglebone Black Rev B.

Hope Listen form you soon.
Thanks.

What size pullup resistors are you using on the I2C bus?

Gerald

Hi,
Thanks for reply.

The pullup resistor which is using in I2C Bus is 10K with 3.3V.

Regards,
Prakash

I would take that down to 4.7k. Not sure that it will fix your issue, but a stronger pullup is generally required.

Gerald

So it appears you should expect to see a device between 0x20 through 0x27 from the datasheets. The device address is 00100000 when not shifted for the R/W bit. That corresponds to 0x20 as the base chip address and the A1,A2, and A3 pins can set up to 7 other address for the final three bits. I2C can be really confusing in how the addresses are specified in various datasheets. Linux reports the 7 bit address of devices it finds in hexadecimal.

I see your output shows devices at 0x20, 0x22, 0x26, and 0x28. That appears to be the correct hecxidecimal, 7-bit, addresses for the chips? Do you have 4 chips wired up?

Hi,

You are right. I have 4 PCA8574T I/o Expander chip.

Then it appears your cape is working and the chips are at least visible to the bus. You should be able to use the smbus system calls to talk to them. Might be able to do something with i2cget.