SlideShare a Scribd company logo
Serial Peripheral Interface
(SPI)
Need of Serial Bus Protocol
• Peripheral devices in embedded systems =>
parallel address and data bus => lots of wiring and
requires number of pins => additional decoding logic
required.
• To reduce the pins and wiring => cost => Serial bus
protocol => SPI (4-wire) & I2C (2-wire).
• Penalty => Slower communication.
Various Serial Bus Protocol
• UART
• SPI –Embedded System Protocol
• I2C- Embedded System Protocol
• CAN
• USB
• SATA etc..
• The Serial Peripheral Interface Bus or SPI bus is a
synchronous serial data link standard named by
Motorola that operates in full duplex mode.
• Devices 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.
•During a data transfer the master always sends 8
to 16 bits of data to the slave, and the slave always
sends a byte of data to the master.
• Maximum data bit rate is one eighth of the input
clock rate.
• One Central device (Master), initiates communication
with all slaves.
• No address decoding logic required.
• SPI Master wishes to send the data to slave or request
information from the slave, it activates the clock
signal.
• Master generates information on one line (MOSI)
while samples (read) from another line (MISO).
SPI Pin Description
• SCLK — Serial Clock (output from master)
• MOSI — Master Output, Slave Input (output from
master)
• MISO — Master Input, Slave Output (output from
slave)
• SS — Slave Select (active low; output from master)
SPI, SSP0
INTERFACE
SCK
MOSI
MISO
SSEL
Pin Name :SCK (Serial Clock)
Type :Input / Output
• The SPI used clock signal to synchronize the
transfer of data across the SPI interface.
• The SCK is always driven by the master and
received by the slave, The clock is programmable to
be active high or active low.
•The SCK is only active during a data transfer. Any
other time, it is either in its inactive state, or tri-
stated.
Pin Name : MISO
(Master in Slave out)
Type : Input / Output
• The MISO signal is a unidirectional signal used to
transfer serial data from the slave to the master.
• When a device is a slave, serial data is output on
this signal.
• When a device is a master, serial data is input on
this signal.
• When a slave device is not selected, the slave
drives the signal high impedance.
Pin Name : MOSI
(Master out Slave in)
Type : Input / Output
• The MOSI signal is a unidirectional signal used to
transfer serial data from the Master to the Slave.
•When a device is a Master, serial data is output on
this signal.
• When a device is a Slave, serial data is input on this
signal.
Pin Name : SSEL (Slave Select)
Type : Input
• The SPI slave select signal is an active low signal
that indicates which slave is currently selected to
participate in a data transfer.
• Each slave has its own unique slave select signal
input.
•The SSEL must be low before data transactions
begin and normally stays low for the duration of the
transaction.
• If the SSEL signal goes high any time during a data
transfer, the transfer is considered to be aborted.
• In this event, the slave returns to idle, and any data that was
received is thrown away. There are no other indications of
this exception.
•This signal is not directly driven by the master. It could be
driven by a simple general purpose I/O under software
control.
•On the LPC2300 the SSEL pin can be used for a different
function when the SPI interface is only used in Master mode.
• For example, pin hosting the SSEL function can be
configured as an output digital GPIO pin and it is also used
to select one of the SPI slaves.
Operation
• The SPI bus can operate with a single master
device and with one or more slave devices.
• SPI bus: single master and single slave
• If a single slave device is used, the SSEL pin may
be fixed to logic low if the slave permits it.
• Some slaves require the falling edge (high->low
transition) of the slave select to initiate an action
such as the MAX1242 by Maxim, an ADC, that
starts conversion on said transition.
Configuration
• Two types multiple slave configuration:
• Typical SPI bus: Master and independent Slaves
• Daisy-Chained SPI bus: Master and cooperative slaves
Typical SPI Bus
• With multiple slave devices, an independent
SSEL signal is required from the master for
each slave device (3).
• In the independent slave configuration, there is an
independent slave select line for each slave. This is the way
SPI is normally used.
• Since the MISO pins of the slaves are connected together,
they are required to be tri-state pins.
Daisy-Chained SPI Bus
Daisy-chained SPI bus: Master and Cooperative
Slaves
• Some products with SPI bus are designed to be capable of
being connected in a daisy chain configuration, the first
slave output being connected to the second slave input, etc.
• The SPI port of each slave is designed to send out during
the second group of clock pulses an exact copy of what it
received during the first group of clock pulses.
•Such a feature only requires a single SSEL line from the
master, rather than a separate SSEL line for each slave.
Points
• Not have ack mechanism to confirm receipt of data
and does not have flow control.
• SPI Master, not have knowledge of whether slave
exist or Not
• Not particular addressing scheme.
• Not defined any maximum data rate.
Data Transmission
• A typical hardware setup using two shift registers to
form an inter-chip circular buffer
• To begin a communication, the master first
configures the Clock, using a frequency less than
or equal to the maximum frequency the slave
device supports.
•Such frequencies are commonly in the range of
1-70 MHz.
•The master then pulls the slave select SSEL low
for the desired chip.
•During each SPI clock cycle, a full duplex data
transmission occurs.
•The master sends a bit on the MOSI line; the slave
reads it from that same line
• The slave sends a bit on the MISO line;
the master reads it from that same line
•Transmissions normally involve two shift registers
of some given word size, such as eight bits, one in
the master and one in the slave; they are connected
in a ring.
•After that register has been shifted out, the master
and slave have exchanged values.
•Then each device takes that value and does
something with it, such as writing it to memory.
• If there are more data to exchange, the shift
registers are loaded with new data and the process
repeats.
Clock Polarity and Phase
• In addition to setting the clock frequency, the
master must also configure the clock polarity and
phase with respect to the data.
• SPI Block Guide names these two options as CPOL
and CPHA respectively, and most vendors have
adopted that convention.
A timing diagram showing clock polarity and phase
At CPOL=0, the base value of the clock is zero
• For CPHA=0, data are read on the clock's
rising edge (low->high transition) and data are
changed on a falling edge (high->low clock
transition).
• For CPHA=1, data are read on the clock's
falling edge and data are changed on a rising
edge.
At CPOL=1, the base value of the clock is one
(inversion of CPOL=0)
• For CPHA=0, data are read on clock's falling
edge and data are changed on a rising edge.
• For CPHA=1, data are read on clock's rising
edge and data are changed on a falling edge.
CPOL &
CPHA
First data driven Other data
driven
Data
Sampled
0 & 0 Prior to first
SCK rising edge
SCK falling
edge
SCK rising
edge
0 & 1 First SCK rising
edge
SCK rising
edge
SCK falling
edge
1 & 0 Prior to first
SCK falling
edge
SCK rising
edge
SCK falling
edge
1 & 1 First SCK
falling edge
SCK falling
edge
SCK rising
edge
Microchip SPI EEPROM (Slave)
• 8-bit data transfer, device is master/slave and setting
of CPHA variable.
•Device, Master => Start of transfer, master having a
data ready to transfer. Activate the clock and begin the
transfer.
•Device, Slave and CPHA=0, transfer start when
SSEL=0.
•Device, Slave and CPHA=1, transfer starts on first
clock edge when slave is selected.
Mode Numbers
• The combinations of polarity and phases are
often referred to as modes
Mode CPOL CPHA
0 0 0
1 0 1
2 1 0
3 1 1
Register Description
• SPI has seven registers, from that programmers
interface for SPI peripheral has five registers.
• The bits in the rest of two TEST registers are
intended for functional verification only.
Name Description Access
S0SPCR SPI Control Register.
This register controls the R/W
operation of the SPI.
S0SPSR SPI Status Register.
This register shows the R0
status of the SPI.
Name Description Access
S0SPDR SPI Data Register.
This bi-directional
register provides the R/W
transmit and receive
data for the SPI.
Name Description Access
S0SPCCR SPI Clock Counter Register.
This register controls the R/W
frequency of a master’s SCK
S0SPINT SPI Interrupt Flag.
This register contains the R/W
interrupt flag for the
SPI interface.
(1) SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
1:0 - Reserved, user software
should not write ones to
reserved bits.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
2 BitEnable 0 The SPI controller sends
and receives 8 bits of data
per transfer.
1 The SPI controller sends and
receives the number of bits
selected by bits 11:8.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
3 CPHA Clock phase control
0 Data is sampled on the first
clock edge of SCK.
1 Data is sampled on the
second clock edge of the
SCK.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
4 CPOL Clock polarity control.
0 SCK is active high.
1 SCK is active low.
5 MSTR Master mode select.
0 The SPI operates in Slave
mode.
1 The SPI operates in Master
mode.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
6 LSBF LSB First, controls in which
direction each byte is
shifted when transferred.
0 SPI data is transferred MSB
(bit 7) first.
1 SPI data is transferred LSB
(bit 0) first.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
7 SPIE Serial peripheral interrupt
enable.
0 SPI interrupts are inhibited.
1 A hardware interrupt is
generated each time the
SPIF or MODF bits are
activated.
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
11:8 BITS When bit 2 of this register is
1, this field controls the
number of bits per transfer:
1000 8 bits per transfer
1001 9 bits per transfer
1010 10 bits per transfer
1011 11 bits per transfer
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
1100 12 bits per transfer
1101 13 bits per transfer
1110 14 bits per transfer
1111 15 bits per transfer
0000 16 bits per transfer
SPI Control Register
(S0SPCR - 0xE002 0000)
Bit Symbol Value Description
15:12 - Reserved, user software
should not write ones to
reserved bits.
(2) SPI Data Register
(S0SPDR - 0xE002 0008)
• This bi-directional data register provides the
transmit and receive data for the SPI.
• Transmit data is provided to the SPI by writing
to this register.
• Data received by the SPI can be read from this
register.
Data Registers
• There is no buffer between the data register and
the internal shift register. A write to the data
register goes directly into the internal shift
register.
• Therefore, data should only be written to this
register when a transmit is not currently in
progress.
• Read data is buffered.
• When a transfer is complete, the receive data is
transferred to a single byte data buffer, where it
is later read.
• A read of the SPI data register returns the value
of the read data buffer.
SPI Data Register
(S0SPDR - 0xE002 0008)
Bit Symbol Description
7:0 DataLow SPI bi-directional data port.
15:8 DataHigh If bit 2 of the SPCR is 1 and bits
11:8 are other than 1000, some
or all of these bits contain the
additional transmit and receive
bits. When less than 16 bits are
selected, the most significant
among these bits read as zeroes.
(3) SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
7 SPIF SPI transfer complete flag.
When 1, this bit indicates when a
SPI data transfer is complete.
When a master, this bit is set at the
end of the last cycle of the transfer.
SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
7 SPIF SPI transfer complete flag.
When a slave, this bit is set on the
last data sampling edge of the SCK.
This bit is cleared by first reading
this register then accessing the SPI
data register.
SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
6 WCOL Write Collision. When 1, this bit
indicates that a write collision has
occurred. This bit is cleared by
reading this register then accessing
the SPI data register.
Exception conditions –Write Collision
• As stated previously, there is no write
buffer between the SPI block bus
interface, and the internal shift register.
• As a result, data must not be written to
the SPI data register when a SPI data
transfer is currently in progress.
• The time frame where data cannot be written to the
SPI data register is from when the transfer starts,
until after the status register has been read when the
SPIF status is active.
•If the SPI data register is written in this time frame,
the write data will be lost, and the write collision
(WCOL) bit in the status register will be activated.
SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
5 ROVR Read overrun. When 1, this bit
indicates that a read overrun has
occurred. This bit is cleared by
reading this register.
Exception conditions –Read Overrun
• A read overrun occurs when the SPI block internal
read buffer contains data that has not been read by the
processor, and a new transfer is completed.
• The read buffer containing valid data is indicated by
the SPIF bit in the status register being active.
Exception conditions –Read Overrun
•When a transfer completes, the SPI block needs to
move the received data to the read buffer.
• If the SPIF bit is active (the read buffer is full),
the new receive data will be lost, and the read
overrun (ROVR) bit in the status register will be
activated.
SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
4 MODF Mode fault. when 1, this bit
indicates that a Mode fault error
has occurred. This bit is cleared
by reading this register, then
writing the SPI Control register.
Exception conditions –Mode Fault
• If the SSEL signal goes active, when the SPI
block is a master, this indicates another master has
selected the same device to be a slave. This
condition is known as a mode fault.
• When a mode fault is detected, the mode fault
(MODF) bit in the status register will be activated.
SPI Status Register
(S0SPSR - 0xE002 0004)
Bit Symbol Description
3 ABRT Slave abort. When 1, this bit
indicates that a slave abort has
occurred. This bit is cleared by
reading this register.
2:0 - Reserved, user software should not
write ones to reserved bits.
Exception conditions –Slave Abort
• A slave transfer is considered to be aborted,
if the SSEL signal goes inactive before the
transfer is complete.
• In the event of a slave abort, the transmit and
receive data for the transfer that was in
progress are lost, and the slave abort(ABRT)
bit in the status register will be activated.
SPI Interrupt Register
(S0SPINT - 0xE002 001C)
• This register contains the interrupt flag for the
SPI interface.
Bit Symbol Description
0 SPI SPI interrupt flag. Set by the SPI
Interrupt interface to generate an interrupt.
Flag Cleared by writing a 1 to this bit.
7:1 - Reserved, user software should
not write ones to reserved bits.
SPI Clock Counter Register
(S0SPCCR - 0xE002 000C)
• This register controls the frequency of a
master’s SCK.
• The register indicates the number of PCLK
cycles that make up an SPI clock.
• The value of this register must always be
an even number. As a result, bit 0 must always
be 0.
Configuration
• SPI can be configured as MASTER or
SLAVE.
Configuration - Master operation
• The following sequence describes how
one should process a data transfer with
the SPI block when it is set up to be the
master.
• This process assumes that any prior
data transfer has already completed.
Configuration - Master operation
1. Set the SPI Clock counter register to
the desired clock rate.
2. Set the SPI Control register to the
desired settings.
3. Write the data that transmitted to the
SPI data register. This write starts the
SPI data transfer.
Configuration - Master operation
4. Wait for the SPIF bit in the SPI status
register to be set to 1. The SPIF bit
will be set after the last cycle of the
SPI data transfer.
5. Read the SPI status register.
Configuration - Master operation
6. Read the received data from the SPI
data register (optional).
7.Go to step 3 if more data is required
to transmit.
Configuration - Master operation
NOTE:
• A read or write of the SPI data register
is required in order to clear the SPIF
status bit.
• Therefore, if the optional read of the
SPI data register does not take place, a
write to this register is required in
order to clear the SPIF status bit.
Configuration - Slave operation
• The following sequence describes how
one should process a data transfer with
the SPI block when it is set up to be the
slave.
• This process assumes that any prior
data transfer has already completed.
Configuration - Slave operation
1. Set the SPI control register to the
desired settings.
2. Write the data to transmitted to the SPI
data register (optional). Note that this
can only be done when a slave SPI
transfer is not in progress.
Configuration - Slave operation
3. Wait for the SPIF bit in the SPI status
register to be set to 1. The SPIF bit
will be set after the last sampling
clock edge of the SPI data transfer.
4. Read the SPI status register.
Configuration - Slave operation
5. Read the received data from the SPI
data register (optional).
6. Go to step 2 if more data is required to
transmit.
Configuration - Slave operation
NOTE:
• A read or write of the SPI data register
is required in order to clear the SPIF
status bit.
• Therefore, at least one of the optional
reads or writes of the SPI data register
must take place, in order to clear the
SPIF status bit.
SPI- Master (C-Code)
• #Include <LPC2300.h>
• Void init (void)
• # define SPIF (1<<7)
• # define data 0xC1
• int main ()
• {
• Init(); // function call
• While (1)
• {
• SPDR= data; // write data out
• While (!(SPSR& SPIF)) { }
• }
• }
• Void init () // fun declared
• {
• PINSEL0=0xAA000;
(SCK1, SSEL1, MOSI1,MISO1)
• VBPDIV=0x1;// set PCLK to
same as CCLk
• SPCR= 0x20;// device selected
master
• }
Output
0xC1
CPOL=0, CPHA=0,
Pros and Cons
Of
SPI
Advantages
• Full duplex communication
• Higher throughput than I²C
• Complete protocol flexibility for the bits
transferred
* Not limited to 8-bit words
* Arbitrary choice of message size,
content, and purpose
Advantages
• Extremely simple hardware interfacing
* Typically lower power requirements than
I²C due to less circuitry
* No arbitration or associated failure modes
* Slaves use the master's clock, and don't
need precision oscillators
* Transceivers are not needed
Disadvantages
• Requires more pins on IC packages than
I²C, even in the "3-Wire" variant
• No hardware flow control
• No hardware slave acknowledgment (the
master could be "talking" to nothing and not
know it)
Disadvantages
• Supports only one master device
• Only handles short distances compared
to RS-232, RS-485, or CAN-bus
Applications
SPI is used to talk to a variety of
peripherals, such as:
•Sensors: Temperature, pressure, ADC,
touch-screens
•Control devices: audio codecs, digital
potentiometers, DAC
Applications
• Memory: flash and EEPROM
• Real-time clocks
• LCD displays, sometimes even for
managing image data
• Any MMC or SD card

