I2C multimaster. Switching PIC between being a Master and a Slave.

Discussion in 'Embedded Systems and Microcontrollers' started by kender, Sep 4, 2008.

  1. kender

    Thread Starter Senior Member

    Jan 17, 2007

    Is it possible to switch between I2C Master and Slave modes during run time by writing to the SSPCON register?

    I will have two PICs in the system. One will handle the display, another one will control the process. When the process isn’t running, the display PIC should be the Master. When the process is running, the display PIC should display the parameters. But the problem is that I have a requirement from the guy, who developed the current version of the control PIC firmware, that the control PIC shouldn’t be interrupted for serial communication. I’m contemplating about making a multimaster bus, where the process control PIC is a Master, when the process is running, and the display PIC is a Master for the rest of the time. I’ll probably add a handshaking line too. Do you think that this is a good approach?

    - Nick

    P.S. Another option would be to replace I2C with CAN, which is a peer-to-peer bus to begin with. Unfortunaltely, it's too late to do it.