You are on page 1of 14

SPI

By Alexander Maroudis

Outline

What is SPI?
SPI Configuration
SPI Operation
Master Slave Setup
SPI Transactions
SPI Digital Potentiometer Example (EE 583)
SPI Peripheral Types
SPI and Microcontrollers
ESBUS

SPI
(Serial Peripheral Interface)
Developed by Motorola
Also known as MicroWire (National
Semiconductor), QSPI
(Queued),MicrowirePlus
Synchronous Serial Communication

SPI Configuration
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

SPI Operation
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

Master Slave Setup


In this setup, there are 3
slave devices. The SDO
lines are tied together to
the SDI line of the master.
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

Multiple Independent
Slave Configuration

Master Slave Setup


Multiple slave cascaded

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

SPI Timing Diagram


EEPROM Read

SPI Digital POT (EE 583)

We used a Microchip digital POT in EE 583 with SPI interface.


Motorola 68HC12 had SPI built in hardware, very easy to use.
Data we sent to POT via SPI consisted of 2 bytes.
Command Byte- XXC1C0XXP1P0
C1C0 determines type of command,
eg. 01 = Write Data
10 =Shutdown
P1P0 Determines which potentiometer is affected by
the command
00 = Nothing affected
01 = Command executed on POT 0
10 = Command executed on POT 1
11 = Command executed on both POTs
Data byte indicates value of the wiper

SPI Potentiometer Transaction

SPI Peripheral Types


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

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

SPI and Microcontrollers


Motorola 68HC12 Has SPI built in
hardware. Easy to integrate. See EE583
Intel 8051 Depending on Models, Most
Cygnal products have I2C and some have
SPI also built in hardware for easy
integration.

Esbus

Sensors bus
Being developed by Esensors Inc, (see www.eesensors.com for
more info)
6 wire sensor bus with modular connector based on modified SPI
Byte of data is exchanged between the master and slave
Optical isolators provide ground isolation for safety and noise
reduction
Data is transmitted from master along EDI lines
The signal is connected to the data input to SPI serial bus on
microcontroller
Sensor information from slave are transmitted on EDO line to output
of remote sensor
Data line is connected to SDO in sensor end.
Isolated DC to DC supply is used to retain ground isolation
(optional)

You might also like