More Related Content

What's hot

Pcie basic
Pcie basicPcie basic
Pcie basic
Saifuddin Kaijar
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
SUNODH GARLAPATI
 
Apb
ApbApb
APB protocol v1.0
APB protocol v1.0APB protocol v1.0
APB protocol v1.0
Azad Mishra
 
axi protocol
axi protocolaxi protocol
axi protocol
Azad Mishra
 
dual-port RAM (DPRAM)
dual-port RAM (DPRAM)dual-port RAM (DPRAM)
dual-port RAM (DPRAM)
SACHINKUMAR1890
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)
Varun Mahajan
 
Uart
UartUart
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
Nahian Ahmed
 
Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)
Usha Mehta
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
Aarav Soni
 
I2C BUS PROTOCOL
I2C BUS PROTOCOLI2C BUS PROTOCOL
I2C BUS PROTOCOL
Kashyap Mandaliya
 
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C ImplementationMIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI Alliance
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
Corrado Santoro
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and Algorithms
Deiptii Das
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
DominicHendry
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
Anurag Tomar
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
DominicHendry
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
I2C
I2CI2C

What's hot (20)

Pcie basic
Pcie basicPcie basic
Pcie basic
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
 
Apb
ApbApb
Apb
 
APB protocol v1.0
APB protocol v1.0APB protocol v1.0
APB protocol v1.0
 
