Go Down

Topic: I2C buffer limit (Read 2522 times) previous topic - next topic

Can someone edit the library reference page to make it clear that there's a hard-coded 32byte limit on I2C message sizes? I had to google around ambiguously before I found that info on a blog somewhere.

As an aside, would it be difficult to make the buffer size configurable? I imagine it's limited to save memory, but in this case I'd be happy to spare the memory to avoid having to write a multi-transaction wrapper to get my bytes through.

retrolefty

The " #define BUFFER_LENGTH 32 " is located in the Wire.h file in your arduino core folder. I'm sure you could edit it to a larger size to meet your requirements. Note that this is used twice, once for a rec buffer and once for a transmit buffer so go easy on size increase.

Lefty


PaulS

Quote
Note that this is used twice, once for a rec buffer and once for a transmit buffer so go easy on size increase.

Earlier this week, it was mentioned that there are some intermediate buffers, too, for a total of 5 buffers that size. Seems overkill to me, but I haven't looked at the code to see if it is true, and, if so, necessary.

wayneft


Quote
Note that this is used twice, once for a rec buffer and once for a transmit buffer so go easy on size increase.

Earlier this week, it was mentioned that there are some intermediate buffers, too, for a total of 5 buffers that size. Seems overkill to me, but I haven't looked at the code to see if it is true, and, if so, necessary.

The second one is in twi.h 
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

mem


The second one is in twi.h   


the buffers are defined in twi.c

Go Up