Does I2C write have length limitation? (How about size > 16B)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

HW: 20737.

SW: SDK2.1

Problem: Use I2C driver API,

cfa_bsc_OpExtended(buffer, length, NULL, 0, slave_address,I2C_SLAVE_OPERATION_WRITE);

where if the length > 16B, like length = 32B, from I2C monitor,
the write action will only take 16B into I2C bus.

Symptom:

I try to make a I2C write to one device component;

size = 33B

40 43 33 00 10 68 1C 6B 09 79 0C 80 00 C8 00 32 00 14 03 E8 01 00 C8 10 04 00 0A 10 5E FF CE FF CE

after calling I2C API,

the data is truncated into 2 section and plz see the attached snapshot.

Is any place to configure the I2C max. size?

0 Likes
1 Solution
Anonymous
Not applicable

As datasheet of BCM20737 described, it has 16 bytes of buffer for each tx and rx.

To write data more than 16 bytes, we need to use separated data within 16bytes length.

View solution in original post

3 Replies
Anonymous
Not applicable

As datasheet of BCM20737 described, it has 16 bytes of buffer for each tx and rx.

To write data more than 16 bytes, we need to use separated data within 16bytes length.

Anonymous
Not applicable

Dear dmiya,

thx,

however, if bus protocol of the slave device forms as
1Byte command + length of data(>16B)
dont know if we seperate the data, the device can recognize the action or not.

if data size = 30B

like,

i2c write with 1Byte command + 15B data
and


i2c write1Byte command(same as above command) + 15B

or
i2c write with 15B data

which one is correct?

0 Likes

This really depends on the the I2C slave device. Most devices will allow the write to be broken up into smaller chunks. If the slave does not support this, you may want to try bit-banging the data.