SlideShare a Scribd company logo
SPI Bus Protocol
20th April 2018
Sudhanshu Janwadkar, SVNIT
Introduction
• The Serial Peripheral Interface bus (SPI) is
 synchronous
 serial communication interface specification
 used for short distance communication
• The interface was developed by Motorola in 1980s
• SPI devices communicate in full duplex mode using
a master-slave architecture with a single master.
 The master device originates the frame for reading
and writing.
 Multiple slave devices are supported through
selection with individual slave select (SS) lines.
The trouble with asynchronous
protocols
• The common serial port, such as UART, is called
“asynchronous” because there is no control over
when data is sent or any guarantee that both sides
are running at precisely the same rate.
• There can be an issue when two systems with
slightly different clocks try to communicate with
each other.
• To mitigate this issue, asynchronous serial
connections add extra start and stop bits to each
byte, so as to help the receiver sync up to data as it
arrives.
• Both sides must also agree on the same baud rate
in advance.
The trouble with asynchronous
protocols
• Asynchronous serial works just fine, but
 has a lot of overhead in both the extra start and
stop bits sent with every byte
 the complex hardware required to send and receive
data
 if both sides aren’t set to the same speed, the
received data will be garbage. This is because the
receiver is sampling the bits at very specific times If
the receiver is looking at the wrong times, it will see
the wrong bits.
How is ‘synchronous’ beneficial?
• A “synchronous” data bus uses separate lines for
data and clock that keeps both sides in perfect
sync.
• The clock is an oscillating signal that tells the
receiver exactly when to sample the bits on the
data line.
 This could be the rising (low to high) or falling (high
to low) edge of the clock signal; the datasheet will
specify which one to use.
• When the receiver detects that edge, it will
immediately look at the data line to read the next bit
• Because the clock is sent along with the data,
specifying the speed isn’t important, although
devices will have a top speed at which they can
operate
The SPI Protocol - basics
• The SPI bus can operate with a single master
device and with one or more slave devices.
• One unique feature of SPI is that data can be
transferred without interruption.
• Any number of bits can be sent or received in
a continuous stream.
 With I2C and UART, data is sent in packets, limited
to a specific number of bits.
 Start and stop conditions define the beginning and
end of each packet, so the data is interrupted
during transmission.
• Devices communicating via SPI are in a master-
slave relationship.
• In SPI, only one side generates the clock signal
 The side that generates the clock is called the
“master”, and the other side is called the “slave”.
• The master is the controlling device (usually a
microcontroller), while the slave (usually a sensor,
display, or memory chip) takes instruction from the
master.
• There is always only one master but there can be
multiple slaves.
The SPI Protocol - basics
The SPI Interface
The SPI bus specifies four logic signals:
 SCLK: Serial Clock (output from master).
 MOSI: Master Output Slave Input (data output from
master).
 MISO: Master Input Slave Output, or Master In Slave
Out (data output from slave).
 SS: Slave Select (often active low, output from
master).
The SPI Interface
Serial Clock (SCLK)
• SPI is a synchronous communication protocol.
• The clock signal synchronizes the output of data
bits from the master with the sampling of bits by the
slave.
• One bit of data is transferred in each clock cycle,
so the speed of data transfer is determined by the
frequency of the clock signal.
• SPI communication is always initiated by the
master since the master configures and generates
the clock signal.
The SPI Interface
Slave Select
• The master can choose which slave it wants to
communicate to by setting the slave’s CS/SS line to
a low voltage level.
• In the idle, non-transmitting state, the slave select
line is kept at a high voltage level.
 Multiple CS/SS pins may be available on the
master, which allows for multiple slaves to be wired
in parallel.
 If only one CS/SS pin is present, multiple slaves
can be wired to the master by daisy-chaining
The SPI Interface
Multiple Slaves
 Multiple CS/SS pins
are available on the
master
Only one CS/SS pin is
present, multiple slaves
are wired to the master by
daisy-chaining
The Protocol
1. To begin communication, the bus master configures
the clock, using a frequency supported by the slave
device, typically up to a few MHz.
2. The master then selects the slave device with a logic
level 0 on the select line.
 If a waiting period is required, such as for an analog-
to-digital conversion, the master must wait for at
least that period of time before issuing clock cycles.
3. During each SPI clock cycle, a full duplex data
transmission occurs.
 The master sends a bit on the MOSI line and the
