PSoC5LP More data transfer than uint8 of I2C(UDB)

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

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

We are sending data using MasterWriteBuf API of I2C.

Its API is defined below.

uint8 I2C_MasterWriteBuf(uint8 slaveAddress, uint8 * wrData, uint8 cnt, uint8 mode)

According to this API, since wrData is uint8, it is 256 pieces.

.

We would like to transmit more than 256 data.

Is it possible to realize it?

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Yes, you can modify the WriteBuf function to use uint16 type as argument for cnt. You might also need to modify the implementation of the function to support a higher number of bytes to be transmitted. It might also affect whatever protocol you are defining over I2C. For example, some requires to provide the size of the frame before transmitting the data.

View solution in original post

0 Likes
3 Replies
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

In general, you need to put a DMA into your PSOC fabric and point it to the I2C and have it transfer the bytes.

You have a hill to climb, it won't be easy, but it is worth it.

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Yes, you can modify the WriteBuf function to use uint16 type as argument for cnt. You might also need to modify the implementation of the function to support a higher number of bytes to be transmitted. It might also affect whatever protocol you are defining over I2C. For example, some requires to provide the size of the frame before transmitting the data.

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

I understand that it is useless just to change the API function to uint16 as it is.
We will consider a configuration using DMA.
Thank you.

0 Likes