6.4 Incorrect Clock Phase and Polarity
In SPI, data is written on one phase of the clock signal and read on another. If the wrong clock phase is selected, the value received or transmitted could be invalid. This could also occur if the clock line polarity (the state of the clock line when communication is inactive) mismatches. When configuring the SPI peripheral, ensure selecting the correct phase and polarity.