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
-1
votes
1 answer

tcan4x5x driver returns -22 probe failed error

I am using tcan4x5x driver in Linux kernel v4.14.98, I am facing the below issue [ 27.788175] tcan4x5x spi0.0: Unsupported version number: 0 [ 28.034275] [] tcan4x5x_can_probe+0x318/0x550 [ 28.085188] []…
Aysha
  • 39
  • 2
-1
votes
1 answer

Max message length for different transmission mediums

I have three interfaces: RS422 SPI Ethernet I’m looking to generate and transmit a variable length message over the interfaces at rates up to 2KHz. I want to code checks to make sure that my output message length can be transmitted at the selected…
Joe
  • 63
  • 6
-1
votes
1 answer

What is the difference between USART and SPI communication?

While reading about USART peripheral in STM32 bluepill, I realized that USART is similar to SPI. I have searched for the differences but I don't find any. Please, clearly explain the need for these two different protocols.
Hema Latha
  • 25
  • 3
-1
votes
1 answer

Does External ADC slows down microcontroller?

I am connecting external ADC to STM32L0 Microcontroller using SPI interface . Will it be slower than using internal ADC . External ADC might be faster but does SPI interface acts as a bottelneck. Or any other way round to use external ADC
G.ONE
  • 507
  • 1
  • 5
  • 14
-1
votes
1 answer

Creating new epaper library for atmega32 without arduino

i want to create new library for my e-paper using atmega32 and eclipse enviroment. What do i have to know about it moreover how it works. I dont want to use arduino libraries, want to write it on my own. How to best start making it? I know how to…
weissvhdl
  • 17
  • 1
  • 5
-1
votes
1 answer

How to read data from external ADC MAX144 using STM32 microcontroller

I am facing a problem for last week in reading data from external ADC MAX144 using SPI and STM32L452. The confusion is how to receive data in buffer as there is no memory address or control register address is mentioned in the datasheet of ADC. The…
-1
votes
1 answer

example for low layer fatfs for spi flash

I want to launch the FatFs file system library for SPI FLASH memory. I need an example or a guide to port the low layer of the this library. FatFs Link: http://elm-chan.org/fsw/ff/00index_e.html SPI FLASH Part number: W25Q64FV MCU Type: STM32F107VC
-1
votes
1 answer

Why spi.recieve() function always return zero in SPI of mbed?

I want to set up a SPI connection between two mbed boards and I found that the spi.recieve() function which is used to detect the data transmission from the master always return zero and the connection can't be established. I try to remove 'if' in…
szl0834
  • 13
  • 4
-1
votes
1 answer

Embedded C (SPI Bitbang Code) Left Shift Confusion?

So Im writing a bitbang SPI sample code for AVR (So I can understand using SPI better and appreciate the SPI hardware), and im a bit confused at some things. From what I've read on SPI, you shift out the LSB first from master....but im not sure how…
msmith1114
  • 2,717
  • 3
  • 33
  • 84
-1
votes
1 answer

DRDY PIC18F45K80 to QT1481

I also have a problem with DRDY. I need to include DRDY. The pins for DRDY are RD2 and RD5. They are both inputs. Here is the information for DRDY. DRDY Pin DRDY is an open-drain output (in SPI mode) or bidirectional pin (in UART mode) with an…
M2T156
  • 61
  • 6
-1
votes
1 answer

SPI and I2C Protocol Detection in Qt

I have made a logic analyzer board and transport it's data trough USB to PC. In the PC side, I have a Qt App to Receive data. My Question is: How to analyze Protocols like SPI, I2C, etc in my Qt App to find ACK, NAK and more? Is there any proper…
javad_
  • 11
  • 2
-1
votes
2 answers

Do you recommend TTL, SPI or I2C with SunSPOT

I am starting to try to interface with some external components (Skyetek M1 Mini or M1 RFID scanner) than supports the following protocols TTL, SPI or I2C. I am wondering which one of these routes you would recommend. The app that is running on the…
smaclell
  • 4,568
  • 7
  • 41
  • 49
-1
votes
3 answers

String becomes empty in an Arduino SPI transfer code

I'm new to Arduino and I'm trying to transfer data using SPI from one Arduino to another. I'm having a problem with sending an array of characters (C string). First, I think the problem is in defining the string itself (since I tried to serially…
hamze issa
  • 13
  • 3
-1
votes
1 answer

Using Raspberry Pi3 as Lora gateway

I'm trying to use Pi3 as my LoRa gateway with sx1276 LoRa modules. The module with sx1276 chip and single channel connect via SPI interface. Test with Arduino are work great. Both send and receive are success. But there's some problem when I was…
Sam Chou
  • 27
  • 3
-1
votes
1 answer

Getting noice before the right byte comes SPI RFID

I try to read byte from RFID which represents version number of the device. Using SPI protocol I get 0x92 byte (RC522 Version 2.0), and request byte is 0x37. Everything works well except the positions of the byte. Before I get the right one (0x92)…
Giorgi Gvimradze
  • 1,714
  • 1
  • 17
  • 34