which SPI mode is this

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. I have a slave device running on SPI which needs to communicate with MCU. In slave datasheet attached SPI diagram is given.
2. I need to set MCU SPI mode.
3. Which SPI mode is this. I think its SPI mode 1 because transmitter data i.e which is master have valid data on falling edge of clk.

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you say what the mystery "slave device" is - and give a link to its datasheet, so that we can see the full information?

 

Which MCU are you using? What does its datasheet say about its available SPI Modes?

 

The combinations of polarity and phases are often referred to as modes which are commonly numbered according to the following convention, with CPOL as the high order bit and CPHA as the low order bit

 

http://en.wikipedia.org/wiki/Ser...

Note the vague terms "often" and "commonly": because there is no formal definition of SPI, you really need to check the datasheet of your specific MCU to be sure of the terminology that it uses.

 

frown

 

Place your picture in the post - rather than as an attachment - so that we can actually see it:

Instructions for embedding images: https://www.avrfreaks.net/wiki/em...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Jun 3, 2015 - 08:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd guess mode 0.

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.