Does I2CREAD/I2CWRITE check for bus status?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2009
    Posts
    5

    Default Does I2CREAD/I2CWRITE check for bus status?

    Hello again, this is for the more versed in PBP, is there a way to check the bus status in I2C in order to avoid collisions? I can't find more docs about this issue.

    Best regards

    E.T.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    No, I2CREAD/WRITE are intended to be used as the only Master on the bus.

    You could have another line between the masters with a pull-up resistor.
    Whenever one of the chips is going to access the bus ... pull that line low to tell the other chip the bus is busy.

    Check that line before accessing the bus, pull it low for a short period, then release it and check again. If it goes high, pull it low again and go ahead and access the bus. Just in case they both try to do it at the same time.

    hth,
    DT

  3. #3
    Join Date
    Oct 2009
    Posts
    5

    Default

    Quote Originally Posted by Darrel Taylor View Post
    No, I2CREAD/WRITE are intended to be used as the only Master on the bus.

    You could have another line between the masters with a pull-up resistor.
    Whenever one of the chips is going to access the bus ... pull that line low to tell the other chip the bus is busy.

    Check that line before accessing the bus, pull it low for a short period, then release it and check again. If it goes high, pull it low again and go ahead and access the bus. Just in case they both try to do it at the same time.

    hth,
    Got it, I'll give it a try. Thanks a lot.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Hope it works for you.

    Just want to thwart one potential problem ...

    NEVER take that line HIGH!
    Only use the LOW and INPUT statements on that pin.

    A small resistor (220 ohms) in between the two PICs can protect against the accidental possibility.

    hth,
    Last edited by Darrel Taylor; - 16th October 2009 at 04:45. Reason: Smaller resistor
    DT

  5. #5
    Join Date
    Oct 2009
    Posts
    5

    Thumbs up

    Quote Originally Posted by Darrel Taylor View Post
    Hope it works for you.

    Just want to thwart one potential problem ...

    NEVER take that line HIGH!
    Only use the LOW and INPUT statements on that pin.

    A small resistor (220 ohms) in between the two PICs can protect against the accidental possibility.

    hth,

    Just in time! thanks again.

    E.T.

Similar Threads

  1. AT/PS2 Keybord - PIC Interface?
    By Kamikaze47 in forum Code Examples
    Replies: 73
    Last Post: - 9th August 2009, 16:10
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. Problem with 16f88 steep motor control
    By ken_23 in forum Off Topic
    Replies: 0
    Last Post: - 4th July 2008, 12:25
  4. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  5. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43

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