From: Dave H. <dhy...@gm...> - 2006-06-24 21:39:43
|
HI Mark, > I've been looking into the I2c communication and it seems to me that I can > probably write my own little I2c communication program, so I had a couple of > questions. > > On the robostix side I2c communication is fasilitated by TWI. TWI seems to > have its own protocal, so if I issued a command by using something like > > char buf[1]; > buf[0] = 0x01; > write(i2c-bus,buf,1); > > What triggers would i expect to see through the TWI interface. Would I have > to standardize my writes to the i2c driver with the TWI interface? If only it were that simple. See the datasheet. There's a big state machine you need to run. It is possible to simplify the i2c stuff if you opt to not use interrupts and ignore lots of error conditions. I've written a fully-interrupt driven slave code for the robostix which you're free to use. There is also gumstix side code written as well. There is also a bunch of AVR related code (including i2c master and slave code) over here: http://hubbard.engr.scu.edu/avr/avrlib/index.html -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |