Multiple Pics accessing single EEPROM


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88

    Default Multiple Pics accessing single EEPROM

    Hello - I have been pouring over posts here for hours and have not come across anyone discussing thisparticular problem, so I tought I'd toss it out there. I am working on a design that has a "Master" PIC and 6 "Slave" PICS and a single I2C EEPROM. The Master stores data on the EEPROM and, when triggered, the Slaves, one at a time, go to the EEPROM and read the data. The way my circuit is set up is that all PICs share the SCL and SDA lines. This all works just fine if I just have one Master and one Slave. As soon as I plug in a second Slave, the data that I am writing to the EEPROM from the Master becomes corrupted. To try to figure out what was going on, I wrote a simple program for the Master that writes a number to EEPROM and then reads it back and displays it on an LCD. With one Slave installed, I can write the number (i.e., 543) to EEPROM and read it back just fine (the slave is not doing anything - just is installed in the circuit). As soon as I plug in another Slave, I get 8224 back (no matter what number I try to write out). I am assuming that the additional pics might be "drawing down" on the circuit causing the EEPROM to malfunction. On a huntch, I lowered the two 4.7K pullup resistors on the EEPROM to 2.2K, but no change. Can anyone shed some light on what I am seeing?

    Thanks!

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I assume you're using the I2CREAD and I2CWRITE commands in PBP?
    When each PIC is done reading/writing the EEPROM, add some code to manually set those pins back to INPUTs (input sda, input scl) immediately after the read or write. With the pins set as inputs, it would be as if they weren't even there. I think about the only thing you'd have to worry about would be read/write collisions.

  3. #3
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default

    Skimask - Yes, I am using I2CREAD/WRITE in PBP. Thanks for the suggestion - I will give it a try and post my results.

    Thanks again!

  4. #4
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    88


    Did you find this post helpful? Yes | No

    Default

    Skimask - Works perfectly! I now have 1 Master and 6 Slave PICs sharing the same EEPROM. As for collision, I just put in a delay for each Slave, incremented by 50 mS, before I change the 2 pins to outputs, read the data and then change them back to inputs.

    Thanks!
    Atom058

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  3. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  4. Internal EEPROM Read/write Addressing Errors with 18F PIC's
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 18
    Last Post: - 12th July 2005, 19:42
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

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