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

Arduino function changes argument for no reason

I wrote a class for Aduino, for reading an ads124x, and I am having one major problem, I can't call a function defined by the class. Here is how it is structured: .ino calls functions using . operator .h contains register map and class…
user169808
  • 503
  • 1
  • 6
  • 27
-1
votes
1 answer

Syntax error, unexpected non-printable character with the hex value '0xa0'

i see this error when compile slave module,how to fix it? ** Error: (vlog-13067) C:/Users/Ali/Desktop/Spi/spi_slave.v(2.0): Syntax error, unexpected non-printable character with the hex value '0xa0'. here is my code: Visit…
-1
votes
1 answer

Using SPI to multiple device

As we know that, to connecting Arduino Uno with Ethernet Shield (W5100) is using pin 10, 11, 12, 13 (SPI). Is it possible to use Arduino Uno SPI to state up multiple Ethernet Shields? (at least 2 Ethernet Shields) Thank you.
Rey
  • 29
  • 1
  • 8
-1
votes
4 answers

How can I broadcast data to multiple SPI slaves and how it works?

I know basic SPI protocol and its master to slave operations. I want to know that is it possible to broadcast data on multiple slave? If it is possible then how it works. I've heard that after writing to any SPI slave you have to read from slave…
Nilesh Vora
  • 191
  • 1
  • 3
  • 14
-1
votes
1 answer

HAL SPI DMA check how many bytes received during operation

I am transferring 10 bytes from master to slave over SPI+DMA with HAL. How can I check whether how many bytes the receiver has at that moment and if all the 10 byte has not been received then stops the process again. Because the master after sending…
Aashram
  • 13
  • 1
  • 6
-1
votes
1 answer

How to read 32 bits variable from Software SPI in ATmega32?

it is my first try to set up SPI communication on ATmega32 and MAX31855. I've to read 32 bits from MAX31855 datasheet. I have writen my own function but it seems to read 0 all time (I have checked it on display). Here are my definitions from *.h…
Nichten
  • 85
  • 1
  • 2
  • 13
-1
votes
1 answer

GSM & SD not working together Arduino

I am trying to make a GSM shield work together with an SD shield i.e. everytime a message is received it should be saved to the SD card. However this doesn't seem to work. The strange thing is errors seem to pop up at different places each time.…
Daan
  • 129
  • 4
-1
votes
1 answer

RFID (SoftwareSerial) influences/breaks connection with SD (SPI)

I'm creating a RFID logger with Arduino. I connected a RFID scanner, RTC module and a SD card reader. All parts are working fine together but when i started combining different sketches a problem occured. Reading files and writing to files on the SD…
Jef Gys
  • 13
  • 3
-1
votes
1 answer

AVR Atmega8 Serial Communication

I am posting this question after not getting any sort of help across the web and reading many articles and tutorials. I ended up asking questions with hope of getting guided. DESPERATE FOR HELP. What i want: 1) I want to build a R/C tank. 2)…
-1
votes
3 answers

How to Access Kernel Function

I have written SPI character device driver in kernel space. I can now able to communicate through the following function from user space. 1.open("/dev/rfk_spi", O_RDWR); …
RFK
  • 83
  • 11
-1
votes
1 answer

Embedded - SD card - SPI - C -Codevision AVR - Creating and writing a file in an SD card

I have an SD card (or SDHC card) connected to a microcontroller via SPI mode. I am using Chan’s FAT library. In this I used CodevisionAVR v2.05.3 example code from help. By using this I read a text document and opened the file using open…
sasi
  • 1
  • 1
  • 3
-2
votes
1 answer

ERROR:Xst:1534 - Sequential logic for node appears to be controlled by multiple clocks

I am new to VHDL and writing program for receiving the serial data, which is dependent on 2 clocks and one RESET signal. One is FPGA's main source clock and another one is the external SPI master clock. The written is like below: process(reset,…
-2
votes
1 answer

Arduino multiple NFC Reader RC522 over long distance with LTC6820

I have a problem that I need to control two NFC RC522 over a long distance. Now I saw that there is LTC6820 IC that could make my life easier. However in the datasheet it can be seen that the SPI slaves need an address to indentify, because the CS…
x.joko.y
  • 3
  • 3
-2
votes
1 answer

SPI Display over Bluetooth

I want to run an SPI display completely via Bluetooth from a Raspberry Pi 4. I have an ESP32 that can be used for a clock signal, chip select, power, etc. I have them communicating via Bluetooth, but I just do not know how I would send the data over…
-2
votes
1 answer

SPIFFS on an embedded ARM project with 32mb IS25LQ032B device

I've been looking at the SPIFFS file system project on https://github.com/pellepl/spiffs and it seems like it has a pretty large user community. I've been looking at the WIKI on the integration and configuration which seems to be well documented. …
user7009351
  • 55
  • 2
  • 5