PDA

View Full Version : One EEPROM, 3 PIC's



lwindridge
- 27th December 2004, 00:09
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

mister_e
- 27th December 2004, 01:15
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...

lwindridge
- 29th December 2004, 16:12
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

mister_e
- 29th December 2004, 16:35
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.

lwindridge
- 29th December 2004, 16:52
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 :o)

Leigh

mister_e
- 29th December 2004, 17:08
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 :)

Demon
- 24th November 2005, 20:00
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
:)

CocaColaKid
- 24th November 2005, 20:45
Doesn't the 16F877 only have 256 Bytes of EEPROM?