Home > Mobile >  how can i put more than 64 bytes in one program command via i2c?
how can i put more than 64 bytes in one program command via i2c?

Time:03-03

i am trying to build a program which can program other board using IIc.

problem is, i need to send like ten thousands of bytes which will going to need more than hundreds of program command. will there be any ways to not to make hundreds of program command..?

CodePudding user response:

There is no inherent limit to the data size on the i2c bus but you will be limited by the library you are using and/or the hardware that is used. There might also be an overlaying protocol on the i2c bus that limits the data size per message.

There is too little information in this question to give a better answer. Can you please list what HW you are using and what libraries.

Generally it's better/easier to send the data in some sort of chunks where the size is a tradeoff between time to transfer and how easy it is to handle. You will want to have checksums on your data packets to make sure the transfer was successful. Then it better to realize early that something went wrong and not realize when all the data has been transferred that everything need to be sent again because the first byte was corrupt.

  •  Tags:  
  • c i2c
  • Related