Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer

up vote 2 down vote accepted

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}.

For more information, http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Clock_polarity_and_phase

share|improve this answer
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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.