PDA

View Full Version : Memory



cleas001
- 29th January 2008, 11:23
hello,
i am looking to set up a circuit where i will have two (or more) PICs reading from the same memory - how can this be done?
thank you

sayzer
- 29th January 2008, 13:00
There are many ways of doing it.

What kind of "memory" is it?

cleas001
- 29th January 2008, 17:05
what i want to do is run a system where i have two pics each with information being inputted - the information from each pic needs to be avaliable to the other pic to read from.

sayzer
- 29th January 2008, 17:31
Cleas,

Be more specific,

give details,

provide drafts, charts, logic flow, concept schematic....

What kind of information, coming from where?

Who or what is sending the information?

------------------

skimask
- 29th January 2008, 17:37
what i want to do is run a system where i have two pics each with information being inputted - the information from each pic needs to be avaliable to the other pic to read from.

Off the top of my head...
2 PICs, 1 EEPROM, both connected like they own the thing.
If one PIC wants it, check the SCL/SDA manually before accessing it.
Or add a 3rd wire for signalling, pulled high. If the wire is low, one of the PICs is using the EEPROM.

BrianT
- 30th January 2008, 02:52
I have many PICs in a peer to peer network and they all swap messages between each other. This requirement is a simple version of that.

I would use a handshake line that each device checks before reading or writing. You could monitor SDA and SCL but these are dynamic and a snapshot may look like no activity when in fact it is busy.

I would have four 4k7 from Vcc to the two PIC SDA and SCL lines plus two 4k7 from supply to the contention pins on each PIC. When not wanting access to the memory, the SDA, SCL and the contention pin are set as inputs so they are all pulled high by the resistors. When a device wants memory access it checks that the contention line is high (no activity state) then pulls it low and starts the SDA, SCL memory data exchange. When the message is over the sending PIC returns all lines to inputs and they are pulled high ready for the next data transfer.

During debugging you can be certain that both PICs will fight and so use series limiting resistors wherever there is a direct PIC to PIC connection. 470 Ohms will do it.

HTH
Brian