5 Replies Latest reply on Apr 15, 2019 10:42 PM by BragadeeshV_41

    Question about using I2C multimaster slave

    RuPi_283656

      I just tried the multi-master slave operation for the first time and have two errors that I don't understand.

       

      First I tried to use the high level master command I2C_MasterWriteBuf.  I used the mode constant I2C_MODE_COMPLETE_XFER, but the compiler does not know what that is.  Guessing, I used a value of zero and it compiled but did not work.

       

      So I switched to using a start, send the two bytes individually, and stop commands.  But I get a surprising error from the start command.  Error 5, which appears to be "I2C_MSTR_ERR_ABORT_START_GEN", although the compiler also did not know what that constant is.  But it means "Start condition generation was aborted because of the start of slave operation.".  The address I am using in the start command is not the address of the slave shared slave. It is the address of a separate hardware device, so I don't understand why a PSOC slave operation would be started.

       

      I'm using PSOC Creator 4.2 with version 3.50 I2C Master (fixed), with a POoC 5 32LP processor.

       

      Any help?

       

      Thanks, Russ

        • 1. Re: Question about using I2C multimaster slave
          BragadeeshV_41

          Hi RuPi_283656,

           

          Could you please let me know the following:

           

          1. What is the slave address of the Multi-Master Slave component and the slave address of the device you are trying to address?

          2. Can you try the UDB implementation and see if this issue persists?

          3. I'm able to get all the mode constants. Can you try to clean and build your project once again?

          4. Can you please share your project file so that we can try to reproduce your issue from our side?

           

          Regards,

          Bragadeesh

          • 2. Re: Question about using I2C multimaster slave
            RuPi_283656

            Thanks for responding Bragadeesh.  I did do a clean and rebuild but the compiler still reports that  I2C_MODE_COMPLETE_XFER is undefined.

             

            However I have moved past this problem.  I am using the lower level API calls now and the master-slave is working ok as far as I have been able to test.  I have to get some hardware changes done before I can test everything.

             

            But now I have a new issue.  The I2C bus has 2 masters on it, the PSoC 5, and a PIC processor.  Both masters are set for multi-master mode.  Now I have never used a multi-master setup before so maybe it does not work like I expect but I have not found any documentation to show otherwise.  What I expected is that both masters would be able to access the bus at about the same time, and the one that tried second would detect a collision and wait to try later  (or report the collision and then allow me to program a retry).  But what is actually happening is that when both masters attempt to communicate at once, the PSoC 5 locks up the I2C bus by holding the SCL line low.  Nothing will work then until reboot.

             

            Both masters have no problem communicating on the bus with the various slaves until they both try at once.

             

            So I wonder what am I doing wrong....

             

            Thanks, Russ

            • 3. Re: Question about using I2C multimaster slave
              BragadeeshV_41

              Hi RuPi_283656,

               

              Could you please share your project file focusing on the issue so that we will try to investigate this issue further from our end?

               

              Regards,

              Bragadeesh

              • 4. Re: Question about using I2C multimaster slave
                RuPi_283656

                That will take some time.  I cannot send the project due to security issues.  I must put together a test project to demonstrate the problem, and of course that is a good idea anyway.  But I am buried in other work right now and so it may be a week before I can get to it.

                 

                Thanks, Russ

                • 5. Re: Question about using I2C multimaster slave
                  BragadeeshV_41

                  Hi RuPi_283656,

                   

                  Can you please share the project file?

                   

                  Regards,

                  Bragadeesh