what are the connections to be made for SPI connections between two PIC microcontrollers(18F4620). one is master and other is slave. what are the connections are to be made apart from SPI pins? Slave select or Chip Select?
what are bits to be checked for transmitting and receiving the data?
Basically you just need the SPI signals and one GPIO connected to the SS pin of the device that is the slave.
Basically, the BF (buffer full) is the one normally checked to see if data is available when receiving, or to see if the buffer is empty and so a new byte can be loaded and transmitted. For the slave, the interrupt is recommended.
IMHO, the SS need to be connected too. I use bit banging technique rather than the SPI engine. The code can be ported to any uC that do not have SPI engine.
IMHO, the SS need to be connected too. I use bit banging technique rather than the SPI engine. The code can be ported to any uC that do not have SPI engine.
You do not need to use the SS pin on the slave if you disable it: SSPCON:<SSPM3:SSPM0> (0101).
SS pin can then be used as I/O. Remember to configure TRIS bits for port pins.
If the two devices are running from separate supplies do not forget the GND interconnection.