SlideShare a Scribd company logo
1 of 17
(SPI / Serial Peripheral Interface)
Linga Reddy Cenkeramaddi
Department of ICT
UiA, Grimstad
September 2022
IKT455-G
Introduction to Embedded
and Edge Computing
Systems
Serial Peripheral Interface
 What is it?
 Basic SPI
 Capabilities
 Protocol
 Pros and Cons
 Uses
2
Serial Peripheral Interface
http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/
SPI_single_slave.svg/350px-SPI_single_slave.svg.png
What is SPI?
 Serial bus protocol
 Fast, easy to use, and simple
 Very widely used
 Not “standardized”
3
SPI Basics
 A 4-wire communications bus
 Typically communicate across short distances
 Supports
 Single master
 Multiple slaves
 Synchronized
 Communications are “clocked”
4
SPI Capabilities
 Always full-duplex
 Communicates in both directions simultaneously
 Transmitted (or received) data may not be meaningful
 Multiple Mbps transmission speeds
 0-50 MHz clock speeds not uncommon
 Transfer data in 4 to 16 bit characters
 Supports multiple slaves
5
SPI bus wiring
 Bus wires
 Master-Out, Slave-In (MOSI)
 Master-In, Slave-Out (MISO)
 System Clock (SCLK)
 Slave Select/Chip Select (SS1#, …, SS#n or CS1, …, CSn)
 Master asserts slave/chip select line
 Master generates clock signal
 Shift registers shift data in and out
6
SPI signal functions
 MOSI – carries data out of master to slave
 MISO – carries data out of slave to master
 Both MOSI and MISO are active during every transmission
 SS# (or CS) – unique line to select each slave chip
 SCLK – produced by master to synchronize transfers
7
SPI uses a “shift register” model of communications
8
Master shifts out data to Slave, and shifts in data from Slave
http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/SPI_8-bit_circular_transfer.svg/400px-SPI_8-bit_circular_transfer.svg.png
Two bus configuration models
9
Master and multiple independent
slaves
http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/SPI_three_sla
ves.svg/350px-SPI_three_slaves.svg.png
Master and multiple daisy-
chained slaves
http://www.maxim-ic.com/appnotes.cfm/an_pk/3947
Some wires have been renamed
SPI clocking: there is no “standard way”
 Four clocking “modes”
 Two phases
 Two polarities
 Master and selected slave must be in the same mode
 During transfers with slaves A and B, Master must
 Configure clock to Slave A’s clock mode
 Select Slave A
 Do transfer
 Deselect Slave A
 Configure clock to Slave B’s clock mode
 Select Slave B
 Do transfer
 Deselect Slave B
 Master reconfigures clock mode on-the-fly! 10
SPI timing diagram
11
Timing Diagram – Showing Clock polarities and phases
http://www.maxim-ic.com.cn/images/appnotes/3078/3078Fig02.gif
SPI timing diagram
12
Timing Diagram – Showing Clock polarities and phases
 Depending on CPOL parameter, SPI clock
may be inverted or non-inverted.
 CPHA parameter is used to shift the
sampling phase. If CPHA=0 the data are
sampled on the leading (first) clock edge. If
CPHA=1 the data are sampled on the
trailing (second) clock edge, regardless of
whether that clock edge is rising or falling.
SPI timing diagram
13
Timing Diagram – Showing Clock polarities and phases
 Depending on CPOL parameter, SPI clock
may be inverted or non-inverted.
 CPHA parameter is used to shift the
sampling phase. If CPHA=0 the data are
sampled on the leading (first) clock edge. If
CPHA=1 the data are sampled on the
trailing (second) clock edge, regardless of
whether that clock edge is rising or falling.
SPI timing diagram
14
Timing Diagram – Showing Clock polarities and phases
 Depending on CPOL parameter, SPI clock
may be inverted or non-inverted.
 CPHA parameter is used to shift the
sampling phase. If CPHA=0 the data are
sampled on the leading (first) clock edge. If
CPHA=1 the data are sampled on the
trailing (second) clock edge, regardless of
whether that clock edge is rising or falling.
SPI timing diagram
15
Timing Diagram – Showing Clock polarities and phases
 Depending on CPOL parameter, SPI clock
may be inverted or non-inverted.
 CPHA parameter is used to shift the
sampling phase. If CPHA=0 the data are
sampled on the leading (first) clock edge. If
CPHA=1 the data are sampled on the
trailing (second) clock edge, regardless of
whether that clock edge is rising or falling.
SPI tradeoffs: the pros and cons
 Pros
 Fast for point-to-point connections
 Easily allows streaming/constant data inflow
 No addressing in protocol, so it’s simple to implement
 Broadly supported
 Cons
 Slave select/chip select makes multiple slaves more complex
 No acknowledgement (can’t tell if clocking in garbage)
 No inherent arbitration
 No flow control (must know slave speed)
16
SPI is used everywhere!
 Peripherals
 LCDs
 Sensors
 Radios
 Lots of other chips
 Microcontrollers
 Almost all MCUs have SPI masters
 Some have SPI slaves
17

More Related Content

What's hot

AHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxAHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxGuckChick
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceAnurag Tomar
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolAditya Porwal
 
23. serial and parallel data communication
23. serial and parallel data communication23. serial and parallel data communication
23. serial and parallel data communicationsandip das
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationMOHIT AGARWAL
 
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 ProtocolAnkur Soni
 
UART Communication
UART CommunicationUART Communication
UART Communicationdattatraya1
 
ARM architcture
ARM architcture ARM architcture
ARM architcture Hossam Adel
 

What's hot (20)

SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
AHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxAHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptx
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
UART
UARTUART
UART
 
I2C
I2CI2C
I2C
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
23. serial and parallel data communication
23. serial and parallel data communication23. serial and parallel data communication
23. serial and parallel data communication
 
I2C
I2CI2C
I2C
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output Organization
 
Amba bus
Amba busAmba bus
Amba bus
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
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
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
 
dual-port RAM (DPRAM)
dual-port RAM (DPRAM)dual-port RAM (DPRAM)
dual-port RAM (DPRAM)
 
AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
 
axi protocol
axi protocolaxi protocol
axi protocol
 
Axi
AxiAxi
Axi
 
UART Communication
UART CommunicationUART Communication
UART Communication
 
ARM architcture
ARM architcture ARM architcture
ARM architcture
 

Similar to SPI.ppt

100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...
100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...
100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...rahulmonikasharma
 
Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepuShah
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Aarav Soni
 
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDLAREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDLIAEME Publication
 
MIPI DevCon 2016: Implementing MIPI C-PHY
MIPI DevCon 2016: Implementing MIPI C-PHYMIPI DevCon 2016: Implementing MIPI C-PHY
MIPI DevCon 2016: Implementing MIPI C-PHYMIPI Alliance
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemsRaghunath reddy
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral InterfaceChirag Parikh
 
Chapter 5 Routing.pptx
Chapter 5 Routing.pptxChapter 5 Routing.pptx
Chapter 5 Routing.pptxAyaanMohamed4
 
SRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSaqibAli696638
 
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPROIDEA
 
spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptxsauryakumar3
 
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptx
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptxCCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptx
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptxManishkumarSharma338257
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptxSKUP1
 
MPLS SDN 2015 - SPRING interoperability testing
MPLS SDN 2015 - SPRING interoperability testingMPLS SDN 2015 - SPRING interoperability testing
MPLS SDN 2015 - SPRING interoperability testingStephane Litkowski
 

Similar to SPI.ppt (20)

100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...
100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...
100 MHz High Speed SPI Master: Design, Implementation and Study on Limitation...
 
Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptx
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
 
10_2Starting with serial_II.ppt
10_2Starting with serial_II.ppt10_2Starting with serial_II.ppt
10_2Starting with serial_II.ppt
 
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDLAREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
 
MIPI DevCon 2016: Implementing MIPI C-PHY
MIPI DevCon 2016: Implementing MIPI C-PHYMIPI DevCon 2016: Implementing MIPI C-PHY
MIPI DevCon 2016: Implementing MIPI C-PHY
 
Spi
SpiSpi
Spi
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
Chapter 5 Routing.pptx
Chapter 5 Routing.pptxChapter 5 Routing.pptx
Chapter 5 Routing.pptx
 
SRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptx
 
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
 
spi-180501092933-converted.pptx
spi-180501092933-converted.pptxspi-180501092933-converted.pptx
spi-180501092933-converted.pptx
 
Ns lecture3: Introduction to Multi Protocol Label Switching(MPLS)
Ns lecture3: Introduction to Multi Protocol Label Switching(MPLS) Ns lecture3: Introduction to Multi Protocol Label Switching(MPLS)
Ns lecture3: Introduction to Multi Protocol Label Switching(MPLS)
 
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptx
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptxCCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptx
CCNA_RSE_Chp3_Dynamic Routing NETWORKINGFBU.pptx
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
 
Flip flo ps
Flip flo psFlip flo ps
Flip flo ps
 
MPLS SDN 2015 - SPRING interoperability testing
MPLS SDN 2015 - SPRING interoperability testingMPLS SDN 2015 - SPRING interoperability testing
MPLS SDN 2015 - SPRING interoperability testing
 
Cd36479483
Cd36479483Cd36479483
Cd36479483
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 

Recently uploaded (20)

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 

SPI.ppt

  • 1. (SPI / Serial Peripheral Interface) Linga Reddy Cenkeramaddi Department of ICT UiA, Grimstad September 2022 IKT455-G Introduction to Embedded and Edge Computing Systems
  • 2. Serial Peripheral Interface  What is it?  Basic SPI  Capabilities  Protocol  Pros and Cons  Uses 2 Serial Peripheral Interface http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/ SPI_single_slave.svg/350px-SPI_single_slave.svg.png
  • 3. What is SPI?  Serial bus protocol  Fast, easy to use, and simple  Very widely used  Not “standardized” 3
  • 4. SPI Basics  A 4-wire communications bus  Typically communicate across short distances  Supports  Single master  Multiple slaves  Synchronized  Communications are “clocked” 4
  • 5. SPI Capabilities  Always full-duplex  Communicates in both directions simultaneously  Transmitted (or received) data may not be meaningful  Multiple Mbps transmission speeds  0-50 MHz clock speeds not uncommon  Transfer data in 4 to 16 bit characters  Supports multiple slaves 5
  • 6. SPI bus wiring  Bus wires  Master-Out, Slave-In (MOSI)  Master-In, Slave-Out (MISO)  System Clock (SCLK)  Slave Select/Chip Select (SS1#, …, SS#n or CS1, …, CSn)  Master asserts slave/chip select line  Master generates clock signal  Shift registers shift data in and out 6
  • 7. SPI signal functions  MOSI – carries data out of master to slave  MISO – carries data out of slave to master  Both MOSI and MISO are active during every transmission  SS# (or CS) – unique line to select each slave chip  SCLK – produced by master to synchronize transfers 7
  • 8. SPI uses a “shift register” model of communications 8 Master shifts out data to Slave, and shifts in data from Slave http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/SPI_8-bit_circular_transfer.svg/400px-SPI_8-bit_circular_transfer.svg.png
  • 9. Two bus configuration models 9 Master and multiple independent slaves http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/SPI_three_sla ves.svg/350px-SPI_three_slaves.svg.png Master and multiple daisy- chained slaves http://www.maxim-ic.com/appnotes.cfm/an_pk/3947 Some wires have been renamed
  • 10. SPI clocking: there is no “standard way”  Four clocking “modes”  Two phases  Two polarities  Master and selected slave must be in the same mode  During transfers with slaves A and B, Master must  Configure clock to Slave A’s clock mode  Select Slave A  Do transfer  Deselect Slave A  Configure clock to Slave B’s clock mode  Select Slave B  Do transfer  Deselect Slave B  Master reconfigures clock mode on-the-fly! 10
  • 11. SPI timing diagram 11 Timing Diagram – Showing Clock polarities and phases http://www.maxim-ic.com.cn/images/appnotes/3078/3078Fig02.gif
  • 12. SPI timing diagram 12 Timing Diagram – Showing Clock polarities and phases  Depending on CPOL parameter, SPI clock may be inverted or non-inverted.  CPHA parameter is used to shift the sampling phase. If CPHA=0 the data are sampled on the leading (first) clock edge. If CPHA=1 the data are sampled on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling.
  • 13. SPI timing diagram 13 Timing Diagram – Showing Clock polarities and phases  Depending on CPOL parameter, SPI clock may be inverted or non-inverted.  CPHA parameter is used to shift the sampling phase. If CPHA=0 the data are sampled on the leading (first) clock edge. If CPHA=1 the data are sampled on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling.
  • 14. SPI timing diagram 14 Timing Diagram – Showing Clock polarities and phases  Depending on CPOL parameter, SPI clock may be inverted or non-inverted.  CPHA parameter is used to shift the sampling phase. If CPHA=0 the data are sampled on the leading (first) clock edge. If CPHA=1 the data are sampled on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling.
  • 15. SPI timing diagram 15 Timing Diagram – Showing Clock polarities and phases  Depending on CPOL parameter, SPI clock may be inverted or non-inverted.  CPHA parameter is used to shift the sampling phase. If CPHA=0 the data are sampled on the leading (first) clock edge. If CPHA=1 the data are sampled on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling.
  • 16. SPI tradeoffs: the pros and cons  Pros  Fast for point-to-point connections  Easily allows streaming/constant data inflow  No addressing in protocol, so it’s simple to implement  Broadly supported  Cons  Slave select/chip select makes multiple slaves more complex  No acknowledgement (can’t tell if clocking in garbage)  No inherent arbitration  No flow control (must know slave speed) 16
  • 17. SPI is used everywhere!  Peripherals  LCDs  Sensors  Radios  Lots of other chips  Microcontrollers  Almost all MCUs have SPI masters  Some have SPI slaves 17