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?