axi protocol
axi protocolaxi protocol
axi protocol
 
dual-port RAM (DPRAM)
dual-port RAM (DPRAM)dual-port RAM (DPRAM)
dual-port RAM (DPRAM)
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)
 
Uart
UartUart
Uart
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 
Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
 
I2C BUS PROTOCOL
I2C BUS PROTOCOLI2C BUS PROTOCOL
I2C BUS PROTOCOL
 
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C ImplementationMIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
MIPI DevCon 2016: A Developer's Guide to MIPI I3C Implementation
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and Algorithms
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
I2C
I2CI2C
I2C
 

Viewers also liked

Serial peripheral interface
Serial peripheral interfaceSerial peripheral interface
Serial peripheral interface
Abhijeet kapse
 
Spi master core verification
Spi master core verificationSpi master core verification
Spi master core verification
Maulik Suthar
 
Mux and demux done in cadence with pics
Mux and demux done in cadence with picsMux and demux done in cadence with pics
Mux and demux done in cadence with pics
dinesh aitha
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
sravannunna24
 
Protols used in bluetooth
Protols used in bluetoothProtols used in bluetooth
Protols used in bluetooth
Sonali Parab
 
Arm processor
Arm processorArm processor
Arm processor
SHREEHARI WADAWADAGI
 
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
Ronak Chhajed
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
adil raja
 
