13.2.2.3.3 Motorola SPI Error Case Scenarios

The SPI protocol does not specify any error recovery strategy. The master and slave require prior knowledge of clock rates and data-frame layouts. However, there are built-in mechanisms in the SPI controller to recover from error. If the slave encounters an error, the master can toggle the slave clock until it comes to a known state. Here are three specific scenarios and error the behavior of the SPI controller in Motorola protocol mode.

  • If the slave select signal is withdrawn in the middle of a transfer, the transfer continues until the end of the data frame.
  • If the input clock is withdrawn, the SPI controller remains paused until the clock is restarted. It picks-up where it left off.
  • If the slave select signal is withdrawn before a transfer occurs, the slave remains in the idle state (no data transfer having been initiated).

The SPI controller has no built-in timer. For applications where there is a possibility of a slave going to sleep for a long time, or in the case of very long transfers, the application should use a timer created from user logic.