Skip to content

Buffer size of the Wire library

Koepel edited this page Nov 2, 2018 · 4 revisions

The buffer size of the Wire library depends on which Wire library is used. The maximum number of possible bytes to transmit is often the same as the number of bytes that can be received. The I2C bus itself has no limit for the number of bytes. The limit is only by software.

Many libraries which are compatible with most Arduino boards use 32 bytes for the buffer size. That is the size for an Arduino Uno.

  • TinyWire libraries: 18 bytes, but not every TinyWire library is the same.
  • Arduino Uno, Mega 2560, Leonardo: 32 bytes.
  • Arduino Due, Zero, M0, MKR1000: 256 bytes (it was 64 bytes, but it became 256 bytes in 2018).
  • Some software implementations of the Wire library have no limit.