# SPI: TI or Motorola mode?

I am programming a Cortex M3 bare-metal to talk with SPI Flash. One of the configuration bits of an SPI control register is FRF (Frame format). It can either be set to SPI Motorola mode (0) or to SPI TI mode (1). (See the ARM reference manual page 695 here.)

The datasheet of the SPI Flash (available here) does not give indication regarding which mode I should use.

What are the two different modes, and which should I use for the specific Flash chip I am using?

-

Motorola and TI mode refer to different configurations of clock polarity (CPOL) and clock phase (CPHA). The clock polarity dictates whether a high or low signal marks a clock, the phase tells the device when to sample the data line.

According to your ARM datasheet, you can set CPOL and CPHA for your SPI controller.

Your flash chip (See chapter 3) supports {CPOL=0, CPHA=0} or {CPOL=1, CPHA=1}.

-
Aha, thanks! So which is which? Is {CPOL=0, CPHA=0} Motorola or TI? –  Randomblue Mar 16 '12 at 14:09
I can't remember, or find an authoritative source. –  Toby Jaffey Mar 16 '12 at 14:25
Every time I have determined that @Randomblue it has been with a scope, I find it much easier to measure than to look up. –  Kortuk Mar 16 '12 at 14:51
@Kortuk: By "scope" you mean "oscilloscope", right? That sounds quite exciting, but I've never done such a thing before. Could you point to a tutorial of some sort explain how to do this? –  Randomblue Mar 16 '12 at 15:02
@Randomblue, This is something that I know how to do very well but only could easily explain if you have no experience at all in person. You measure the Clk and data line and write something over SPI watching when the Data and clock change. –  Kortuk Mar 16 '12 at 17:11
show 1 more comment