i2c works?

Sorry if this is a duplicate append, but my first try didn’t seem to make it.

I have successfully connected from beagleboard userspace to a Gumstix robostix board over i2c. For hardware interconnect between the two boards, I had built a voltage level translation board, which used the NXP PCA9306. This was needed to level shift the 1.8 v beagleboard i2c to the 5.0 v i2c on the robostix. On the beagleboard I connected to the i2c-2 pins on the expansion connector (pin 1 for 1.8v, pin 23 for sdc, pin 24 for scl, pin 27 for ground). For the robostix board, I connected to the i2c on the UART header (pin 10 for ground, pin 14 for 5v, pin 12 for sda, pin 16 for scl). For software, on the begaleboard I used linux kernel 2.6.26-r64, with options CONFIG_I2C_OMAP and CONFIG_I2C2_OMAP_BEAGLE set to yes. For beagleboard userspace code, I used i2cdetect (from i2c-tools-3.0.1) and i2c-io (from gumstix-robostix utilities). The robostix board was running code that understood the api for the i2c-io program. Here is the output:

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

root@beagleboard:~# i2c-io --dev /dev/i2c-2 0xb readreg 0
0x02

regards,
frank

I have successfully connected from beagleboard userspace to a Gumstix

robostix board over i2c.

Is the OMAP set up as bus master? Does the I2C driver support the OMAP as
bus slave? Our CTO tells me that bus slave mode isn't supported under ARM
Linux so I should not design in the OMAP as an I2C slave for low speed
message passing from a front end processor.

Which begs the question, how do the dual I2C links (power and control)
between the OMAP and TWL4030/TPS65950 work under Linux? Does the I2C driver
handle all the messages, especially when powering down individual domains on
the support chip (and where do the power management messages come from,
somewhere in the kernel)?

The programmers tell me all the power management magically happens in the
background, so their only task is turn the LCD backlight on and off. I am
not so sure the kernel has enough information to manage all those power
domains without some extensive knowledge of the application.
  Jack Peacock

> I have successfully connected from beagleboard userspace to a Gumstix

robostix board over i2c.

Is the OMAP set up as bus master?

In my setup, the OMAP is the master and the Robostix board is the
slave.

Does the I2C driver support the OMAP as
bus slave? Our CTO tells me that bus slave mode isn't supported under ARM
Linux so I should not design in the OMAP as an I2C slave for low speed
message passing from a front end processor.

I don't see support for slave mode in the OMAP i2C driver. However,
the PXA CPU's (ARM processors) do have a configurable kernel option to
support slave mode communication, so slave mode support is processor
dependent and not architecture dependent.

Which begs the question, how do the dual I2C links (power and control)
between the OMAP and TWL4030/TPS65950 work under Linux? Does the I2C driver
handle all the messages, especially when powering down individual domains on
the support chip (and where do the power management messages come from,
somewhere in the kernel)?

Someone who knows the drivers for those chips will have to answer
those questions.

frank agius

Hi ftagius:

Did you use the Expansion connect as your I2C interface?

How did you setup it.

Can you give me a example?

Thanks

Hi ftagius:

Did you use the Expansion connect as your I2C interface?

Yes, I used the expansion connector on the Beagleboard to access the
second i2c bus (i2c-2)

How did you setup it.

I had built a voltage level translation board, which used the NXP
PCA9306. The circuit is the same as show in Figure 9, page 9 of the
PCA9306 datasheet (http://www.nxp.com/acrobat_download/datasheets/
PCA9306_3.pdf).
On the beagleboard I connected to the i2c-2 pins on the expansion
connector (pin 1 for 1.8v, pin 23 for sdc, pin 24 for scl, pin 27 for
ground). For the robostix board, I connected to the i2c on the UART
header (pin 10 for ground, pin 14 for 5v, pin 12 for sda, pin 16 for
scl).

Can you give me a example?

An example of what?

frank agius

Sorry if this is a duplicate append, but my first try didn’t seem to make it.

I have successfully connected from beagleboard userspace to a Gumstix robostix board over i2c. For hardware interconnect between the two boards, I had built a voltage level translation board, which used the NXP PCA9306. This was needed to level shift the 1.8 v beagleboard i2c to the 5.0 v i2c on the robostix. On the beagleboard I connected to the i2c-2 pins on the expansion connector (pin 1 for 1.8v, pin 23 for sdc, pin 24 for scl, pin 27 for ground). For the robostix board, I connected to the i2c on the UART header (pin 10 for ground, pin 14 for 5v, pin 12 for sda, pin 16 for scl). For software, on the begaleboard I used linux kernel 2.6.26-r64, with options CONFIG_I2C_OMAP and CONFIG_I2C2_OMAP_BEAGLE set to yes. For beagleboard userspace code, I used i2cdetect (from i2c-tools-3.0.1) and i2c-io (from gumstix-robostix utilities). The robostix board was running code that understood the api for the i2c-io program. Here is the output:

Hi,

When attempting to recreate this (using linux-omap2, 2.6.26-r64) I get the following error printed to the console

i2c_omap i2c_omap.2: controller timed out

I suspect this might have something to do with not setting the pin mux for the expansion header correctly. Do you have to do anything else, like explicitly set the pin mux to something?

According to http://www.hy-research.com/omap3_pinmux.html I might need to call omap_cfg_reg with something like

AF15_34XX_I2C2_SCL,
AE15_34XX_I2C2_SDA,

But this is unusual if you did not have to do this. Alternatively, what version of UBoot are you running, as it may also be involved in setting the pin mux to an initial state.

Regards

John

Hi,

When attempting to recreate this (using linux-omap2, 2.6.26-r64) I get the
following error printed to the console

i2c_omap i2c_omap.2: controller timed out

I suspect this might have something to do with not setting the pin mux for
the expansion header correctly. Do you have to do anything else, like
explicitly set the pin mux to something?

John,

If you enable I2C2_OMAP_BEAGLE, you need to connect something that has
pullups to the i2c2 pins or you will get timeout messages. From the
help for kernel config I2C2_OMAP_BEAGLE:

Say Y here if you want to enable I2C bus 2 at OMAP3 based
BeagleBoard. I2C2 at BeagleBoard is connected to expansion
connector, i.e. unused
if nothing is connected to this connector. As internal OMAP3 pull up
resistors are not strong enough, enabled but unused I2C2 bus results
in error messages (e.g. I2C timeouts). Enable this only if you have
something connected to I2C2 at board's expansion connector and this
extension has additional pull up resistors for I2C2 bus.

frank agius

Hi,

When attempting to recreate this (using linux-omap2, 2.6.26-r64) I get the
following error printed to the console

i2c_omap i2c_omap.2: controller timed out

I suspect this might have something to do with not setting the pin mux for
the expansion header correctly. Do you have to do anything else, like
explicitly set the pin mux to something?

John,

If you enable I2C2_OMAP_BEAGLE, you need to connect something that has
pullups to the i2c2 pins or you will get timeout messages. From the
help for kernel config I2C2_OMAP_BEAGLE:

Say Y here if you want to enable I2C bus 2 at OMAP3 based
BeagleBoard. I2C2 at BeagleBoard is connected to expansion
connector, i.e. unused
if nothing is connected to this connector. As internal OMAP3 pull up
resistors are not strong enough, enabled but unused I2C2 bus results
in error messages (e.g. I2C timeouts). Enable this only if you have
something connected to I2C2 at board’s expansion connector and this
extension has additional pull up resistors for I2C2 bus.

Yeah, I got it working now.

Thanks