slave reads it, while the slave sends a bit on the
MISO line and the master reads it.
The Protocol (summary)
1. The master outputs the clock signal
2. The master switches the SS/CS pin to a low voltage
state, which activates the slave:
The Protocol (summary)
3. The master sends the data one bit at a time to the
slave along the MOSI line. The slave reads the bits
as they are received
4. If a response is needed, the slave returns data one
bit at a time to the master along the MISO line. The
master reads the bits as they are received
Data Transmission in SPI
• Transmissions normally involve two shift registers
of some given word size ( may be 8eight bits), one
in the master and one in the slave
• They are connected in a virtual ring topology.
• Data is usually shifted out with the most-significant
bit first. On the clock edge, both master and slave
shift out a bit and output it on the transmission line
to the counterpart.
Data Transmission in SPI
• On the next clock edge, at each receiver the bit is
sampled from the transmission line and set as a
new least-significant bit of the shift register.
• After the register bits have been shifted out and in,
the master and slave have exchanged register
values.
• If more data needs to be exchanged, the shift
registers are reloaded and the process repeats.
• Transmission may continue for any number of clock
cycles.
• When complete, the master stops toggling the
clock signal, and typically deselects the slave.
Advantages of SPI
• Full duplex
• Push-pull drivers (as opposed to open drain)
provide good signal integrity and high speed
• Higher throughput than I²C or SMBus.
• Not limited to any maximum clock speed, enabling
potentially high speed
• Not limited to 8-bit words
• Slaves use the master's clock and do not need
precision oscillators
• Slaves do not need a unique address — unlike I²C
or GPIB or SCSI
Limitations of SPI
• Requires more pins on IC packages than I²C
• No hardware flow control by the slave (but the
master can delay the next clock edge to slow the
transfer rate)
• No hardware slave acknowledgment (the master
could be transmitting to nowhere and not know it)
• Typically supports only one master device
(depends on device's hardware implementation)
• No error-checking protocol is defined
Applications of SPI
SPI is used to talk to a variety of peripherals, such as
• Sensors: temperature, pressure, ADC,
touchscreens, video game controllers
• Control devices: audio codecs, digital
potentiometers, DAC
• Memory: flash and EEPROM
• Real-time clocks
• LCD, sometimes even for managing image data
• Any MMC or SD card
Review Questions
1. Compare and contrast UART, I2C and SPI, citing
the features, advantages and disadvantages of
each.
2. What are the demerits of asynchronous
communication protocols? How are they overcome
in SPI?
3. List out the Interface signals used in SPI protocol
and brief out their significance.
4. List the set of operations involved in completing a
serial communication using SPI protocol. Draw the
hardware interface, in support.
5. List out the advantages and limitations of SPI
protocol. Also, list some of the applications.

More Related Content

What's hot

I2C BUS PROTOCOL
I2C BUS PROTOCOLI2C BUS PROTOCOL
I2C BUS PROTOCOL
Kashyap Mandaliya
 
axi protocol
axi protocolaxi protocol
axi protocol
Azad Mishra
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)Varun Mahajan
 
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
 
I2 c protocol
I2 c protocolI2 c protocol
I2 c protocol
Azad Mishra
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
Abhijeet kapse
 
AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
Akhil Srivastava
 
Advance Peripheral Bus
Advance Peripheral Bus Advance Peripheral Bus
Advance Peripheral Bus
SIVA NAGENDRA REDDY
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
Corrado Santoro
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
SUNODH GARLAPATI
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
Chirag Parikh
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
Emertxe Information Technologies Pvt Ltd
 
I2C
I2CI2C
Axi protocol
Axi protocolAxi protocol
Axi protocol
Azad Mishra
 
AMBA 3 APB Protocol
AMBA 3 APB ProtocolAMBA 3 APB Protocol
AMBA 3 APB Protocol
Swetha GSM
 
Serial peripheral interface
Serial peripheral interfaceSerial peripheral interface
Serial peripheral interface
Abhijeet kapse
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
SUNODH GARLAPATI
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
Techvilla
 
AXI Protocol.pptx
AXI Protocol.pptxAXI Protocol.pptx
AXI Protocol.pptx
Yazan Yousef
 

What's hot (20)

I2C BUS PROTOCOL
I2C BUS PROTOCOLI2C BUS PROTOCOL
I2C BUS PROTOCOL
 
axi protocol
axi protocolaxi protocol
axi protocol
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)
 
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
 
I2 c protocol
I2 c protocolI2 c protocol
I2 c protocol
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
 
Advance Peripheral Bus
Advance Peripheral Bus Advance Peripheral Bus
Advance Peripheral Bus
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
I2C
I2CI2C
I2C
 
