Multiple PIC talking to same I2C device


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No, Label won't work.

    I2C relies on the Master (PIC) generating a clock. You can't have two Masters because firstly the bus would have to be multiplexed between the Masters, but secondly, one would interfere with the other should they use the bus at the same time.

    Options...

    1. One was was already mentioned. Use a third line between the PICs to indicate the bus is in use.

    2. Dedicate one PIC as the I2C bus server, and on request it will fetch whatever data the other PIC requires.

    3. Synchronise a clock between PICs... (say 10Hz...), PIC-A is only allowed to use the bus commencing on a clock leading edge, PIC-B is only allowed to use the bus commencing on the falling edge. Here with this example, all bus transactions must be completed within say a 45mS slot.

    Checking the bus for traffic is not a good way to go, because there are many instances where a pause in mid-transfer (eg a 10mS wait following an EEPROM Write) could be construed as the bus being free.

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Thumbs up I2C-Bus can be a Multi-Master bus

    The 18F MSSP has a "Multi-Master" mode for the I2C bus. I've never used it, only know about it from the 18F4620 datasheet and spending a lot of time reading the Phillips I2C Bus Spec Sheet a while back.

    It might be worth doing some study. I could be easier to implement than we first realize, especially with 2 PIC in the same basic family (18F).

    HTH,
    Steve

    EDIT: Here is a new link for I2C Specifications. There is a link to a new .pdf file for the bus specs.
    Last edited by SteveB; - 7th October 2007 at 06:42. Reason: Added New Link

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. Watchdog Timers
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th August 2014, 18:03
  3. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  4. PIC 16F877 I2C communications
    By sigmoideng in forum General
    Replies: 7
    Last Post: - 13th July 2007, 10:28
  5. Pic as an i2c slave
    By Robert Soubie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th January 2007, 21:11

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts