If you're using the '16, or just prefer to stick with the Fleury code, the MCP23016 datasheet (http://ww1.microchip.com/downloads/en/D ... 20090C.pdf) tells you how to read the chip's registers in section 1.9.3 (page 15). It looks like the master sends a 'read' command (a zero bit on the end of the address byte) then a byte that identifies the register it wants to read. The list of 'command bytes' is Table 1-3 (page 4), and according to that, you send the byte '0' to get GP0 and the byte '1' to get GP1.

When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

I made some evaluation boards fitting for MCP23016 therefore I would really like to go ahead with this IC.But when I've done with it I will definately try another project with the MCP23017. The 17' is much faster. :-)

At the moment I will go forward with the fleury library.

I thought the adafruit library for MCP23017 and the wire library is only for arduino.

I am using a breadboard with ATmega168 and do code in ANSI C.

But now to the center of my question.

I tried to understand the section you highlighted in the manual, but was not able to write a code.I think I could not interprete it the right way.

Maybe you can give me a code example according to the MCP23016, the fleury lib and my present code.

lnino wrote:I thought the adafruit library for MCP23017 and the wire library is only for arduino.

Not really. The Arduino library is basically a set of utility routines for ATmega168 programming, mostly written in C. I think the Wire library is written in C++ for the sake of modularity, but aside from that, it's just a set of wrappers around I2C operations.

lnino wrote:Maybe you can give me a code example according to the MCP23016, the fleury lib and my present code.

I didn't know the Fleury library existed until yesterday, but it would probably look something like this:

I was mistaken about the read process. You start by issuing a WRITE command and the address, then create the stop condition before sending any data. Then you issue a READ command and collect the data that's in the registers.

When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

Hi, I'm using 3 10pf caps in parallel (instead of 1 33pf) on the clock pin 9 to GND. I was wondering if you have any idea if this would work? Obviously I can't get it working, but I don't know if it has anything to do with the cap value.