i2c (wire or TWI) transmission length limit of 32 bytes?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

i2c (wire or TWI) transmission length limit of 32 bytes?

Post by uberhund »

Is anyone aware of a limit on the number of characters one may send between two Arduinos using the I2C interface?

My Wire Send Master Arduino is only able to shove 32 bytes downstream to its Ardunio receiver slave per single transmission. The remaining bytes are truncated.

I really need at least 64 bytes per transmission, preferably 128. I suspect there's a governor somewhere.

Suggestions?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: i2c (wire or TWI) transmission length limit of 32 bytes?

Post by adafruit »

send in multiple calls?

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: i2c (wire or TWI) transmission length limit of 32 bytes?

Post by uberhund »

That might work, Ladyada, if time slices between interrupts permit.

Meanwhile, I found a #define in the Wire.h file with the eponymous name BUFFER_LENGTH set by default to 32. When BUFFER_LENGTH is set to 64, the characters sent are now truncated at the 65th character instead of the 33rd. Wire and Arduino still seem to work fine. Available time slices are so critical with Arduino, I'm not going to push my luck any further.

Code: Select all

#define BUFFER_LENGTH 64
originally set to 32, this seems to work when set to 64

Thanks for your input!

thisispete
 
Posts: 3
Joined: Wed Aug 01, 2012 8:32 pm

Re: i2c (wire or TWI) transmission length limit of 32 bytes?

Post by thisispete »

Looks like you need to set it in both : Wire.h and in utility/twi.h

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”