Slave Mode : In slave mode, the configuration for the lines is pretty straight forward.

MOSI ---- > Input MISO ---- > Input/Output SCK ---- > Input ~SS ---- > Input The communication here is controlled by the ~SS line. As soon as the ~SS line goes low, the slave snaps to attention and data transfer takes place according to the clock pulses sent out by the master on the SCK line. The MISO line is to be set as input if data is to be received. However, if set as output, it will only continue one way communication ( sending the data without reading incoming data). Master mode : MOSI ---- > Output MISO ---- > Input SCK ---- > Output ~SS ---- > Input/Output The pins must be in the above state for normal full-duplex communication. The ~SS line can be set either as input or output. If there's only one master, the ~SS pin is set as output. If set as input, this line must be held high for the concerned micro-controller to remain as Master. If this line goes low, the MCU will lose it Master status and the pin over-rides for making the MCU a slave as mentioned above will take place.

Sign up to vote on this title
UsefulNot useful