Two pics in a I2C bus?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    23

    Default Two pics in a I2C bus?

    Hi,
    is it possible to have two pic16f628 reading and writing a 24c08 memory on a I2C bus?

    I mean what kind of circuitry i'd need ,or a simple i2cwrite and i2cread on a simple I2C two-wires bus could do the job?

    Thanks
    roberto

    P.S.

    obviously any kind of schematics will be very appreciated.

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


    Did you find this post helpful? Yes | No

    Default

    You can connect multiple Masters (PICs) on an I2CBus as long as only ONE is allowed to use the bus at any one time. The others should have their I2C pins switched to INPUT when not in use. A third (common) line is required between the Masters to indicate that the bus is busy. Everything else you can do in PBC or PBP.

  3. #3
    Join Date
    Apr 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie for your prompt reply.

    You mean that i have to add a line between the PICs and (i.e.) rise it when a PIC is reading or writing on the bus ,so the other ( with input pins)must wait for the low line for accessing the bus ( the bus is free).Is it correct?

    And sorry but due to my poor english i cant understand well this sentence:

    "Everything else you can do in PBC or PBP."

    Do you mean that it's all i can do with picbasic?

    Thanks again
    roberto

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


    Did you find this post helpful? Yes | No

    Default

    Example Schematic appended...

    I have chosen the PIC port pins randomly, you can use whatever pins suit your design. All Resistors 4K7, all Capacitors 100n. There are three connections on our I2C bus now, SCL and SDA as per usual, and we have added SBS.

    I mean that you CAN do it all with PBC or PBP without difficulty. Use the third SBS (Busy) connection to indicate to the other PICS/Masters that the bus is busy and they should wait.
    Attached Images Attached Images  

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. Communicating between two PICs over DC bus
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2009, 12:57
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Compass module and I2C bus
    By vladimir059@hot in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th December 2006, 20:29

Members who have read this thread : 1

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