Embedded C
Embedded CEmbedded C
Compiler in System Programming/Code Optimization techniques in System Program...
Compiler in System Programming/Code Optimization techniques in System Program...Compiler in System Programming/Code Optimization techniques in System Program...
Compiler in System Programming/Code Optimization techniques in System Program...
Janki Shah
 
Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)
Adair Dingle
 
Embedded C - Optimization techniques
Embedded C - Optimization techniquesEmbedded C - Optimization techniques
Embedded C - Optimization techniques
Emertxe Information Technologies Pvt Ltd
 
I2C programming with C and Arduino
I2C programming with C and ArduinoI2C programming with C and Arduino
I2C programming with C and Arduino
sato262
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
Arm developement
Arm developementArm developement
Arm developement
hirokiht
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
Mohamed Abdallah
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
guest9f8315
 
Iot
IotIot

Viewers also liked (18)

Serial peripheral interface
Serial peripheral interfaceSerial peripheral interface
Serial peripheral interface
 
Spi master core verification
Spi master core verificationSpi master core verification
Spi master core verification
 
Mux and demux done in cadence with pics
Mux and demux done in cadence with picsMux and demux done in cadence with pics
Mux and demux done in cadence with pics
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
Protols used in bluetooth
Protols used in bluetoothProtols used in bluetooth
Protols used in bluetooth
 
Arm processor
Arm processorArm processor
Arm processor
 
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Compiler in System Programming/Code Optimization techniques in System Program...
Compiler in System Programming/Code Optimization techniques in System Program...Compiler in System Programming/Code Optimization techniques in System Program...
Compiler in System Programming/Code Optimization techniques in System Program...
 
Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)
 
Embedded C - Optimization techniques
Embedded C - Optimization techniquesEmbedded C - Optimization techniques
Embedded C - Optimization techniques
 
I2C programming with C and Arduino
I2C programming with C and ArduinoI2C programming with C and Arduino
I2C programming with C and Arduino
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
 
Arm developement
Arm developementArm developement
Arm developement
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Iot
IotIot
Iot
 

Similar to Serial Peripheral Interface(SPI)

spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptx
sauryakumar3
 
Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptx
DeepuShah
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
Raghunath reddy
 
