3 Replies Latest reply on May 18, 2016 10:41 AM by JoMe_264151

    I2C Slave

      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

        • 1. Re: I2C Slave
          JoMe_264151

          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

          • 2. Re: I2C Slave

            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

            • 3. Re: I2C Slave
              JoMe_264151

              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