I2C through the GPIO

I want to integrate SparkFun's Real Time Clock (http://bit.ly/oFL) to
my BeagleBoard so it's time is always accurate. This module
communicates through I2C and I figured it'd make sense to connect this
through one of the GPIO lines.

Has anyone done I2C though the GPIO pins? Are there any good examples
or tutorials about how to do this? Can I use the default Angstrom demo
image?

Thanks.

Hi,

That's an excellent idea, I totally missed that. I'll go read the docs
now. Are there any good examples of people using I2C with the
BeagleBoard?

Where did the documentation go? All the links are now pointing to
http://beagleboard.org/static/BBSRM_latest.pdf which is just the
circuit diagrams. Last time I was sure those links were the full user
manual. Am I looking in the wrong place?

We are working on it.

Gerald

Go here. In fact, always go here.

http://beagleboard.org/hardware/design

erald

See this posting:

http://groups.google.com/group/beagleboard/msg/ae3b72e1cafa3243?

frank

Thank you, that helps. So once I get the device connected, do I use
"i2c-io" to interface with it in code? Also, can I use a simple
transistor at the level shifter? Connect the 1.8v pin to the base and
have 5v going through the collector/emitter?

I2C is a bidirectional signal. If you are only going in one direction, a transistor could be used.

Gerald

It’s not possible just doing I2C in one direction.

  1. The Slave device will have to acknowledge the data send by pulling the data line low after each send byte.

  2. Likewise it’s allowed to pull down the clock signal to force the master into a wait state in case it can’t process incoming data fast enough (that being said I have never seen this feature used in a real world implementation)

You therefore need a solution based on TXS0102 or similar. Similar to the on Beagle itself made for the EDID and DVI I2C connection…

The I2C specification can be found at: http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf

Best regards – Good luck

Søren

When I said one direction I was referring to the level translation versus bidirectional. Maybe not the best way to say it!

Using a FET you can have a 5V bus to 1.8V translation. It isn’t the best solution by far, but it can work. It may be easier to implement this on a breadboard as opposed to a SMT device. You can do a search on the web and find numerous examples of this techique.

Here is a link to such a circuit, although it is 3.3V to 5V. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225292345/8

Gerald

Great. I have the logic level shifter from SparkFun that I'll try on
it.

After I get that all setup do I "i2c-io" to interface with it in code?
Is there another/better way to interface with it?