I2C Slave

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

cross mob
Anonymous
Not applicable

Hi,

   

I am implementing an I2C slave.  I have used other slaves where the master would send the device address, a memory address, and then read bytes.  The bytes read would be from the address sent onwards. 

   

Is this possible with the SCB I2C slave?  Looking at the manual it seems like the slave can simply be read from the memory address zero (first element in an array) and as many bytes as the master reads. 

   

Is this correct?

   

 

   

Thanks

   

 

   

Rich

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

buffer address or position could be directly addressed by the master  No, you have to wait for a master address write, then set up (or fill) the master read buffer and let the master do the read.

   

 

   

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The slave maintains two buffers: one where the writes from master go to (ie the memory address you mention) and one where the master reads from. So a fast reaction to setup the transfer buffers accordingly is required.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob,

   

I can see how setting up the buffers fast is important.  My question was whether a buffer address or position could be directly addressed by the master.  It doesn't look like it.  Perhaps by writing custom slave API functions?

   

 

   

Rich

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

buffer address or position could be directly addressed by the master  No, you have to wait for a master address write, then set up (or fill) the master read buffer and let the master do the read.

   

 

   

Bob

0 Likes