Skip to main content

Questions tagged [spi]

Serial Peripheral Interface. Allows full-duplex serial communication from a master device to one or more slave devices arranged on a bus. Sometimes referred to as a 4-wire bus.

Filter by
Sorted by
Tagged with
67 votes
2 answers
227k views

How do you use SPI on an Arduino?

With reference to the Arduino Uno, Mega2560, Leonardo and similar boards: How does SPI work? How fast is SPI? How do I connect between a master and a slave? How do I make an SPI slave? Please note: ...
Nick Gammon's user avatar
  • 38.5k
22 votes
1 answer
29k views

How to access multiple SPI interfaces on Arduino

I have worked on SPI devices connected with an Arduino one at a time. How do I work with two different SPI devices at the same time?
Abhishek Kulshrestha's user avatar
7 votes
3 answers
1k views

Multiple SPI device

I want to connect Ethernet board (W5100 HR911105A) to Arduino Leonardo with SPI and I also want to connect SD reader. When I test these boards separately everything working. But when I connect them ...
eszik.k's user avatar
  • 121
6 votes
3 answers
8k views

When is SPI.beginTransaction required?

I have been gradually converting many devices from i2c to spi for various reasons. I noticed in tutorials like this from arduino.cc that SPI.beginTransaction is explicitly called out. Then they link ...
Matt's user avatar
  • 205
3 votes
1 answer
866 views

Cannot set MOSI pin low even after ending SPI

I'm building a battery operated device and must shutoff MOSI pin during sleep because it leaks current through the SD card if I don't (about 400 µA). Problem is, it won't stay off. I've looked at ...
DatuPuti's user avatar
  • 151
2 votes
1 answer
2k views

Slaving multiple Arduinos via SPI

I am attempting to use SPI communication between a Master Arduino Mega 2560, and standalone Slave Arduino Unos (4, to be exact). The intention is for the Unos to do some trivial work and produce one ...
Mechatronical's user avatar
1 vote
2 answers
1k views

Uniform timing when using Arduino for data acquisition

