Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Bug with TWI/i2c and Atmega168 on: February 22, 2009, 01:40:17 pm
I am also having a problem with the TWI library.
I added debug lines to the library and found that it freezes of the line:
uint8_t read = twi_readFrom(address, rxBuffer, quantity);
in Wire.cpp

It is probably because I am running the Atmega168 at 20mhz instead of 16mhz but changing CPU_FREQ to 20000000L does not fix the problem (I have the Arduino build environment set to 20mhz and everything else works fine).

Is there anywhere else I should look to fix the problem?
2  Forum 2005-2010 (read only) / Interfacing / Re: Faster i2c? on: January 25, 2010, 07:53:57 pm
In my setup routine I configure the chip for 45Hz but when I time a 1000x loop of reading from the device the rate is only about 7Hz.
3  Forum 2005-2010 (read only) / Interfacing / Faster i2c? on: January 24, 2010, 06:59:04 pm
I am trying to read data off of a AD7747 capacitance sensor at 45Hz but with the Wire library I get a refresh rate of just under 7Hz. I increased the i2c speed from 100KHz to 400KHz without much of a speed gain and also tried using the i2c library from avrlib, but I get undefined reference errors even though it is included and compiles. Is there any way to speed up the Wire library or get the avrlib i2c library to work?
Pages: [1]