I2C and multiple slave


Closed Thread
Results 1 to 7 of 7
  1. #1
    Zorglub's Avatar
    Zorglub Guest

    Question I2C and multiple slave

    Hi,

    I have multiple applications with the 16F87.
    I would like to connect all these applications together with the I2C bus with 1 master (16F877) and all the slaves (16F87).

    How can I address the slaves independently ?

    Best regards

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Zorglub,

    based on the information you have given the answer is:

    By simply assigning the slaves address in the I2CWRITE / I2CREAD command.

    Please see also THIS
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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


    Did you find this post helpful? Yes | No

    Default

    PICBasic only supports I2C Master mode for the Master PIC... you will have to write your own routines for the Slave Mode PICs.

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Mel,

    based on the information given one could assume he already has written the slave routines.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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


    Did you find this post helpful? Yes | No

    Default

    Well in that case addressing is the easiest part of all. Just assign some spare pins on the Slave PICs, ground some, and pull others up to V+ and they become the unique address for that PIC. That way, all your Slave PIC software remains the same, and when that PIC powers-up it determines it's own address. Thereafter, the Master just addresses the PICs as if they were standard I2C devices. Nothing could be simpler at that point.

  6. #6
    Zorglub's Avatar
    Zorglub Guest


    Did you find this post helpful? Yes | No

    Smile

    Thank you,

    Is the following another solution ? in the datasheet 16F87 :

    Register SSPSR and SSPADD for chip addressing ????

    Best regards

  7. #7
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi!

    Maybe these links will help you.
    (Search with Google for more).

    Microchip Application Note AN734:
    Using the PICmicro SSP for Slave I2C Communication
    http://www.microchip.com/stellent/id...pnote=en011798

    Picbasic Pro project for Slave I2C Communication:
    http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm
    (See Microchip application note AN734 has errors).


    Luciano

Similar Threads

  1. 4 bit address decoding I2C chip
    By ecoli-557 in forum General
    Replies: 3
    Last Post: - 10th June 2008, 17:26
  2. Multiple Pics accessing single EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd February 2008, 17:22
  3. Multiple PIC talking to same I2C device
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th October 2007, 00:28
  4. More I2C question with PBP
    By Qacer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd March 2006, 21:35
  5. ds1307 from f877 to f452 not work
    By microkam in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th July 2005, 00:02

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