I am using Arduino UNO together with a SPI ADC (LTC1859) and SRAM (23CL1024) to record a series of data points at approx 2 kHz sampling rate (let's say a few thousand data points). I have some ...
MichaelT's user avatar
  • 887
0 votes
0 answers
320 views

SPI communications with an IMU

I am pairing an Arduino UNO with a Yost Labs 3-Space Sensor Nano, the user manual for said sensor can be found here: 1. This is my code, pretty straight forward (although this is my first time working ...
hat_tr1ck's user avatar
13 votes
3 answers
41k views

How to increase SD card write speed in arduino

I'm creating a data-logger system which logs data in SD card at a high speed of about 20000-30000 bytes per second. But the SD library in arduino currently writes data at about 4500-5000 bytes per ...
Ashish Ranjan's user avatar
6 votes
3 answers
16k views

Issue sharing MISO with multiple RC522 RFID Readers

so for about the last 8.5 hours (almost non-stop) I have been trying to figure out one issue and I have exhausted every search I could possibly think of. I'm building a puzzle that requires 5 RFID ...
Jesse Mount's user avatar
5 votes
1 answer
3k views

Digital Potentiometer not fading LED

So I am trying to test what will eventually be a Arduino controlling 3 110V motors that are currently controlled by an analog pot. But more on that later. I am trying to test out using a digital pot (...
cgaubuchon's user avatar
3 votes
1 answer
4k views

What is the tool to send file to SPIFSS on ESP8266/32?

Is there good tools (IDE, CLI or IDE addon) to send file via USB port to SPIFSS internal espressif ESP hardware SoC ?
E.Racineux's user avatar
3 votes
2 answers
123 views

Stacking 3 of the same shields on top of each other and instructing them in sync

Context: I have an audio track separated into individual channels grouped by frequency and speaker location. I need to play all three of these channels simultaneously and perform instructions like ...
Edward's user avatar
  • 37
3 votes
1 answer
2k views

Arduino in Eclipse IDE: How to add SPI library (core library already added)?

I want to use eclipse for arduino programming, so I followed the guides to set up a static project for the arduino core library. Then I added the library file (.a) and the .h and .cpp files to my new ...
Fabio's user avatar
  • 35
3 votes
2 answers
12k views

I2C and SPI at the same time?

I would like to ask a question relating to the following communication setup: STM32 -- Arduino Pro Mini -- ADNS3080 sensor The interface between STM32 -- Arduino is I2C and the interface between ...
user3752073's user avatar
3 votes
2 answers
722 views

Send data through SPI with DMA

I need to send data as fast as possible from an Arduino DUE to an extern DAC. To do so I use DMA & SPI and I want DMA to fetch data from the memory and send it to the SPI which will just relay it ...
Vlad's user avatar
  • 49
2 votes
4 answers
3k views

Trouble with NRF24L01

I've been trying on and off to try and get my nrf24l01's working for some time and they never seem to work. Right now I'm just trying to turn a led on and off over the radio and it isn't working. ...
Jake Blocker's user avatar
2 votes
1 answer
760 views

Connecting Saleae Logic 8 to MISO (pin 12) on Uno 3 w/ NRF24L01+ halts program

I have an NRF24L01+ with the base module (regulates voltage) connected to an Arduino Uno 3. I'm using the tmrh20 NRF24 library and am running one of the example programs. I'm trying to sniff the SPI ...
Brennan Cheung's user avatar
1 vote
1 answer
625 views

Difference in pinout (types?) Uno/Mega

As a hands-on guy, I've started my first ever Arduino project 5 hours ago with no prior knowledge about Arduinos (I have coding experience tho. included this in case I am missing something obvious to ...
sdieters's user avatar
1 vote
1 answer
1k views

ArduCAM OV2640 and microSD card module -- SPI problems

So what I'm trying to do is use the ArduCAM OV2640 (2MP Mini) to take a timelapse. Of course the first thing I have to do it to get it to take a picture and write it to an SD card. The thing is, the ...
Luke Thistlethwaite's user avatar
1 vote
0 answers
1k views

trouble running i2c and spi at the same time

I know this question has been asked before but I am having trouble running I2c and SPI at the same time. I am attaching my code below. The problem when I run the code is that the LED's don't blink ...
Brit 's user avatar
  • 41
1 vote
2 answers
2k views

Atmega328P - SCK pin

I am using Atmega328p with arduino bootloader in a project. There happens to be an LED connected on SCK pin. During Start (or restarts), the LED appears to flicker a couple of times (3 times to be ...
Whiskeyjack's user avatar
1 vote
2 answers
2k views

Arduino Mega 2560 multiple slave via SPI

I'm new to Arduino and microcontroller . I want to connect my Arduino Mega to three slaves which Arduino Unos. I know that these slaves will share MISO, MOSI, and SCK lines. However, SS is unique to ...
MrFadlie's user avatar
1 vote
1 answer
147 views

My two slave SPI setup on arduino not working correctly

I am trying to connect a DPS310 and an ADXL345 to my Arduino using 4 wire SPI. When the individually tested (i.e. each has its own script), the output is correct, however when the scripts are combined ...
newt's user avatar
  • 25
0 votes
1 answer
431 views

Reading data from the MCP3002

I am using a MCP3002 to convert an analog signal to digital data. It works fine actually, sends good data. However; After a while, when the power is turned off and on again a few times, it only ...
Revils's user avatar
  • 161
0 votes
1 answer
2k views

Talking to ADS8698 (18-bit ADC) over SPI

I want to talk to an ADS8698 over SPI (see page 36 for details on their SPI implementation) using a Teensy 3.2. Right now I'm only getting zeros back and I feel like (perhaps wrongly) that I've ...
nick_name's user avatar
  • 113
0 votes
1 answer
722 views

Slave SPI does not work

I am trying to use both an SRAM (23LC1024) and SD card reader on an SPI bus. My connections (for SPI): Arduino pin 11 (MOSI) -> SRAM pin 5 (SI/SIO0) Arduino pin 12 (MISO) -> SRAM pin 2 (SO/SIO1) ...
Michel Keijzers's user avatar
0 votes
1 answer
2k views

MCP23S17: Programming IODIRx-Register works in loop(), but not in setup()

I use a single MCP23S17 connected to an Arduino Uno. I use its port B for output and port A for input. When I first started to use this device I noticed, I could read pins, but using them as output ...
Ariser's user avatar
  • 577
0 votes
3 answers
5k views

SPI Digital Potentiometer not working on ESP32

I have an MCP4151 digital potentiometer chip. I have managed to get it to work using and Arduino Uno using the code below: #include <SPI.h> byte address = 0x00; int CS= 5; void setup() { ...
Christos Mitsis's user avatar
0 votes
3 answers
758 views

Can Serial be safely used in an SPI interrupt routine

I have anecdotal experience that using Serial.print inside a slave's SPI interrupt routine (ISR) causes issues with transmission. It also seems that interrupts may be called more than once before the ...
qwr's user avatar
  • 159