What is SPI?

A knowledge base, learn how to read hex. What a GPIO Register is ..

What is SPI?

Postby Carl-SolderSplash » Tue Apr 02, 2013 8:31 pm

SPI is a Communication bus that uses 3-4 Wires.

SPI Clock (SCLK) - Used to clock data in or out
SPI Master Out (MOSI) - Data sent from a master to a slave
SPI Master IN (MISO) - Data sent to a master
Chip Select (CS) - Used to tell the slave to listen to the bus and that it can use the MISO line

Each bit of a each byte is indicated by setting or clearing the MOSI/MISO line and changing the SCLK to indicate that the data line should be sampled. Some devices change/setup the data line on the rising edge so it is valid (ready to be sampled) on the falling edge. Others do the reverse.

The number of bits sent per message is all up to the protocol the device you are communicating with expects.

A downside compared with I2C is that each slave on the SPI bus requires it's own chip select line. The chip select line tells the SPI device that it is being spoken too and that it use the MISO line to talk back. It is also used as a way of keeping in sync and knowing where the first bit is in an SPI message.

Because SPI is quite simple most micro controllers give you a FIFO buffer that in hardware will queue a series of bytes to send and bytes received. Some high end devices provide DMA, which allows you to specify where in your ram to read from/to.


Most of our SolderBridge's contain a small NXP LPC11U24 ARM M0 and we control/communicate to them using SPI.

For more info : http://en.wikipedia.org/wiki/Serial_Per ... erface_Bus
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Return to Embedded School

Who is online

Users browsing this forum: No registered users and 4 guests

cron