Serial Peripheral Interface please dont rip this site

Serial Peripheral Interface (SPI)


The "Serial Peripheral Interface" defines a 4-wire communication bus. Traditionally the 4 wires are named:

Many peripheral chips use a SPI interface. MultiMediaCard (MMC) uses a SPI interface.

If a microcontroller only needs to talk to 1 SPI peripheral, the CS pin on that slave may be grounded (right? But how does the slave know where the commands start and stop?).

If a microcontroller needs to talk to multiple SPI peripherals, there are 2 ways to set things up: "cascaded slaves" or "independent slaves".

"cascaded slaves" or "daisy-chained slaves": All the SCLKs are connected together. All the CS pins are connected together. The data flows out the microcontroller, through each peripheral in turn, and back to the microcontroller:

[uP MOSI] --> [MOSI device2 MISO] --> [MOSI device2 MISO] --> ... --> [MOSI deviceN MISO] --> [MISO uP].

"independent slaves": All the SCLKs are connected together. All the MISOs are connected together. All the MOSIs are connected together. The CS pin from each peripheral must be connected to a seperate pin on the microcontroller.

With a lot of SPI peripherals, a lot of pins on the microcontroller can be tied up in CS selection in a "independent slave" setup. The "daisy-chained slave" setup uses a lot fewer pins. (Alternatively, you could switch to devices that support a different protocol such as I2C that does device selection using address bits on the data line, rather than CS pins.)

(There's a nice picture of "cascaded slaves" vs. "independent slaves" at http://mct.net/faq/spi.html

Memory

SPI based I/O expanders.

Microchip PIC specific SPI

SPI Bug in LTC2400 analog to digital converter from Linear Technology

Related

Questions:

I doubt it is possible to connect a PS/2 keyboard to a SPI bus. Have you read "The PS/2 Mouse/Keyboard Protocol" by Adam Chapweske http://computer-engineering.org/ps2protocol/ ? If you had, you would know that the *both* the clock *and* the data line are driven by *both* the PC *and* the keyboard (at different times, of course). That sounds to me much more like a I2C bus than a SPI bus. Check /techref/microchip/i2c.htm for information on programming a PIC with the I2C protocol. Does that help? -- David Cary

Comments:

See also:


file: /Techref/io/serial/spis.htm, 9KB, , updated: 2013/7/22 18:23, local time: 2014/9/23 05:45,
TOP NEW HELP FIND: 
54.90.195.67:LOG IN

 ©2014 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/tecHREF/io/serial/spis.htm"> Serial Peripheral Interface</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2014 contributors:
o List host: MIT, Site host massmind.org, Top posters @20140923 RussellMc, Richard R. Pope, IVP, John Gardner, alan.b.pearce, David C Brown, James Cameron, Bob Blick, Josh Koffman, Isaac Marino Bavaresco,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .