Go Down

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

bryanduxbury

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
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview