Author Topic: SPI Mode, can someone confirm this is Pol=0 Pha=1?  (Read 3507 times)

0 Members and 1 Guest are viewing this topic.

Offline jnzTopic starter

  • Frequent Contributor
  • **
  • Posts: 593
SPI Mode, can someone confirm this is Pol=0 Pha=1?
« on: July 15, 2015, 08:27:53 pm »
Attached.

I'm like 99% sure it's clock polarity is 0 (low to high) and the Phase is 1 where data is changed at rising edge and sampled at falling edge.

But... I'm getting fairly difficult to rationalize data when using this mode, and equally difficult when using 0/0. So I just wanted to check with some experts before I smash my face on my desk.

This is my first time dealing with SPI on STM32, so I'm just ruling out fairly simple errors I might be making. I hooked up a scope and the waveforms I'm getting are correct and looks really solid. I'm just not sure about the sampling.

Thanks
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: SPI Mode, can someone confirm this is Pol=0 Pha=1?
« Reply #1 on: July 15, 2015, 08:33:18 pm »
Clock idles low and data is changed on the leading edge of the clock pulse and sampled on the trailing edge.  Whatever phase/polarity settings give you that behavior is what you want.
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: SPI Mode, can someone confirm this is Pol=0 Pha=1?
« Reply #2 on: July 15, 2015, 08:49:53 pm »
Looks like you need clock polarity 0 and phase 1.

What device are you trying to communicate with?
 

Offline jnzTopic starter

  • Frequent Contributor
  • **
  • Posts: 593
Re: SPI Mode, can someone confirm this is Pol=0 Pha=1?
« Reply #3 on: July 15, 2015, 10:01:58 pm »
Looks like you need clock polarity 0 and phase 1.

What device are you trying to communicate with?

Yea, I was 99% sure. Just confirming. It's a Motorola SBC, and it's starting to be a pita.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf