Pages: [1]   Go Down
Author Topic: SPI Mode  (Read 402 times)
0 Members and 1 Guest are viewing this topic.
Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 799
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I have been looking at this diagram for several days and for some reason I feel like I'm missing something.

What confuses me is that it says "Data is outputted [sic} on the falling edge of SCK" but it looks like data is output on the RISING edge!

Based on this diagram, I think this is SPI Mode 3. Am I right?

(by the way, CS1 and CS2 are just chip select pins for each "chip". The device has two "chips" (display drivers) sharing a common SPI bus).

Thanks.....

-- Roger


* spi_format.jpg (138.66 KB, 652x932 - viewed 22 times.)
« Last Edit: February 06, 2013, 01:29:29 pm by Krupski » Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 69
Posts: 2557
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also think it's SPI mode 3
Logged


Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 799
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Edit: Nevermind. I found my problem. I forgot to use a tilde for bit clearing!

I did this:

Set bit: PORT != _BV(PIN); // right
Clr bit: PORT &= _BV(PIN); // wrong!

should have been

Clr bit: PORT &= ~_BV(PIN); // wrong!

Oh well......
« Last Edit: February 06, 2013, 06:15:09 pm by Krupski » Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Pages: [1]   Go Up
Jump to: