4
\$\begingroup\$

I've been working with i2c lately between a beaglebone and an Atmel 328P where the Atmel controls a number of devices under the direction of the beaglebone. In order to accomplish what I've done so far I have been using the Adafruit_I2C library for Python.

From what I understand about i2c (I have read numerous articles about the protocol) all the comms that happen between the start and stop conditions (not counting the control bits) is simply a 7 bit address and a number of 8 bit bytes for the payload. Nowhere have I ever seen anything about how long this payload can be. That is what I am specifically after.

Now in using the Adafruit library it makes a number of assumptions. Specifically, all of its functions are modelled around reading or writing values (usually 8 or 16 bits) into or out of registers (on the addressed chip). They also have a writeList() function, which presumably they intended to write to a number of consecutive registers.

Their writeList() function though can only handle a maximum of 32 bytes of data. I am wondering: is this a real limitation of i2c or is it an arbitrary limit set in their library?

\$\endgroup\$

2 Answers 2

8
\$\begingroup\$

This 32 byte limitation is not a real limitation of the I2C bus. It's just a software limitation in the library that you are using.

To give you an counter-example, there is an EEPROM chip with I2C interface, which has a 128 byte write buffer (24LC512). This EEPROM is not an exception, it's just one example.

As far as I know, I2C spec doesn't have the limit on the number of bytes after the address byte.

\$\endgroup\$
1
  • \$\begingroup\$ In particular, it's a limitation in the SMBus spec. adafruit_i2c relies on smbus2 which follows that spec. \$\endgroup\$
    – Joooeey
    Commented Jan 24 at 9:44
2
\$\begingroup\$

I have not read anywhere about a limit on the number of consecutive bytes that can be sent. The slave will simply ack after each byte that you send it until you send the stop bit.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.