SPI Protocol in LPC2148
SPI  Protocol in LPC2148SPI  Protocol in LPC2148
SPI Protocol in LPC2148
 
Axi protocol
Axi protocolAxi protocol
Axi protocol
 
AMBA 3 APB Protocol
AMBA 3 APB ProtocolAMBA 3 APB Protocol
AMBA 3 APB Protocol
 
Serial peripheral interface
Serial peripheral interfaceSerial peripheral interface
Serial peripheral interface
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
AXI Protocol.pptx
AXI Protocol.pptxAXI Protocol.pptx
AXI Protocol.pptx
 

Similar to SPI Bus Protocol

Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptx
DeepuShah
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
ssuser1542b11
 
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
 
serial_busses_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
SKUP1
 
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
 
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
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
lecture_I2C_SPI.pptx
lecture_I2C_SPI.pptxlecture_I2C_SPI.pptx
lecture_I2C_SPI.pptx
reemasajin1
 
serial.ppt
serial.pptserial.ppt
serial.ppt
jordan307266
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
Arul Kumar
 
Lec 5
Lec 5Lec 5
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Игорь Медведев
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
A B Shinde
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
Aarav Soni
 
SPI AND UART COMMUNICATION PROTOCOLS
SPI AND UART COMMUNICATION PROTOCOLSSPI AND UART COMMUNICATION PROTOCOLS
SPI AND UART COMMUNICATION PROTOCOLS
DHIVYA MANI
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
RAMPRAKASHT1
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
scmandota
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
babak danyal
 

Similar to SPI Bus Protocol (20)

Deepu Kumar Shah.pptx
Deepu Kumar Shah.pptxDeepu Kumar Shah.pptx
Deepu Kumar Shah.pptx
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
 
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_i2c.pptx
serial_busses_i2c.pptxserial_busses_i2c.pptx
serial_busses_i2c.pptx
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
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
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
 
lecture_I2C_SPI.pptx
lecture_I2C_SPI.pptxlecture_I2C_SPI.pptx
lecture_I2C_SPI.pptx
 
serial.ppt
serial.pptserial.ppt
serial.ppt
 
serial.ppt
serial.pptserial.ppt
serial.ppt
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
 
USART
USARTUSART
USART
 
Lec 5
Lec 5Lec 5
Lec 5
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
 
SPI AND UART COMMUNICATION PROTOCOLS
SPI AND UART COMMUNICATION PROTOCOLSSPI AND UART COMMUNICATION PROTOCOLS
SPI AND UART COMMUNICATION PROTOCOLS
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
 

More from Sudhanshu Janwadkar

DSP Processors versus ASICs
DSP Processors versus ASICsDSP Processors versus ASICs
DSP Processors versus ASICs
Sudhanshu Janwadkar
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
Sudhanshu Janwadkar
 
ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)
Sudhanshu Janwadkar
 
Fpga architectures and applications
Fpga architectures and applicationsFpga architectures and applications
Fpga architectures and applications
Sudhanshu Janwadkar
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
Sudhanshu Janwadkar
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
Sudhanshu Janwadkar
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
Sudhanshu Janwadkar
 
Introduction to 8051 Timer/Counter
Introduction to 8051 Timer/CounterIntroduction to 8051 Timer/Counter
Introduction to 8051 Timer/Counter
Sudhanshu Janwadkar
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
Sudhanshu Janwadkar
 
Hardware View of Intel 8051
Hardware View of Intel 8051Hardware View of Intel 8051
Hardware View of Intel 8051
Sudhanshu Janwadkar
 
Architecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 MicrocontrollerArchitecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 Microcontroller
Sudhanshu Janwadkar
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
Sudhanshu Janwadkar
 
CMOS Logic
CMOS LogicCMOS Logic
Interconnects in Reconfigurable Architectures
Interconnects in Reconfigurable ArchitecturesInterconnects in Reconfigurable Architectures
Interconnects in Reconfigurable Architectures
Sudhanshu Janwadkar
 
Introduction to FPGAs
Introduction to FPGAsIntroduction to FPGAs
Introduction to FPGAs
Sudhanshu Janwadkar
 
Design and Implementation of a GPS based Personal Tracking System
Design and Implementation of a GPS based Personal Tracking SystemDesign and Implementation of a GPS based Personal Tracking System
Design and Implementation of a GPS based Personal Tracking System
Sudhanshu Janwadkar
 
