I started a thread in the Bugs & Suggestions forum about problems with the Wire library, but I think my followup questions are better suited here.
As a summary, I am unable to use the Wire library for communicating with an external EEPROM chip. Even when taking into account the 32-byte buffer of Wire (that isn't documented anywhere), the exact same code that works in a minimal sketch won't work in my full application. Either the memory is running out (which is hard to believe since according to avr-size the data+bss sections are 450 bytes, the Wire library allocates a further 160 bytes and my function nesting is only a few levels deep), or it somehow otherwise corrupts the data.
Therefore I'm searching for an alternative way of managing I2C communication. I found the i2cmaster interface at http://homepage.hispeed.ch/peterfleury/avr-software.html#libs , which seems like a simple library to use. However, I am unable to include the assembler file into my project.
I found the thread at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222355444/6 which suggested making a library out of it and manually compiling the assembler into the object file, but that does not help. The file is still not linked with the other application.
Is there some way of adding a file to an Arduino project to be linked in with it? Or is it possible to compile an Arduino project from the command line? Alternatively, can you recommend some other library that could be used for I2C communication? I'm new to AVR's so I don't want to get mixed up with the registers and code it from scratch.
Overall, it would be a huge improvement if the Arduino IDE would allow adding .c, .S and .o files to be linked into the project.
Thanks for any help!