CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

SPI connection?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








SPI connection?
PostPosted: Wed Sep 30, 2009 1:21 pm     Reply with quote

Hi

I confused because
Code:
en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#3-Wire_Serial_Buses

describe in picture that SDI must be connected to SDI. But in text they describe that SDI must go to SDO.

What I want to is connect a PIC to a SPI device.
Is it SDI to SDI or SDI to SDO?
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Wed Sep 30, 2009 1:26 pm     Reply with quote

Typically on devices would be marked from the device point of view. That would mean that SDO from PIC would go to SDI on device and vice versa.

SDO <-- Output
SDI <-- Input
SCK <-- Clock controlled by "master" device.

Hope this explains this field.
Cool
Guest








PostPosted: Wed Sep 30, 2009 2:06 pm     Reply with quote

Smile
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Sep 30, 2009 2:21 pm     Reply with quote

You're quoting the wikipedia site incorrectly.
Quote:
describe in picture that SDI must be connected to SDI

No picture uses SDI or SDO on that site. They are actually using MISO/MOSI notation, which is a completely different thing. This are the original Motorola terms, and they have the advantage that the nodes carry the same signal names from driver to receiver.
Guest








PostPosted: Thu Oct 01, 2009 9:26 am     Reply with quote

Now confusing is near 100%

At the wiki page on the top there are some picture. The same pin master and slave is connected, right?

Code:
en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Daisy_chain_SPI_configuration


I want to connect a PIC to a SPI device.
SDO(PIC) -> SPI_x(SDI)
SDI(PIC) <- SPI_x(SDO)
Right?
Ttelmah
Guest







PostPosted: Thu Oct 01, 2009 9:43 am     Reply with quote

Yes.

Think about what the various terms 'say', rather than the abreviations.

The original Motorola terms, MOSI, and MISO, were 'Master Out Slave In', and 'Master In Slave Out'.
The PIC terms, are SDO, SDI 'SPI Data out', and 'SPI Data In'.

Code:


Master  Master  Slave  Slave

MISO    MOSI    MISO   MOSI
SDI     SDO     SDO    SDI

(fixed pitch required)


SDI, always connects to SDO, SDO to SDI, MOSI, to MOSI, and MISO to MISO. The Motorola terms, have the advantage of using the same term for the pins that connect, swapping the direction in the term (so the master is 'out', for the slave 'in'), while the PIC nomenaclature requires _you_ to remember to connect one devices 'out' to the other's 'in'.

Remember you also need SCL.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group