Embedded Logic Flip-Flops: A Conceptual Review
Embedded Logic Flip-Flops: A Conceptual ReviewEmbedded Logic Flip-Flops: A Conceptual Review
Embedded Logic Flip-Flops: A Conceptual Review
Sudhanshu Janwadkar
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
Sudhanshu Janwadkar
 
Memory and Processor Testing
Memory and Processor TestingMemory and Processor Testing
Memory and Processor Testing
Sudhanshu Janwadkar
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
Sudhanshu Janwadkar
 

More from Sudhanshu Janwadkar (20)

DSP Processors versus ASICs
DSP Processors versus ASICsDSP Processors versus ASICs
DSP Processors versus ASICs
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)
 
Fpga architectures and applications
Fpga architectures and applicationsFpga architectures and applications
Fpga architectures and applications
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Introduction to 8051 Timer/Counter
Introduction to 8051 Timer/CounterIntroduction to 8051 Timer/Counter
Introduction to 8051 Timer/Counter
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
 
Hardware View of Intel 8051
Hardware View of Intel 8051Hardware View of Intel 8051
Hardware View of Intel 8051
 
Architecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 MicrocontrollerArchitecture of the Intel 8051 Microcontroller
Architecture of the Intel 8051 Microcontroller
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
CMOS Logic
CMOS LogicCMOS Logic
CMOS Logic
 
Interconnects in Reconfigurable Architectures
Interconnects in Reconfigurable ArchitecturesInterconnects in Reconfigurable Architectures
Interconnects in Reconfigurable Architectures
 
Introduction to FPGAs
Introduction to FPGAsIntroduction to FPGAs
Introduction to FPGAs
 
Design and Implementation of a GPS based Personal Tracking System
Design and Implementation of a GPS based Personal Tracking SystemDesign and Implementation of a GPS based Personal Tracking System
Design and Implementation of a GPS based Personal Tracking System
 
Embedded Logic Flip-Flops: A Conceptual Review
Embedded Logic Flip-Flops: A Conceptual ReviewEmbedded Logic Flip-Flops: A Conceptual Review
Embedded Logic Flip-Flops: A Conceptual Review
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Memory and Processor Testing
Memory and Processor TestingMemory and Processor Testing
Memory and Processor Testing
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 

Recently uploaded

How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

