Sunteți pe pagina 1din 13

What is SPI?

SPI Configuration SPI Operation Master Slave Setup SPI Transactions SPI Digital Potentiometer Example (EE SPI Peripheral Types SPI and Microcontrollers ESBUS

583)

Developed by Motorola. Also known as MicroWire (National Semiconductor), QSPI (Queued),MicrowirePlus. Synchronous Serial Data Communication Operates in Full-Duplex Mode. Device communicate in master/slave mode where the master device initiates the data frame. Multiple slave devices are allowed with individual slave select (chip select) lines.

Primarily used for serial communication between a host processor and peripherals. Can also connect 2 processors via SPI. SPI works in a master slave configuration with the master being the host microcontroller for example and the slave being the peripheral

For SPI, there are Serial Clocks (SCLK), Chip Select lines (CS), Serial Data In (SDI) and Serial Data Out( SDO) There is only one master, there number of slaves depends on the number of chip select lines of the master. Synchronous operation, latch on rising or falling edge of clock, SDI on rising edge, SDO on falling edge. Operates in 1 to 2 MHz range. Master sends out clocks and chip selects. Activates the slaves it wants to communicate with

In this setup, there are 3 slave devices. The SDO lines are tied together to the SDI line of the master.

Multiple Independent Slave Configuration

The master determines which chip it is talking to by the CS lines. For the slaves that are not being talked to, the data output goes to a Hi Z state.

In this example, each slave is cascaded so that the output of one slave is the input of another. When cascading, they are treated as one slave and connecting to the same chip select

Converters (ADC, DAC) Memories (EEPROM, RAM s, Flash) Sensors (Temperature, Humidity, Pressure) Real Time Clocks Misc- Potentiometers, LCD controllers, UART s, USB controller, CAN controller, amplifiers

Vendors that make these peripherals : Atmel : EEPROM, Dig. POT s Infineon-: Pressure Sensors, Humidity Sensors Maxim-: ADC, DAC, UART, TI-: DSP s, ADC, DAC National Semiconductor-: Temperature Sensors, LCD/USB controllers

Full duplex communication. Higher throughput than IC or SMBus. Extremely simple hardware interfacing. Typically lower power requirements than IC or SMBus due to less circuitry (including pull-ups). No arbitration or associated failure modes. Slaves use the master's clock, and don't need precision oscillators. Slaves don't need a unique address -- unlike ICor GPIB or SCSI. Transceivers are not needed. Signals are unidirectional allowing for easy Galvanic isolation.

Requires more pins on IC packages than IC, even in the 3-Wire variant. No in-band addressing; out-of-band chip select signals are required on shared buses. No hardware flow control by the slave (but the master can delay the next clock edge to slow the transfer rate). No hardware slave acknowledgment (the master could be "talking" to nothing and not know it). Supports only one master device No error-checking protocol is defined. Generally prone to noise spikes causing faulty communication.

SPI is used to talk to a variety of peripherals, such as

Sensors: Temperature, Pressure, ADC, Touch-screens, Video-Game Controllers. Control devices: Audio Codecs, Digital Potentiometers, DAC Camera lenses: Canon EF Lens Mount
Handheld Video Games

Communications: Ethernet, USB, USART, CAN, IEEE 802.15.4, IEEE 802.11, Memory: Flash and EEPROM
Real-time clocks LCD Displays, sometimes even for managing image data. Any MMC Or SD Card (including SDIO variant).

S-ar putea să vă placă și