3 Replies Latest reply on Jan 13, 2012 3:30 AM by JoMe_264151

    i2c communication master and slave

              i received code from dtata sheet .to transmit data from master to slave and again receive data rom slave.   
      but when i trans mit data to slave . slave receive data.   
      but master have next instruction to check whether write is complete. there is while loop to check staus of write. and my master controller stuck in that loop.   
        • 1. Re: i2c communication master and slave
                  There is a mistake in the I2CHW code, which misses a pair of parentheses. The code to check if the write is complete is:   
             
          while(!(I2CHW_1_bReadI2CStatus() & I2CHW_WR_COMPLETE));   
             
          Check with this modified code and see if it works.   
          • 2. Re: i2c communication master and slave

            I am new user of PSOC 5,Trying example codes of Psoc creator.I am not getting O/P of EZI2C example.

               

            I have just connected P0(1) to sw1 and P1(2) to sw2, according to instruction.(Refer EZi2c Design Example)

               

            On LCD display the result shown as "sw1 to write","Sw2 to read",But if i press any switch its not reading or writing any data.

               

            Do i need to make any more connections?any changes has to be made in code?

               

            Thank you

            • 3. Re: i2c communication master and slave
              JoMe_264151

              It is always easier for us to check what you have done when you post your complete project here.

                 

              Do do so,

                 

              1st. Clean Project

                 

              2nd. Create minimal archive

                 

              3rd. Attach the archive to your post right here.

                 

               

                 

              We'll have a look at it.

                 

              Bob