can 2 PIC16F737 & eepeom be connected all in SPI ?

Status
Not open for further replies.

max_imum2000

New Member
i mean they all connected togther and transfer and share data between then using SPI or other protocol ?

how can i iditify the chip beeing used as a reciver and not the other one ?

where can i read more about this ? (additional to datasheet)

thanks
 
max_imum2000 said:
i mean they all connected togther and transfer and share data between then using SPI or other protocol ?

how can i iditify the chip beeing used as a reciver and not the other one ?

where can i read more about this ? (additional to datasheet)

I've never used SPI, but I presume it's similar to I2C and uses Master and Slaves? - if you want to communicate between two PIC's a far easier way is to use a serial link, this takes just two pins, or just one with a little bit of thought.
 
max_imum2000 said:
ok, but can i connect more than 2 devices togther , like 3 pics or 2 pics and 1 eeprom for example ?

As before, I can't comment on SPI, but with I2C you can have one master, and a number of slaves (or there is a multi-master mode, but that's more complicated). Again with I2C, each slave device is given a unique address (and the EEPROM's have pins to set this), so you talk to individual devices by using their unique address.

If you're wanting to use multiple-masters you obviously need to have some scheme for knowing which master has control of the bus.
 
Yes you can use SPI to connect as many things together as you want. There are three pins that are used for data and clock. A Master device must decide which device it is talking to by asserting a chip select signal. This mechanism accomplishes the same function as the addressing mechanism used in I2C. Clearly with one clock and one data line the transactions are one way at any given time.

In SPI, the data transfer is an exchange. When the master sends 8 bits out the slave device sends 8 bit back at the same time. That is why there are two data lines.

I've used SPI for Display Controllers, I/O Expanders, DACs and A/D converters. Never had a single problem with it.

What you cannot do is have both PICs trying to assert the eeprom chip select at the same time. That way lies chaos!
 
as others have said, this can be made to work. are you planning on just having the the 2 PICs talk to the EEPROM? that's pretty simple. You can have each PIC monitor the CS Line for the EEPROM and wait for it to go high before proceeding to access the EEPROM.

For having 2 PICs talk to each other via the MSSP seems like it might be an issue. How does the "master" know if the slave is listening?
 
max_imum2000 said:
I have no idea, how can the slave be listning
i hope someone explain this in more details

You might try asking EXACTLY what you are trying to do?, and why?.
 
max_imum2000 said:
I have no idea, how can the slave be listning
i hope someone explain this in more details
One of the processors will have a slave select pin (SS-bar). When the master asserts this pin the slave processor wil be listening by definition.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…