UNI T 6- SPI_I2C_Lecture8.pptx
UNI                    T 6- SPI_I2C_Lecture8.pptxUNI                    T 6- SPI_I2C_Lecture8.pptx
UNI T 6- SPI_I2C_Lecture8.pptx
naveen088888
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
ssuser1542b11
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
Chirag Parikh
 
I2 c and mpu6050 basics
I2 c and mpu6050 basicsI2 c and mpu6050 basics
I2 c and mpu6050 basics
ironstein1994
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Игорь Медведев
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
babak danyal
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
Techvilla
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
scmandota
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
RAMPRAKASHT1
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
SKUP1
 
UNIT- 3.pptx
UNIT- 3.pptxUNIT- 3.pptx
UNIT- 3.pptx
BASKARS53
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
A B Shinde
 
SPI Protocol in LPC2148
SPI  Protocol in LPC2148SPI  Protocol in LPC2148
SPI Protocol in LPC2148
Dnyanesh P. Joshi
 
UART SPI and I2C serial Interfaces .pptx
UART SPI and I2C serial Interfaces .pptxUART SPI and I2C serial Interfaces .pptx
UART SPI and I2C serial Interfaces .pptx
rohinitalekar1
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
GurleenKaur408
 
12 mt06ped001
12 mt06ped001 12 mt06ped001
12 mt06ped001
vijaydeepakg
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 

Similar to Serial Peripheral Interface(SPI) (20)

spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptx
 
Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptx
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
UNI T 6- SPI_I2C_Lecture8.pptx
UNI                    T 6- SPI_I2C_Lecture8.pptxUNI                    T 6- SPI_I2C_Lecture8.pptx
UNI T 6- SPI_I2C_Lecture8.pptx
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
I2 c and mpu6050 basics
I2 c and mpu6050 basicsI2 c and mpu6050 basics
I2 c and mpu6050 basics
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
 
UNIT- 3.pptx
UNIT- 3.pptxUNIT- 3.pptx
UNIT- 3.pptx
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
 
SPI Protocol in LPC2148
SPI  Protocol in LPC2148SPI  Protocol in LPC2148
SPI Protocol in LPC2148
 
UART SPI and I2C serial Interfaces .pptx
UART SPI and I2C serial Interfaces .pptxUART SPI and I2C serial Interfaces .pptx
UART SPI and I2C serial Interfaces .pptx
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
12 mt06ped001
12 mt06ped001 12 mt06ped001
12 mt06ped001
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 

More from Dhaval Kaneria

Swine flu
Swine flu Swine flu
Swine flu
Dhaval Kaneria
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
Dhaval Kaneria
 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
Dhaval Kaneria
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architecture
Dhaval Kaneria
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
Dhaval Kaneria
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
Dhaval Kaneria
 
HDMI
HDMIHDMI
Hdmi
HdmiHdmi
open source hardware
open source hardwareopen source hardware
open source hardware
Dhaval Kaneria
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
Dhaval Kaneria
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
Dhaval Kaneria
 
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Dhaval Kaneria
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
Dhaval Kaneria
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
Dhaval Kaneria
 
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
Paper on Optimized AES Algorithm Core Using  FeedBack Architecture Paper on Optimized AES Algorithm Core Using  FeedBack Architecture
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
Dhaval Kaneria
 
PAPER ON MEMS TECHNOLOGY
PAPER ON MEMS TECHNOLOGYPAPER ON MEMS TECHNOLOGY
PAPER ON MEMS TECHNOLOGY
Dhaval Kaneria
 
VIdeo Compression using sum of Absolute Difference
VIdeo Compression using sum of Absolute DifferenceVIdeo Compression using sum of Absolute Difference
VIdeo Compression using sum of Absolute Difference
Dhaval Kaneria
 
Mems technology
Mems technologyMems technology
Mems technology
Dhaval Kaneria
 
Network security
Network securityNetwork security
Network security
Dhaval Kaneria
 
Token bus standard
Token bus standardToken bus standard
Token bus standard
Dhaval Kaneria
 

More from Dhaval Kaneria (20)

Swine flu
Swine flu Swine flu
Swine flu
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architecture
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
HDMI
HDMIHDMI
HDMI
 
Hdmi
HdmiHdmi
Hdmi
 
open source hardware
open source hardwareopen source hardware
open source hardware
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
Manage Xilinx ISE 14.5 licence for Windows 8 and 8.1
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
 
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
Paper on Optimized AES Algorithm Core Using  FeedBack Architecture Paper on Optimized AES Algorithm Core Using  FeedBack Architecture
Paper on Optimized AES Algorithm Core Using FeedBack Architecture
 
PAPER ON MEMS TECHNOLOGY
PAPER ON MEMS TECHNOLOGYPAPER ON MEMS TECHNOLOGY
PAPER ON MEMS TECHNOLOGY
 
VIdeo Compression using sum of Absolute Difference
VIdeo Compression using sum of Absolute DifferenceVIdeo Compression using sum of Absolute Difference
VIdeo Compression using sum of Absolute Difference
 
Mems technology
Mems technologyMems technology
Mems technology
 
Network security
Network securityNetwork security
Network security
 
Token bus standard
Token bus standardToken bus standard
Token bus standard
 

Recently uploaded

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 

Recently uploaded (20)

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 

