If you are looking for “SPI interview questions” or “SPI protocol basics, then you at the right place. Previously I have created a list of “embedded c interview questions” that is liked by many people. I have got the response to create a list of interview questions on the “SPI Protocol”. So here I have tried to create some collection of “SPI protocol interview questions” that might ask by your interviewer. I hope these SPI interview questions will be helpful.
Q) What does SPI stand for?
serial peripheral interface. SPI is developed by Motorola.
Q) SPI is serial or parallel communication?
SPI is serial communication. By serially send and receive data in the same line.
Q) What is the SPI communication protocol?
The serial peripheral interface is four wire-based full-duplex communication protocol these wire generally known as MOSI (master out slave in), MISO (master in slave out), SCL (a serial clock which produces by the master) and SS (slave select line which use to select specific slave during the communication).
SPI follows the master and slave architecture and communication is always started by the master. SPI is a synchronous communication protocol because the clock is shared by the master and slave.
SPI is supported only multi-slave does not support multi-master and slaves are selected by the slave select signal. In SPI during the communication data is shifted out from the master and shifted into the slave vice- versa through the shift register.
Q) How many wires are required for SPI communication?
The serial peripheral interface is four wire-based protocol these wire generally known as MOSI (master out slave in), MISO (master in slave out), SCL (serial clock which produces by the master) and SS (slave select line which use to select specific slave during the communication).
Q) What are the 4 logic signals specified by the SPI bus?
The SPI bus specifies four logic signals:
SCLK: Serial Clock (It is produced by the master to start the communication)
MOSI: Master Out, Slave In (This line is used to carry data from the master to the slave)
MISO: Master in, Slave out (This line is used to carry the data from the slave to the master)
SS: Slave Select (This line is used to select the slave in case of the multi-slave communication)
Q) Is it possible to have multiple masters in SPI?
No, SPI has only a single master.
Q) Is it possible to have multiple slaves in SPI?
Yes, SPI supports multiple slaves.
Q) What is the role of the shift register in Master and Slave devices in SPI?
In SPI, shift register are used. Here data is transferring to the slave using the MOSI bus and at the same time receiving the dummy data from the MISO bus and vice versa. Every writes there is dummy read and every read there is dummy write.
Q) Does SPI slave acknowledge the receipt of data?
Nope, SPI doesn’t give any ACK like I2C.
Q) SPI has a higher throughput than I2C – True / False?
SPI is faster than I2C.
Q) Is SPI support duplex communication?
Yes.
Q) Why use SPI?
Unlike the serial com port, SPI is the synchronous communication protocol. In SPI master and slave both shared the same clock and clock is produced by the master. In the case of asynchronous serial communication, every byte consists of a start and stop bits which create extra overhead on communication.
Another disadvantage of serial com port communication is that it needs to maintain clock frequency of the transmitter and receiver ( both not shared the clock). If the frequency of the transmitter and receiver does not match then the receiver will not receive the data transmitted by the transmitter.
Q) SPI is Synchronous or Asynchronous Communication?
SPI is Synchronous Communication.
Q) Does start-stop bit support by SPI?
No.
Q) Does pullup register require in SPI?
No.
Q) Does bus arbitration support by SPI?
No.
Q) Does the clock stretching support by SPI?
No.
Q) What is the difference between SPI and I2C (I2C vs SPI)?
You can see this article, Difference between I2c and SPI
Q) What are the advantages of the SPI communication protocol?
- There is no start and stop bits, so the data can be streamed continuously without interruption.
- It supports full-duplex.
- No need for precision oscillators in slave devices as it uses a master’s clock.
- No complicated slave addressing system like I2C.
- Higher data transfer rate than I2C (almost twice as fast).
- Separate MISO and MOSI lines, so data can be sent and received at the same time.
- Simple software implementation.
Q) What are the disadvantages of the SPI communication protocol?
- If there is more than one slave in communication then the wiring will be complex.
- Uses four wires (I2C and UARTs use two).
- No acknowledgment that the data has been successfully received (I2C has this).
- No form of error checking like the parity bit in UART.
- It only allows for a single master.
Below I am mentioning some unsolved SPI interview Questions for you. If you know the answer, then please write in comment box or email me directly. Your effort will be helpful to others.
Q) Can devices be added and removed while the system is running (Hot swapping) in I2C and SPI?
Q) Is it better to use I2C or SPI for data communication between a microprocessor and DSP?
Q) How to set SPI bus speed in the master device?
Q) What will happens if two SPI slaves same time communicate with Master (two Cs pins are high)?
Q) Is it better to use I2C or SPI for data communication from ADC?
Q) How to set SPI bus speed in the master device?
Q) Does SPI need a baud rate?
Q) What happens when mode fault is enabled in SPI (Serial Peripheral Interface)?
Q) What are the limitations of the SPI interface?
Recommended Post
- Understanding of I2C protocol.
- SPI vs I2C protocol.
- Introduction of SPI communication protocol.
- EEPROM Interfacing with PIC Microcontroller – I2C Based.
- RTC DS1307 Interfacing with PIC Microcontroller.
- Interfacing EEPROM with 8051 Microcontroller – I2C Based.
- 100 embedded C interview Questions.
- 100 C interview Questions.
- I2C interview Questions
- Interview questions on bitwise operators in C
- C++ Interview Questions.
- 10 questions about dynamic memory allocation.
- Can protocol interview questions.
- File handling in C.
- Pointer in C.
- C format specifiers.