Question about using I2C multimaster slave

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

cross mob
RuPi_283656
Level 4
Level 4
10 sign-ins First solution authored 25 replies posted

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

0 Likes
5 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi user_288547314​,

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

Regards,
Bragadeesh
0 Likes

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

0 Likes

Hi user_288547314​,

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

Regards,
Bragadeesh
0 Likes

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

0 Likes

Hi user_288547314​,

Can you please share the project file?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes