Questions tagged [spi]

Serial Peripheral Interface (SPI) is a serial, synchronous bus commonly used in embedded systems. It is most often used for communication between a microcontroller and peripheral hardware such as memories, shift registers, sensors, displays etc, but can also be used for MCU to MCU communication.

Serial Peripheral Interface (SPI) is a serial, synchronous, full duplex bus commonly used in embedded systems. It is most often used for communication between a microcontroller and peripheral hardware such as memories, shift registers, sensors, displays etc, but can also be used for MCU to MCU communication.

SPI was originally developed by Motorola as a hardware peripheral in their microcontroller products. It has become an industry de facto standard and pretty much every MCU made today has got hardware support for SPI. It is however possible to implement SPI without hardware support: a software-controlled SPI communication can be created by using only general-purpose I/O pins, so called "bit-banging".

SPI can be used either as a point-to-point communication between one node called master and another called slave, or as a system with one master and multiple slaves. The latter can be achieved by using either multiplexer circuitry on the slave select line or a so-called daisy chain implementation.

SPI consists of 4 digital signals:

  • MOSI, Master Output Slave Input. Data line for transmission from the master to the slave.
  • MISO, Master Input Slave Output. Data line for transmission from the slave to the master.
  • SCLK, Serial Clock (sometimes called SCK or just CLK)). The clock used for all synchronization, generated by the master.
  • SS, Slave Select. Chip select for the slave(s), active low signal.

Tag usage

Use this tag in combination with and the tag for the MCU being used, if applicable. For hardware-related questions, use https://electronics.stackexchange.com.


References

1385 questions
27
votes
3 answers

UART vs I2C vs SPI for inter-processor communication between microcontrollers

I am examining a way to connect two microcontrollers. On the level of serialization I am thinking of using Nano protobuffers (http://code.google.com/p/nanopb/). This way I can encode/decode messages and send them between two processors. Basically,…
Drasko DRASKOVIC
  • 343
  • 1
  • 3
  • 8
14
votes
4 answers

Serial versus SPI

What is the difference between SPI and serial? In reading an article talking about inter-processor communications, it states that serial interfaces are being replaced with SPI for better/faster comms? What exactly is the difference?
jbh
  • 1,153
  • 2
  • 11
  • 24
13
votes
1 answer

What is MODULE_ALIAS in Linux device driver code?

Explanation for MODULE_ALIAS in the code says /* work with hotplug and coldplug */ MODULE_ALIAS("platform:omap2_mcspi"); But, what exactly is MODULE_ALIAS? Is there a significance for : (colon) in the argument?
Sagar Jain
  • 7,475
  • 12
  • 47
  • 83
12
votes
3 answers

Initializing SD card in SPI issues

I've had a look at Stack Overflow question Initialization of a microSD card using an SPI interface and didn't see any answers that matched my issue (that is, things I haven't already tried). I have a similar issue where I'm trying to access a SD…
Sembazuru
  • 451
  • 1
  • 3
  • 10
12
votes
2 answers

What makes SPI faster than I2C protocol

I know the basic of I2C and SPI communication. As both are synchronous protocol. I wanted to know that what makes SPI faster than I2C. If I am not wrong using I2C we can go used 400kbps while in SPI we can achieve 10mbps also. Does it because of…
kapilddit
  • 1,729
  • 4
  • 26
  • 51
11
votes
2 answers

Chip to chip communication protocol over SPI

I'm trying to design an efficient communication protocol between a micro-controller on one side and an ARM processor on a multi-core TI chip on the other side through SPI. The requirements for the needed protocol: 1 - Multi-session with queuing…
Wessam
  • 111
  • 1
  • 1
  • 7
10
votes
1 answer

How does processor read BIOS from SPI flash?

A typical x86 systems has firmware (aka BIOS or UEFI) stored in a SPI based Flash chip. When the power-on happens, the processor starts executing at Reset Vector which is pointing to memory-mapped SPI chip where BIOS is stored. From here onwards,…
Naveen
  • 7,944
  • 12
  • 78
  • 165
10
votes
5 answers

An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene54' does not exist

With lucene-core-5.5.2 i am facing problem a in weblogic server. standalone search application works but when i deploy as WEB APP it is failing with below error Exception type is 'java.lang.ExceptionInInitializerError'. Runtime error:…
Amol
  • 101
  • 1
  • 3
9
votes
2 answers

Linux, spidev: why it shouldn't be directly in devicetree?

I want to define a SPI device with usermode access, as explained for example in http://linux-sunxi.org/SPIdev Following these examples, I added in the devicetree this : &ecspi1 { .... other stuff ... mydev@0 { compatible = "spidev"; …
ddbug
  • 1,392
  • 1
  • 11
  • 25
9
votes
1 answer

spidev cannot control the chip select signal

I use kernel 3.12.rc4 on an embedded linux device (olimex imx233 micro). My aim is to use /dev/spidev to be able to communicate with another spi device. I edit arch/arm/boot/dts/imx23-olinuxino.dts as: ssp1: ssp@80034000 { #address-cells = <1>; …
sven
  • 1,101
  • 7
  • 21
  • 44
8
votes
1 answer

SDHC microSD card and SPI initialization

I have a 32 GB Kingston SDHC microSD card which has to communicate to MSP430F2618 via SPI. I was not able to initialize it by using CMD55 + ACMD41 (with bit30 set to 1), as it is described in SD specification paper. What works is this sequence: …
user1039871
  • 81
  • 1
  • 2
8
votes
1 answer

SPI transaction terminates early - ESP-IDF

An ESP32 app using ESP-IDF (ESP32 SDK) communicates with two SPI slaves on the same SPI bus (ILI9341 TFT driver, NRF24L01+ RF transceiver). Overall, it works great. However, some of the data received from the RF transceiver is truncated, i.e. only…
Codo
  • 75,595
  • 17
  • 168
  • 206
8
votes
4 answers

How can I use hardware NSS (SPI) on STM32F4?

I tried to use the hardware NSS signal with the HAL library, but I can't find any function to make the NSS pin have a low or high level. I also tried to find the answer in the HAL documentation, but there isn't any information there either. All…
mkom
  • 103
  • 1
  • 1
  • 8
8
votes
1 answer

STM32 DMA transfer error

I use STM32F407VTG6 controller and try to receive data from SPI using DMA. Then I want to process data on DMA Complete Transfer Interrupt. But when Complete Transfer Interrupt is occurred I see that TEIF (transfer error interrupt flag) is set. After…
Goshik
  • 83
  • 1
  • 1
  • 5
8
votes
1 answer

Who calls "probe" function in driver code?

I am trying to understand this driver code of mcspi for omap2 panda board. I don't understand who calls the probe function and what is the call chain in this driver code? How does the driver is informed when the device is connected?
Sagar Jain
  • 7,475
  • 12
  • 47
  • 83
1
2 3
92 93