I2C slave


Closed Thread
Results 1 to 5 of 5

Thread: I2C slave

  1. #1
    Stump's Avatar
    Stump Guest

    Default I2C slave

    Greetings eh!
    Firstly Thanks to all users of this forum.
    All the issues I encountered over the past 6mo
    were solved from postings on this forum.

    A special thanks to Mel... MN1307.txt demonstrated
    a lot more than just reading and setting an RTC.
    (my own similar program was more than 2x in size)

    Now to business..

    A master control using 18F6720 is to send and receive data from up to 12 slave pics
    (possibly 18F252) located up to 5 meters from the master using I2C.
    Each slave is located in a seperate enclosure and will be opto isolated.

    1) Can the master control have more than one I2C bus?
    one for on board accessories RTC,eeprom,etc,
    and a second buffered i2c bus to talk to the slave modules.
    ref... i2cslave.bas & i2cmast.bas

    2) What exactly does "DEFINE I2C_HOLD" do?
    2a) does this affect the hardware i2c or the software i2c or both
    2b) will this affect the use of RTC and eeprom on the software controlled bus

    3) would RS485 or other be a better choice?
    Thanks Kindly
    Ron

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Have slave/master in I2C ?!? Not sure it will be the easy or appropriate way... a simple RS485 network will do the job.

    You can place up to 8 I2C device on the same pair of wire if they have the capability of. The only things you have to do, is to change their A0-A3 setting bits(kinda chip select) to access them separatley and have the according Control Word to access them.

    I've never see any application for this I2C_slow stuff. All i2C that i use support the high speed communication.

    To resume, in your case, i'll prefer using RS485 network ICs + all I2C device you have on the same pins.. if they supported this.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default Re: I2C slave

    A master control using 18F6720 is to send and receive data from up to 12 slave pics
    (possibly 18F252) located up to 5 meters from the master using I2C.
    Each slave is located in a seperate enclosure and will be opto isolated.
    With PBPs I2C Routines your PIC acts as a Master, you would have to write your own Routines to make the PIC act as I2C-Slave

    Can the master control have more than one I2C bus?
    one for on board accessories RTC,eeprom,etc,
    and a second buffered i2c bus to talk to the slave modules.
    No Problem,
    I use two I2C buses on several of my projects, one "internal" for RTC, EEPROM, etc. and one "external" bus for I2C I/O Expanders (PCF8574)

    would RS485 or other be a better choice?
    Well, for PIC2PIC communication with more than 2 PICs sharing the same bus
    I would prefer RS485 due to it's robustness.
    regards

    Ralph

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



  4. #4
    Stump's Avatar
    Stump Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the replies and advice
    A major question is still unanswered though..

    Will "DEFINE I2C_HOLD 1" affect multiple i2c buses
    and will this command affect normal operation with
    RTC & EEprom?
    Thks
    R

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


    Did you find this post helpful? Yes | No

    Default

    Stump

    I would assume this is a "global" DEFINE
    so it would affect each bus being used with I2CWRWITE / I2CREAD.

    I guess you have to check the datasheets of the RTC / EEPROM you are using to see wether or not there would be an effect.

    What I can tell so far is:
    24FC512 and DS1307 work fine even with this DEFINE.
    regards

    Ralph

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



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. Another I2C Slave Routine Problem
    By DanPBP in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 05:50
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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