16.5.3Mode Fault Detection

A mode fault occurs and the mode fault flag (MODF) sets when a master SPI device detects an error on the SS pin (provided the SS pin is configured as the mode fault input signal). The SS pin is configured as the mode fault input signal when MSTR and MODFEN is set, and SSOE is clear.

The mode fault detection feature is used in a system where more than one SPI device might become a master at the same time. The error is detected when a master’s SS pin is low, indicating that some other SPI device is trying to address this master as if it were a slave. This could indicate a harmful output driver conflict, so the mode fault logic is designed to disable all SPI output drivers when such an error is detected.

When a mode fault is detected, MODF is set and MSTR is cleared to change the SPI configuration back to slave mode. The output drivers on the SPSCK, MOSI, and MISO (if not bidirectional mode) are disabled.

MODF is cleared by reading it while it is set, then writing to the SPIxC1 register. Software should verify the error condition has been corrected before changing the SPI back to master mode.

MCF51QE128 MCU Series Reference Manual, Rev. 3

Freescale Semiconductor

329

Get the latest version from freescale.com

Page 329
Image 329
Freescale Semiconductor MCF51QE128RM manual Mode Fault Detection, Freescale Semiconductor 329