Microchip
直播中

张婧怡

7年用户 201经验值
私信 关注
[问答]

I2C Master到Master通信可能吗?

嗨,我有一个项目,一个PIC24FJ256GB210是一个I2C主控器,一个PIC16F18326,一个I2C从机和一个I2C EEPROM。所以,在特殊情况下,必须有可能PIC16给PIC24一个“中断”,他有一个重要的消息为PIC24。有没有这样做的方式没有轮询从PIC24?I2C主机可以检测到另一个主控器启动了一个带有起始位的消息吗?谢谢!

以上来自于百度翻译


      以下为原文

    Hi,

i have a project where a PIC24FJ256GB210 is an I2C Master, a PIC16F18326 an I2C Slave and an I2C EEPROM.

So, in special circumstances it must be possible that the PIC16 gives the PIC24 an "Interrupt" that he has an important message for the PIC24.

Is there a way to do this without polling from the PIC24?
Can an I2C Master detect that another master initiated a message with a start bit?

Thanks!

回帖(11)

张娜

2018-12-27 16:11:25
我用这种方法做了类似的事情:使I2C时钟引脚在需要时注意改变,它在CKKY上发送一个小脉冲,然后由主机执行标准I2C操作,最后回到软件中使用I2C的“中断模式”(BIT BAN),因此APPACH有点容易实现,但也应该与I2C硬件一起工作。

以上来自于百度翻译


      以下为原文

    I did something similar using this method:
 

  • enable I2C clock pin as interrupt-on-change
  • when slave needs attention, it sends a little pulse on CLK
  • then standard I2C operation is carried out by the master, and at the end it reverts to the "interrupt-mode"
 
I was using I2C in software (bit bang) so this approach was a little bit easier to implement, but should work with I2C hardware too.
举报

贺若龙

2018-12-27 16:30:02
嗨,达里奥,这是一个很好的借口,我来测试一下!谢谢!

以上来自于百度翻译


      以下为原文

    Hi Dario,
 
this is a good aproach.
I will test it! 
Thanks!
 
 
举报

贺若龙

2018-12-27 16:39:44
嗨,不幸的是,主I2C必须被禁用以获得CN中断。如果从主站保持SCK线路低而主通信,主机会检测到总线通信吗?

以上来自于百度翻译


      以下为原文

    Hi, unfortunately the Master I2C must be disabled to get the CN interrupt.
Will the Master detect a bus collosion if the slave holds the sck line low while the master communicate?
举报

王焕树

2018-12-27 16:45:23
I2C支持多个主控器。只要参考I2C规范的“多主”部分。

以上来自于百度翻译


      以下为原文

    I2C does support multiple masters. Just refer to the "multi-master" sections of the I2C specification.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分