milan.rajik
Banned
Hi
This is a different project compared to the other two i2C projects of which I asked questions. So, I am posting this in a separate thread.
The earlier two were I2C Master-Slave communication but this is I2C Multi master Communication.
I have a problem. In the project Master-Slave1 is named as master and Master-Slave2 is named as slave.
I am testing in both Proteus and hardware. For hardware I am using two EasyPIC v7 development boards with Saleae Logic Analyzer and on both I am getting the same signals.
So, the problem is in the code. See the image. You can see that
Master-Slave1 is successfully sending data to Master-Slave2 and then
Master-Slave2 is successfully sending data to Master-Slave1
the problem happens after this.
After this, Master-Slave2 to Master-Slave1 communication happens good but Master-Slave1 to Master-Slave2 communication doesn't happen properly. See the question marks in the i2C debugger data.
I think the problem is in setting the I2C lines as outputs for master mode and inputs for slave mode.
broken link removed
- - - Updated - - -
Edit:
My guess was right. I should not configure TRISC as output while acting as master. The
will take care of the I2C pins tris settings.
Now the I2C Multi-Master project is working fine in both Proteus and hardware.
broken link removed
This is a different project compared to the other two i2C projects of which I asked questions. So, I am posting this in a separate thread.
The earlier two were I2C Master-Slave communication but this is I2C Multi master Communication.
I have a problem. In the project Master-Slave1 is named as master and Master-Slave2 is named as slave.
I am testing in both Proteus and hardware. For hardware I am using two EasyPIC v7 development boards with Saleae Logic Analyzer and on both I am getting the same signals.
So, the problem is in the code. See the image. You can see that
Master-Slave1 is successfully sending data to Master-Slave2 and then
Master-Slave2 is successfully sending data to Master-Slave1
the problem happens after this.
After this, Master-Slave2 to Master-Slave1 communication happens good but Master-Slave1 to Master-Slave2 communication doesn't happen properly. See the question marks in the i2C debugger data.
I think the problem is in setting the I2C lines as outputs for master mode and inputs for slave mode.
broken link removed
- - - Updated - - -
Edit:
My guess was right. I should not configure TRISC as output while acting as master. The
Code:
I2C1_Init(100000);
Now the I2C Multi-Master project is working fine in both Proteus and hardware.
broken link removed
Attachments
Last edited by a moderator: