The Slave Select (SS) pin plays a central role in the operation of the SPI. Depending on the mode the SPI is in and the configuration of this pin, it can be used to activate or deactivate devices. The SS pin is used as a Chip Select pin.
SS Configuration | SS Pin-Level | Description | MISO Pin Mode | |
---|---|---|---|---|
Port Direction = Output | Port Direction = Input | |||
Always Input | High | Slave deactivated (deselected) | Tri-stated | Input |
Low | Slave activated (selected) | Output | Input |
In Slave mode, the SPI state machine will be reset when the SS pin is brought high. If the SS is brought high during a transmission, the SPI will immediately stop sending and receiving - both data received and data sent must be considered as lost. As the SS pin is used to signal the start and end of a transfer, it is useful for achieving packet/byte synchronization, and keeping the Slave bit counter synchronized with the master clock generator.