From: SHI y. <shi...@gm...> - 2010-05-07 15:43:05
|
The error is input/output error. During the running of the program, the file "dev.i2c-3" could be opened, function "ioctl(fh, I2C_SLAVE, addr)" also works well. After printing out "=== Device 0x%02X Register Dump ===", it should start reading the register IOCON and it stuck here. In read_reg() function, the register i want to read must be written first, if not success, it will turn out error "write before read: input/output error". And then i used oscilloscope to measure the output of gumstix, and it turned out SDA and SCL are always 1.8v. Thx On Fri, May 7, 2010 at 6:10 PM, Dave Hylands <dhy...@gm...> wrote: > On Fri, May 7, 2010 at 6:08 AM, SHI yifei <shi...@gm...> wrote: > > Hello all: > > I tried to use gumstix to communicate with an I/O expander MCP23017 > through > > i2c. I found a demo from > > gitnub: http://github.com/scottellis/overo-mcp23017. > > I did the same thing as the instruction. I successed to open /dev/i2c-3 > and > > tried reading and writing to MCP23017 through i2c. However, nothing > happened > > on SDA and SCL. They are 1.8v always. > > What calls are you making? > > Did any of them return errors? If so what are the error codes? (i.e. > value of errno) > > -- > Dave Hylands > Shuswap, BC, Canada > http://www.DaveHylands.com/ > > > ------------------------------------------------------------------------------ > > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |