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
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
There are many ways of doing it.
What kind of "memory" is it?
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
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.
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?
------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
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
Last edited by BrianT; - 30th January 2008 at 10:14. Reason: grammar
Bookmarks