Multiple Slave and MSSP SPI

Status
Not open for further replies.

brinthan

New Member
Hi,

I'm trying to program PIC18F542. I have one master and two slaves. I don't understand how to Select Slave 1 or Slave 2 from the master. I'm trying to make connections using MSSP SPI. Can someone show me the light?
 
I do not know about F542 but on 18F2431 there is a SPI pin SS(slave select) on the device which needs to be pulled down before the slave SPI will operate. Presumably you can set these pins by conecting each of them to one of the master's output pins(or use one pin and send the signal to one of the slaves through a not).

Even if your device does not have the SS pin(which I doubt) you should be able to implement something like this in software.

It will probably be easier to get one slave working, then add the second rather than tryng to do both at once.
 
There's a SS pin. But how do I select Slave number 1 or Slave number 2. There's only one SS pin, how do I pull down Slave number 2 and not Slave number 1?
 
The SS pin is enabled on the slave device, not the master.

I would use other IO pins on the master device( not part of SSP) send one to slave1's ss pin, send the other to slave2's ss pin.

set these pins before each transmit or whenever you change which slave you are talking to.

I have not actually done this, but that is how it looks to me from the timing diagrams.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…