One EEPROM, 3 PIC's


Closed Thread
Results 1 to 8 of 8
  1. #1
    lwindridge's Avatar
    lwindridge Guest

    Default One EEPROM, 3 PIC's

    Just a quick questionn, but does this sound feasable??

    I haven't built the circuit yet, but my theory goes as follows...

    I have 1 EEPROM which stores some data tables.
    I have 3 PIC MCU's which need that data.

    Can I connect up the EEPROM to each of the MCU's using a flag system to tell each PIC when it's ok to read on startup ?
    eg. PIC1 reads the data then makes portb.1 high when done which is connected to PIC2 portb.0. When PIC2 senses portb.0 go high, it reads the data and sets portb.1 high which is connected to PIC3 portb.0. When PIC3 senses portb.0 go high it then reads the data in and all is well
    Each of the PIC's starts its normal code cycle after reading data and the data is only stored in one (easily updatable) please.

    Does that sound like pure fantasy, or could it be done do you think????

    Leigh

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


    Did you find this post helpful? Yes | No

    Default

    depending of the EEPROM you're using...

    If you use an 93C serie(Microwire), everything will be simple.You must isolate EEPROM pins with diodes(CS,CLK,DI)... DO pin will be connected directly to each PIC.

    Every PIC must CHECK at least CS PIN of the EEPROM to determine if he's available. OR you can use one PIN of every pic as a BUSY line too.

    But for I2C.... Since pins are input/output... will be different. Can use the same idea of the BUSY line and connecte every PIC pins to SDA & SCL of EEPROM too without anything. The only thing you have to do, finish acces to EEPROM by a I2CREAD to make PIC PINS as input.. that way, no PIC will shut down EEPROM pins to ground.

    Some I2C EEPROM (like 24lc64) have the ability to be select by Software chip select. You must set A0-A2 EEPROM pins and acces to them by a specific Control Word. BUT I'M REALLY NOT SURE it will work when changing these pin in run-time...
    Steve

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

  3. #3
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    Another idea I have had which may work better is one master PIC (primarily used for data-logging and display work) which feeds the data from the EEPROM to each of the other PIC's in turn.
    Using this method I assume I could just connect all 3 PICS to the serial out side and use a different wait code for each PIC.

    So the startup procedure would be more like...

    Master PIC reads data from EEPROM,
    PIC 1,2 and 3 in ready to receive mode.
    Master PIC sends start code for PIC1, then data then end code. PIC 1 after recognising end code stores received data in an array and sends back confirm to master PIC then goes into normal operation.
    Master PIC sends start code for PIC2, then data then end code. PIC 1 after recognising end code stores received data in an array and sends back confirm to master PIC then goes into normal operation.
    Master PIC sends start code for PIC3, then data then end code. PIC 1 after recognising end code stores received data in an array and sends back confirm to master PIC then goes into normal operation.

    Master PIC knowing all 3 PIC's have the data swtches into normal operation.

    Does that sound feasable????

    Leigh

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


    Did you find this post helpful? Yes | No

    Default

    Yeah for sure you can do it like that too.

    OR, the master PIC will use 3 serial PINs interruptable (let's interrupt on PORTB change) Once he got interrupt on:

    1. PORTB.0, do serial IN for PIC1
    2. PORTB.1, do serial IN for PIC2
    3. PORTB.2, do serial IN for PIC3

    Let me know wich PIC you'll use, i'll try to figure out something. Tell me a bit more about hardware (display, eeprom blah blah blah) Maybe we can use one master PIC that have enough of INternal EEPROM space.
    Steve

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

  5. #5
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    I was thinking of using just a PIC with a decent internal EEPROM myself - it has to store about 2k of data max for now.
    Hence I was thinking of that sort of thing.
    One master with the data, and 3 slaves connected via serial which pick up the data from the master.

    I'll probably be using a mix of 16F877's and 16F627/628's for the slaves, but the master PIC is still open to suggestion )

    Leigh

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


    Did you find this post helpful? Yes | No

    Default

    you need 2K of internal EEPROM storage... PIC16F877 will be a good choice depending how many i/o pin you need.

    there's some other with 256*8 eeprom size
    PIC16F648
    PIC16F819
    PIC16F87
    PIC16F88
    PIC18F1220
    PIC18F1320

    and so many others
    Steve

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

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Question

    Steve,

    Can you give a more detailed example of the BUSY line technique please?

    I am using a Master 16F628 with multiple Slave 16F628 using USART communication (HSERIN via TX/RX lines).

    I'd like to be able to use a BUSY line to indicate when the line is busy. At first thought I would think that HIGH = NOT BUSY and LOW = BUSY, that way there is no power signal at the same time as communication, less risk of disruption.

    NOTE: It is not known which Slave will be connected to the system. There might be none, or there might be several, that'S why I'm looking for a flexible way of Slaves to send data.

    Robert
    Last edited by Demon; - 24th November 2005 at 20:18.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Doesn't the 16F877 only have 256 Bytes of EEPROM?

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. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. Multiple Pics accessing single EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd February 2008, 17:22
  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 : 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