Serial Peripheral Interface(SPI)

  • 2. Need of Serial Bus Protocol • Peripheral devices in embedded systems => parallel address and data bus => lots of wiring and requires number of pins => additional decoding logic required. • To reduce the pins and wiring => cost => Serial bus protocol => SPI (4-wire) & I2C (2-wire). • Penalty => Slower communication.
  • 3. Various Serial Bus Protocol • UART • SPI –Embedded System Protocol • I2C- Embedded System Protocol • CAN • USB • SATA etc..
  • 4. • The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard named by Motorola that operates in full duplex mode. • Devices 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.
  • 5. •During a data transfer the master always sends 8 to 16 bits of data to the slave, and the slave always sends a byte of data to the master. • Maximum data bit rate is one eighth of the input clock rate.
  • 6. • One Central device (Master), initiates communication with all slaves. • No address decoding logic required. • SPI Master wishes to send the data to slave or request information from the slave, it activates the clock signal. • Master generates information on one line (MOSI) while samples (read) from another line (MISO).
  • 7. SPI Pin Description • SCLK — Serial Clock (output from master) • MOSI — Master Output, Slave Input (output from master) • MISO — Master Input, Slave Output (output from slave) • SS — Slave Select (active low; output from master)
  • 9. Pin Name :SCK (Serial Clock) Type :Input / Output • The SPI used clock signal to synchronize the transfer of data across the SPI interface. • The SCK is always driven by the master and received by the slave, The clock is programmable to be active high or active low. •The SCK is only active during a data transfer. Any other time, it is either in its inactive state, or tri- stated.
  • 10. Pin Name : MISO (Master in Slave out) Type : Input / Output • The MISO signal is a unidirectional signal used to transfer serial data from the slave to the master. • When a device is a slave, serial data is output on this signal. • When a device is a master, serial data is input on this signal. • When a slave device is not selected, the slave drives the signal high impedance.
  • 11. Pin Name : MOSI (Master out Slave in) Type : Input / Output • The MOSI signal is a unidirectional signal used to transfer serial data from the Master to the Slave. •When a device is a Master, serial data is output on this signal. • When a device is a Slave, serial data is input on this signal.
  • 12. Pin Name : SSEL (Slave Select) Type : Input • The SPI slave select signal is an active low signal that indicates which slave is currently selected to participate in a data transfer. • Each slave has its own unique slave select signal input. •The SSEL must be low before data transactions begin and normally stays low for the duration of the transaction. • If the SSEL signal goes high any time during a data transfer, the transfer is considered to be aborted.
  • 13. • In this event, the slave returns to idle, and any data that was received is thrown away. There are no other indications of this exception. •This signal is not directly driven by the master. It could be driven by a simple general purpose I/O under software control. •On the LPC2300 the SSEL pin can be used for a different function when the SPI interface is only used in Master mode. • For example, pin hosting the SSEL function can be configured as an output digital GPIO pin and it is also used to select one of the SPI slaves.
  • 14. Operation • The SPI bus can operate with a single master device and with one or more slave devices. • SPI bus: single master and single slave
  • 15. • If a single slave device is used, the SSEL pin may be fixed to logic low if the slave permits it. • Some slaves require the falling edge (high->low transition) of the slave select to initiate an action such as the MAX1242 by Maxim, an ADC, that starts conversion on said transition.
  • 16. Configuration • Two types multiple slave configuration: • Typical SPI bus: Master and independent Slaves • Daisy-Chained SPI bus: Master and cooperative slaves
  • 17. Typical SPI Bus • With multiple slave devices, an independent SSEL signal is required from the master for each slave device (3).
  • 18. • In the independent slave configuration, there is an independent slave select line for each slave. This is the way SPI is normally used. • Since the MISO pins of the slaves are connected together, they are required to be tri-state pins.
  • 19. Daisy-Chained SPI Bus Daisy-chained SPI bus: Master and Cooperative Slaves
  • 20. • Some products with SPI bus are designed to be capable of being connected in a daisy chain configuration, the first slave output being connected to the second slave input, etc. • The SPI port of each slave is designed to send out during the second group of clock pulses an exact copy of what it received during the first group of clock pulses. •Such a feature only requires a single SSEL line from the master, rather than a separate SSEL line for each slave.
  • 21. Points • Not have ack mechanism to confirm receipt of data and does not have flow control. • SPI Master, not have knowledge of whether slave exist or Not • Not particular addressing scheme. • Not defined any maximum data rate.
  • 22. Data Transmission • A typical hardware setup using two shift registers to form an inter-chip circular buffer
  • 23. • To begin a communication, the master first configures the Clock, using a frequency less than or equal to the maximum frequency the slave device supports. •Such frequencies are commonly in the range of 1-70 MHz. •The master then pulls the slave select SSEL low for the desired chip. •During each SPI clock cycle, a full duplex data transmission occurs.
  • 24. •The master sends a bit on the MOSI line; the slave reads it from that same line • The slave sends a bit on the MISO line; the master reads it from that same line •Transmissions normally involve two shift registers of some given word size, such as eight bits, one in the master and one in the slave; they are connected in a ring.
  • 25. •After that register has been shifted out, the master and slave have exchanged values. •Then each device takes that value and does something with it, such as writing it to memory. • If there are more data to exchange, the shift registers are loaded with new data and the process repeats.
  • 26. Clock Polarity and Phase • In addition to setting the clock frequency, the master must also configure the clock polarity and phase with respect to the data. • SPI Block Guide names these two options as CPOL and CPHA respectively, and most vendors have adopted that convention.
  • 27. A timing diagram showing clock polarity and phase
  • 28. At CPOL=0, the base value of the clock is zero • For CPHA=0, data are read on the clock's rising edge (low->high transition) and data are changed on a falling edge (high->low clock transition). • For CPHA=1, data are read on the clock's falling edge and data are changed on a rising edge.
  • 29. At CPOL=1, the base value of the clock is one (inversion of CPOL=0) • For CPHA=0, data are read on clock's falling edge and data are changed on a rising edge. • For CPHA=1, data are read on clock's rising edge and data are changed on a falling edge.
  • 30. CPOL & CPHA First data driven Other data driven Data Sampled 0 & 0 Prior to first SCK rising edge SCK falling edge SCK rising edge 0 & 1 First SCK rising edge SCK rising edge SCK falling edge 1 & 0 Prior to first SCK falling edge SCK rising edge SCK falling edge 1 & 1 First SCK falling edge SCK falling edge SCK rising edge
  • 32. • 8-bit data transfer, device is master/slave and setting of CPHA variable. •Device, Master => Start of transfer, master having a data ready to transfer. Activate the clock and begin the transfer. •Device, Slave and CPHA=0, transfer start when SSEL=0. •Device, Slave and CPHA=1, transfer starts on first clock edge when slave is selected.
  • 33. Mode Numbers • The combinations of polarity and phases are often referred to as modes Mode CPOL CPHA 0 0 0 1 0 1 2 1 0 3 1 1
  • 34. Register Description • SPI has seven registers, from that programmers interface for SPI peripheral has five registers. • The bits in the rest of two TEST registers are intended for functional verification only.
  • 35. Name Description Access S0SPCR SPI Control Register. This register controls the R/W operation of the SPI. S0SPSR SPI Status Register. This register shows the R0 status of the SPI.
  • 36. Name Description Access S0SPDR SPI Data Register. This bi-directional register provides the R/W transmit and receive data for the SPI.
  • 37. Name Description Access S0SPCCR SPI Clock Counter Register. This register controls the R/W frequency of a master’s SCK S0SPINT SPI Interrupt Flag. This register contains the R/W interrupt flag for the SPI interface.
  • 38. (1) SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 1:0 - Reserved, user software should not write ones to reserved bits.
  • 39. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 2 BitEnable 0 The SPI controller sends and receives 8 bits of data per transfer. 1 The SPI controller sends and receives the number of bits selected by bits 11:8.
  • 40. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 3 CPHA Clock phase control 0 Data is sampled on the first clock edge of SCK. 1 Data is sampled on the second clock edge of the SCK.
  • 41. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 4 CPOL Clock polarity control. 0 SCK is active high. 1 SCK is active low. 5 MSTR Master mode select. 0 The SPI operates in Slave mode. 1 The SPI operates in Master mode.
  • 42. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 6 LSBF LSB First, controls in which direction each byte is shifted when transferred. 0 SPI data is transferred MSB (bit 7) first. 1 SPI data is transferred LSB (bit 0) first.
  • 43. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 7 SPIE Serial peripheral interrupt enable. 0 SPI interrupts are inhibited. 1 A hardware interrupt is generated each time the SPIF or MODF bits are activated.
  • 44. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 11:8 BITS When bit 2 of this register is 1, this field controls the number of bits per transfer: 1000 8 bits per transfer 1001 9 bits per transfer 1010 10 bits per transfer 1011 11 bits per transfer
  • 45. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 1100 12 bits per transfer 1101 13 bits per transfer 1110 14 bits per transfer 1111 15 bits per transfer 0000 16 bits per transfer
  • 46. SPI Control Register (S0SPCR - 0xE002 0000) Bit Symbol Value Description 15:12 - Reserved, user software should not write ones to reserved bits.
  • 47. (2) SPI Data Register (S0SPDR - 0xE002 0008) • This bi-directional data register provides the transmit and receive data for the SPI. • Transmit data is provided to the SPI by writing to this register. • Data received by the SPI can be read from this register.
  • 49. • There is no buffer between the data register and the internal shift register. A write to the data register goes directly into the internal shift register. • Therefore, data should only be written to this register when a transmit is not currently in progress.
  • 50. • Read data is buffered. • When a transfer is complete, the receive data is transferred to a single byte data buffer, where it is later read. • A read of the SPI data register returns the value of the read data buffer.
  • 51. SPI Data Register (S0SPDR - 0xE002 0008) Bit Symbol Description 7:0 DataLow SPI bi-directional data port. 15:8 DataHigh If bit 2 of the SPCR is 1 and bits 11:8 are other than 1000, some or all of these bits contain the additional transmit and receive bits. When less than 16 bits are selected, the most significant among these bits read as zeroes.
  • 52. (3) SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 7 SPIF SPI transfer complete flag. When 1, this bit indicates when a SPI data transfer is complete. When a master, this bit is set at the end of the last cycle of the transfer.
  • 53. SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 7 SPIF SPI transfer complete flag. When a slave, this bit is set on the last data sampling edge of the SCK. This bit is cleared by first reading this register then accessing the SPI data register.
  • 54. SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 6 WCOL Write Collision. When 1, this bit indicates that a write collision has occurred. This bit is cleared by reading this register then accessing the SPI data register.
  • 55. Exception conditions –Write Collision • As stated previously, there is no write buffer between the SPI block bus interface, and the internal shift register. • As a result, data must not be written to the SPI data register when a SPI data transfer is currently in progress.
  • 56. • The time frame where data cannot be written to the SPI data register is from when the transfer starts, until after the status register has been read when the SPIF status is active. •If the SPI data register is written in this time frame, the write data will be lost, and the write collision (WCOL) bit in the status register will be activated.
  • 57. SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 5 ROVR Read overrun. When 1, this bit indicates that a read overrun has occurred. This bit is cleared by reading this register.
  • 58. Exception conditions –Read Overrun • A read overrun occurs when the SPI block internal read buffer contains data that has not been read by the processor, and a new transfer is completed. • The read buffer containing valid data is indicated by the SPIF bit in the status register being active.
  • 59. Exception conditions –Read Overrun •When a transfer completes, the SPI block needs to move the received data to the read buffer. • If the SPIF bit is active (the read buffer is full), the new receive data will be lost, and the read overrun (ROVR) bit in the status register will be activated.
  • 60. SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 4 MODF Mode fault. when 1, this bit indicates that a Mode fault error has occurred. This bit is cleared by reading this register, then writing the SPI Control register.
  • 61. Exception conditions –Mode Fault • If the SSEL signal goes active, when the SPI block is a master, this indicates another master has selected the same device to be a slave. This condition is known as a mode fault. • When a mode fault is detected, the mode fault (MODF) bit in the status register will be activated.
  • 62. SPI Status Register (S0SPSR - 0xE002 0004) Bit Symbol Description 3 ABRT Slave abort. When 1, this bit indicates that a slave abort has occurred. This bit is cleared by reading this register. 2:0 - Reserved, user software should not write ones to reserved bits.
  • 63. Exception conditions –Slave Abort • A slave transfer is considered to be aborted, if the SSEL signal goes inactive before the transfer is complete. • In the event of a slave abort, the transmit and receive data for the transfer that was in progress are lost, and the slave abort(ABRT) bit in the status register will be activated.
  • 64. SPI Interrupt Register (S0SPINT - 0xE002 001C) • This register contains the interrupt flag for the SPI interface. Bit Symbol Description 0 SPI SPI interrupt flag. Set by the SPI Interrupt interface to generate an interrupt. Flag Cleared by writing a 1 to this bit. 7:1 - Reserved, user software should not write ones to reserved bits.
  • 65. SPI Clock Counter Register (S0SPCCR - 0xE002 000C) • This register controls the frequency of a master’s SCK. • The register indicates the number of PCLK cycles that make up an SPI clock. • The value of this register must always be an even number. As a result, bit 0 must always be 0.
  • 66. Configuration • SPI can be configured as MASTER or SLAVE.
  • 67. Configuration - Master operation • The following sequence describes how one should process a data transfer with the SPI block when it is set up to be the master. • This process assumes that any prior data transfer has already completed.
  • 68. Configuration - Master operation 1. Set the SPI Clock counter register to the desired clock rate. 2. Set the SPI Control register to the desired settings. 3. Write the data that transmitted to the SPI data register. This write starts the SPI data transfer.
  • 69. Configuration - Master operation 4. Wait for the SPIF bit in the SPI status register to be set to 1. The SPIF bit will be set after the last cycle of the SPI data transfer. 5. Read the SPI status register.
  • 70. Configuration - Master operation 6. Read the received data from the SPI data register (optional). 7.Go to step 3 if more data is required to transmit.
  • 71. Configuration - Master operation NOTE: • A read or write of the SPI data register is required in order to clear the SPIF status bit. • Therefore, if the optional read of the SPI data register does not take place, a write to this register is required in order to clear the SPIF status bit.
  • 72. Configuration - Slave operation • The following sequence describes how one should process a data transfer with the SPI block when it is set up to be the slave. • This process assumes that any prior data transfer has already completed.
  • 73. Configuration - Slave operation 1. Set the SPI control register to the desired settings. 2. Write the data to transmitted to the SPI data register (optional). Note that this can only be done when a slave SPI transfer is not in progress.
  • 74. Configuration - Slave operation 3. Wait for the SPIF bit in the SPI status register to be set to 1. The SPIF bit will be set after the last sampling clock edge of the SPI data transfer. 4. Read the SPI status register.
  • 75. Configuration - Slave operation 5. Read the received data from the SPI data register (optional). 6. Go to step 2 if more data is required to transmit.
  • 76. Configuration - Slave operation NOTE: • A read or write of the SPI data register is required in order to clear the SPIF status bit. • Therefore, at least one of the optional reads or writes of the SPI data register must take place, in order to clear the SPIF status bit.
  • 77. SPI- Master (C-Code) • #Include <LPC2300.h> • Void init (void) • # define SPIF (1<<7) • # define data 0xC1 • int main () • { • Init(); // function call • While (1) • { • SPDR= data; // write data out • While (!(SPSR& SPIF)) { } • } • } • Void init () // fun declared • { • PINSEL0=0xAA000; (SCK1, SSEL1, MOSI1,MISO1) • VBPDIV=0x1;// set PCLK to same as CCLk • SPCR= 0x20;// device selected master • }
  • 78.
  • 81. Advantages • Full duplex communication • Higher throughput than I²C • Complete protocol flexibility for the bits transferred * Not limited to 8-bit words * Arbitrary choice of message size, content, and purpose
  • 82. Advantages • Extremely simple hardware interfacing * Typically lower power requirements than I²C due to less circuitry * No arbitration or associated failure modes * Slaves use the master's clock, and don't need precision oscillators * Transceivers are not needed
  • 83. Disadvantages • Requires more pins on IC packages than I²C, even in the "3-Wire" variant • No hardware flow control • No hardware slave acknowledgment (the master could be "talking" to nothing and not know it)
  • 84. Disadvantages • Supports only one master device • Only handles short distances compared to RS-232, RS-485, or CAN-bus
  • 85. Applications SPI is used to talk to a variety of peripherals, such as: •Sensors: Temperature, pressure, ADC, touch-screens •Control devices: audio codecs, digital potentiometers, DAC
  • 86. Applications • Memory: flash and EEPROM • Real-time clocks • LCD displays, sometimes even for managing image data • Any MMC or SD card