From: Dave H. <dhy...@gm...> - 2008-02-04 22:43:19
|
Hi Justin, > I've been trying to get i2c working between my basix 400xm-bt gumstix and > some atmega8 boards that I have designed. I've tested my atmega8s board > separately and I am confident that they communicate via i2c properly. I've > added the i2c modules to the gumstix and compiled and run the i2c-test > program and the SCL and SDA lines appear to probed correctly by that > program. So, I've moved forward an tried running the "Program for > interacting with I2C devices" found in the wiki: > http://docwiki.gumstix.org/I2c http://docwiki.gumstix.org/I2c and I get > this error: > > # ./i2c --count=9 0x34 readbyte 0 > ERROR: I2cTransfer: ioctl failed: Remote I/O error (121) > ERROR: I2cReadByte failed: -1 > > Now, I know for a fact that one problem is that I don't know what the i2c > address of the gumstix is so my atmega8 board is just sending to 0x30 by > default. Does anyone know how to find this out, and is there a way to > change it. I looked through the code and didn't see anywhere to set this > value, although I probably just missed it. Also does anyone know what else > the error I mentioned above could be caused by. Dave, I would greatly > appreciate you input if possible since I know you are the one who wrote the > i2c driver. So, the gumstix is the i2c master and the atmega would be the slave. A master doesn't have an address, only slaves do. Now it is theoretically possible to setup a multiple master scenario, but linux doesn't support that with the distributed drivers. There is some primitive slave support in the built-in drivers (if it's enabled). In this case the gumstix looks like an EEPROM at an address of 0x01. So the atmega would be able to read and write from this "virtual EEPROM". The i2c code that's used for the robostix will also work on an atmega8. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |