I2C RAM and 32 bit data values

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

cross mob
Anonymous
Not applicable
        Hi, I’m using the Ezi2cDesign example that creates RAM that other devices can access through I2C. It appears that I2C supports sizes of both 8 bit and 16 bit data values. I’d like to store 32 bit values. Is there a way to do this without breaking it into two “chunks” ? I realize the other devices that read the values need to read 8 bit or 16 bit values. Just wonder if the PSoC can write to the RAM in 32 bit values. I’d like to make storing 32 bit values the least expensive as possible. I haven’t decided on a processor so if there is a PSoC that handles this better or if there is way to do this better, I’m open . . . Cheers !   
0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The I2C bus is a byte-wide serial transmition, so all transfers have to be made in byte chunks. Nevertheless I2C allows for transmitting (nearly) unlimited streams of data. There will be no performance loss when transmitting larger amounts of data.

   

When interchanging data between different CPUs you have to observe the chapter "Handling endianess" in the datasheet.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There is a buffer write API. So you could have an array or a structure,

   

both of which you know their length, and R/W them at will using buffer

   

write f(). Structure has advantage of mixed variable types.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable
        Bob, Dana, That save me time to finally sort this out. Thank you, both !   
0 Likes