# SPI Clock Phase and Clock Polarity

Why would somebody be bothered to set Clock Polarity and Clock Phase for an SPI Master? Is this about the compatibility for Slave device? Is this somehow helping something? Why does it matter if the data is transferred on Rising Edge or Falling Edge ?

• Every Slave is more or less free to choose among the 4 modes arbitrarily, and this choice is hardcoded in the slave hardware. So yes, you need to read the slave datasheet to figure out what CPOL and CPHA parameter they use. If you use the incorrect mode with a given slave you will likely get missed bits, or no communication at all. It is common for the SPI bus peripherals to have registers keeping track of CPOL and CPHA for the known slaves and you can have different clock polarity setting for different slaves on the same bus. – crasic Oct 22 '15 at 17:54
• @crasic This might be the answer, as well. Thank you very much. – ozgur Oct 23 '15 at 6:50