SPI Bus Protocol

  • 1. SPI Bus Protocol 20th April 2018 Sudhanshu Janwadkar, SVNIT
  • 2. Introduction • The Serial Peripheral Interface bus (SPI) is  synchronous  serial communication interface specification  used for short distance communication • The interface was developed by Motorola in 1980s • SPI devices communicate in full duplex mode using a master-slave architecture with a single master.  The master device originates the frame for reading and writing.  Multiple slave devices are supported through selection with individual slave select (SS) lines.
  • 3. The trouble with asynchronous protocols • The common serial port, such as UART, is called “asynchronous” because there is no control over when data is sent or any guarantee that both sides are running at precisely the same rate. • There can be an issue when two systems with slightly different clocks try to communicate with each other. • To mitigate this issue, asynchronous serial connections add extra start and stop bits to each byte, so as to help the receiver sync up to data as it arrives. • Both sides must also agree on the same baud rate in advance.
  • 4. The trouble with asynchronous protocols • Asynchronous serial works just fine, but  has a lot of overhead in both the extra start and stop bits sent with every byte  the complex hardware required to send and receive data  if both sides aren’t set to the same speed, the received data will be garbage. This is because the receiver is sampling the bits at very specific times If the receiver is looking at the wrong times, it will see the wrong bits.
  • 5. How is ‘synchronous’ beneficial? • A “synchronous” data bus uses separate lines for data and clock that keeps both sides in perfect sync. • The clock is an oscillating signal that tells the receiver exactly when to sample the bits on the data line.  This could be the rising (low to high) or falling (high to low) edge of the clock signal; the datasheet will specify which one to use. • When the receiver detects that edge, it will immediately look at the data line to read the next bit • Because the clock is sent along with the data, specifying the speed isn’t important, although devices will have a top speed at which they can operate
  • 6. The SPI Protocol - basics • The SPI bus can operate with a single master device and with one or more slave devices. • One unique feature of SPI is that data can be transferred without interruption. • Any number of bits can be sent or received in a continuous stream.  With I2C and UART, data is sent in packets, limited to a specific number of bits.  Start and stop conditions define the beginning and end of each packet, so the data is interrupted during transmission.
  • 7. • Devices communicating via SPI are in a master- slave relationship. • In SPI, only one side generates the clock signal  The side that generates the clock is called the “master”, and the other side is called the “slave”. • The master is the controlling device (usually a microcontroller), while the slave (usually a sensor, display, or memory chip) takes instruction from the master. • There is always only one master but there can be multiple slaves. The SPI Protocol - basics
  • 8. The SPI Interface The SPI bus specifies four logic signals:  SCLK: Serial Clock (output from master).  MOSI: Master Output Slave Input (data output from master).  MISO: Master Input Slave Output, or Master In Slave Out (data output from slave).  SS: Slave Select (often active low, output from master).
  • 9. The SPI Interface Serial Clock (SCLK) • SPI is a synchronous communication protocol. • The clock signal synchronizes the output of data bits from the master with the sampling of bits by the slave. • One bit of data is transferred in each clock cycle, so the speed of data transfer is determined by the frequency of the clock signal. • SPI communication is always initiated by the master since the master configures and generates the clock signal.
  • 10. The SPI Interface Slave Select • The master can choose which slave it wants to communicate to by setting the slave’s CS/SS line to a low voltage level. • In the idle, non-transmitting state, the slave select line is kept at a high voltage level.  Multiple CS/SS pins may be available on the master, which allows for multiple slaves to be wired in parallel.  If only one CS/SS pin is present, multiple slaves can be wired to the master by daisy-chaining
  • 11. The SPI Interface Multiple Slaves  Multiple CS/SS pins are available on the master Only one CS/SS pin is present, multiple slaves are wired to the master by daisy-chaining
  • 12. The Protocol 1. To begin communication, the bus master configures the clock, using a frequency supported by the slave device, typically up to a few MHz. 2. The master then selects the slave device with a logic level 0 on the select line.  If a waiting period is required, such as for an analog- to-digital conversion, the master must wait for at least that period of time before issuing clock cycles. 3. During each SPI clock cycle, a full duplex data transmission occurs.  The master sends a bit on the MOSI line and the slave reads it, while the slave sends a bit on the MISO line and the master reads it.
  • 13. The Protocol (summary) 1. The master outputs the clock signal 2. The master switches the SS/CS pin to a low voltage state, which activates the slave:
  • 14. The Protocol (summary) 3. The master sends the data one bit at a time to the slave along the MOSI line. The slave reads the bits as they are received 4. If a response is needed, the slave returns data one bit at a time to the master along the MISO line. The master reads the bits as they are received
  • 15. Data Transmission in SPI • Transmissions normally involve two shift registers of some given word size ( may be 8eight bits), one in the master and one in the slave • They are connected in a virtual ring topology. • Data is usually shifted out with the most-significant bit first. On the clock edge, both master and slave shift out a bit and output it on the transmission line to the counterpart.
  • 16. Data Transmission in SPI • On the next clock edge, at each receiver the bit is sampled from the transmission line and set as a new least-significant bit of the shift register. • After the register bits have been shifted out and in, the master and slave have exchanged register values. • If more data needs to be exchanged, the shift registers are reloaded and the process repeats. • Transmission may continue for any number of clock cycles. • When complete, the master stops toggling the clock signal, and typically deselects the slave.
  • 17. Advantages of SPI • Full duplex • Push-pull drivers (as opposed to open drain) provide good signal integrity and high speed • Higher throughput than I²C or SMBus. • Not limited to any maximum clock speed, enabling potentially high speed • Not limited to 8-bit words • Slaves use the master's clock and do not need precision oscillators • Slaves do not need a unique address — unlike I²C or GPIB or SCSI
  • 18. Limitations of SPI • Requires more pins on IC packages than I²C • No hardware flow control by the slave (but the master can delay the next clock edge to slow the transfer rate) • No hardware slave acknowledgment (the master could be transmitting to nowhere and not know it) • Typically supports only one master device (depends on device's hardware implementation) • No error-checking protocol is defined
  • 19. Applications of SPI SPI is used to talk to a variety of peripherals, such as • Sensors: temperature, pressure, ADC, touchscreens, video game controllers • Control devices: audio codecs, digital potentiometers, DAC • Memory: flash and EEPROM • Real-time clocks • LCD, sometimes even for managing image data • Any MMC or SD card
  • 20. Review Questions 1. Compare and contrast UART, I2C and SPI, citing the features, advantages and disadvantages of each. 2. What are the demerits of asynchronous communication protocols? How are they overcome in SPI? 3. List out the Interface signals used in SPI protocol and brief out their significance. 4. List the set of operations involved in completing a serial communication using SPI protocol. Draw the hardware interface, in support. 5. List out the advantages and limitations of SPI protocol. Also, list some of the applications.