8:57 pm
September 24, 2015
Using the I2C Master/Slave examples I’m seeing problems when the message length goes over 32 characters (code mod to add characters to the message attached). The first thing to get ‘lost’ is the LF, so the received serial monitor messages start overwriting.
Is there a limitation (Arduino, compiler, or otherwise) I don’t know about, or something more basic?
3:17 am
March 12, 2015
Yes, there is a 32 byte limit on I2C transactions. This is a limitation of the Arduino Wire library. You could increase the buffer size by changing the following:
1) In Arduino\hardware\arduino\avr\libraries\Wire\Wire.h increase the size in the following line:
#define BUFFER_LENGTH 32
2) In Arduino\hardware\arduino\avr\libraries\Wire\utility\twi.h increase the size in the following line:
#define TWI_BUFFER_LENGTH 32
Here is some additional info:
http://forum.arduino.cc/index......ic=54439.0
Keep in mind this is modifiying the original Arduino library and an upgrade of the Arduino IDE would revert these changes. It would be advisable to limit transactions to less than the 32 byte buffer size if possible.
24
1 Guest(s)