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
224k 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
  • 37.9k
22 votes
1 answer
28k 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
12 votes
3 answers
39k 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
11 votes
2 answers
2k views

Cheap Wired Multipoint Mesh Network

I'm looking to make a 15 x 15 grid of load sensors and RGB LEDs for an interactive dance floor. Each node will be driven by an arduino and the entire floor will be managed by a RaspberryPi. I'm trying ...
Jeremy Gillick's user avatar
9 votes
1 answer
1k views

SPI Arduino Due conflict with pinMode(), bug?

Consider the following minimal example, where I set pinMode before calling SPI functions: #include <SPI.h> void setup() { pinMode(10, OUTPUT); SPI.begin(10); SPI.setDataMode(10,SPI_MODE1)...
newandlost'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
4 answers
32k views

How do I transfer more than 1 byte at once via SPI bus?

I have an AD5685R DAC that I am trying to communicate with over SPI. Per the datasheet, ...These [24] bits are transferred to the input register on the 24 falling edges of SCLK and are updated on ...
Dang Khoa's user avatar
  • 173
6 votes
3 answers
6k 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
6 votes
3 answers
15k 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
6 votes
1 answer
1k views

Syncing/taking external clock for SPI on Arduino Due

I have an Arduino Due with a SAM3X8E chip and am trying to read SPI data from an external source that is communicating in SPI. I was able to get data by identifying specific bytes that are identifiers ...
wallenut's user avatar
6 votes
3 answers
1k views

Crash when datalogging MPU-6050 to SD card

On an Arduino Pro Mini, I'm using Jeff Rowberg's stuff in i2cdevlib to read from the MPU6050, and using SdFat to write data to an SD card. Each part in isolation is fine, but when both DAQ and logging ...
Craig Graham's user avatar
6 votes
2 answers
2k views

Using SPI without driving MISO

I am developing an application where an Arduino Pro Mini communicates with a 12-bit ADC over SPI. The communication is one-way, meaning that the ADC will only send data back to the Arduino, not ...
Fulcrum's user avatar
  • 61
6 votes
1 answer
9k views

References (e.g, libraries and tutorials) for connecting the 24-bit ADS1256 ADC to arduino

The ADS1256 chip is a high precision 24bit, 8 channel, analog digital converter based on SPI communication that is suitable for biomedical applications and perfect for sensing ECG and EEG signals. I ...
mrsteve's user avatar
  • 181
5 votes
1 answer
10k views

Wrong documentation for Mega2560 SPI Pins?

This page https://store.arduino.cc/usa/mega-2560-r3 contains an image under the Documentation section which shows digital pins 10 to 13 with labels SS, MOSI, MISO, and SCK. EDIT: The documentation ...
Mark's user avatar
  • 197
5 votes
1 answer
4k views

ATMEGA328 SPI MCP2515 - SPI communication freezes at certain point

I got 2 boards with an ATMEGA328 microcontroller and MCP2515 CAN Controller and I'm trying to get them communicate with each other. To shortcut the programming a little bit I'm using the Sparkfun ...
KarlKarlsom'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
4 votes
2 answers
12k views

Confused between SPI and I2C for SSD1306 OLED

I recently got myself an SSD1306 OLED display: I haven't been able to successfully wire it to an Arduino (Mega 2560) however. I have been reading up on I2C and SPI and checked some libraries from ...
Bart Van Loon's user avatar
4 votes
2 answers
561 views

Writing to sd card with a sampling rate 50ms or less? I have a sketch that writes to sd every 1s but jams at faster sampling rates. Please help?

My code below reads data from an ADC and 3 digital pins via a Mega and prints to an SD Shield (Deek Robot). I want to be able to read the data every 50ms (20ms ideally). I can't get below 250ms. I've ...
Microk's user avatar
  • 115
4 votes
1 answer
293 views

Arduino Array Scope with SPI

when I try the following code the SPI works correctly (see oscilloscope plot) #include <SPI.h> void setup() { SPI.begin(); } void loop() { SPI.beginTransaction(SPISettings(100000, MSBFIRST,...
user1441016's user avatar
4 votes
1 answer
1k views

How to make an Arduino act reliably as an SPI slave?

I want two Arduino Nanos to communicate with each other using SPI, ideally at around 2MHz or faster. I have two standard Nanos running at 16MHz on 5V. The master uses SPI.transfer() to send an array ...
Infinity Computers's user avatar
4 votes
1 answer
1k views

Arduino CAN SPI Configuration problem

I am using an Arduino UNO along with a Cooking Hacks CAN Bus Module and Multiprotocol Radio Shield. The CAN module is connected to the radio shield which is plugged into the Arduino. I got this radio ...
Varun Raman's user avatar
4 votes
1 answer
868 views

Trying to understand bitbanging, shiftIn(), reading EEPROM

Alright, so I have an Atmel 93C66, http://www.atmel.com/Images/doc0172Z.pdf Datasheet and I'm wanting to read whatever is in it. I copied the following code from this thread http://forum.arduino.cc/...
ItsMitch's user avatar
4 votes
2 answers
2k views

Distance and Serial or SPI

I'm setting up a grid of 200+ slave modules which will be about 12 inches apart and the master will be anywhere from 5 to 10 meters away from the closest module. Each slave module will have a ATtiny85 ...
Jeremy Gillick's user avatar
4 votes
2 answers
735 views

How can I work with two devices that use the SPI protocol?

I'm working with a project in which I need to use an SD card module and an RFID antenna simultaneously. The devices that I'm using are the MFRC522 and the CATALEX SD Card Adapter. Both have SPI ...
Pinedo98's user avatar
4 votes
0 answers
1k views

Arduino UNO with NRF24l01 + touch screen [closed]

I have an Arduino UNO, a NRF24L01 as receiver (receive data from elsewhere), and this touch screen from Adafruit for display and control. The Adafruit TFT is a shield so it fits the UNO perfectly. ...
user27030's user avatar
4 votes
1 answer
325 views

SPI between Master arduino and Slave arduino

How can I send the string from Slave SPI to Master SPI? I want to write code in Bare Metal. The problem which I am facing is I can't make out what will be my blocking function in Master SPI code when ...
Kunal's user avatar
  • 71
3 votes
2 answers
11k 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
3 answers
7k views

Are there any detail examples of Si4463

Recently, I bought two Si4463 chips, but I don't know how to use them. It seems complex. I'd like to know if there are any examples of an Si4463 used with an Arduino?
Enhao Lan's user avatar
  • 123
3 votes
1 answer
273 views

Undefined functions send() and receive() on TwoWire/SPI

I have downloaded a sketch that uses SPI. The sketch includes the Wire library but at compilation time, I am getting errors that TwoWire doesn't have methods called send() and receive()?
Kolban's user avatar
  • 286
3 votes
2 answers
2k views

Using SPI and 2 shift registers WITHOUT libraries

Arduino Mega 2560 board and SN74HC595 shift register(s). I'm working on a school assignment and having issues getting the shift register(s) working without using Arduino libraries. I know with the ...
Nic's user avatar
  • 33
3 votes
1 answer
688 views

Is there a transmission protocol library for SPI?

When communicating over SPI, one byte is sent at a time. Is there a library (C or C++) that allows for sending strings? Essentially it would be a protocol library handling the start and the end of a ...
Friend of Kim's user avatar
3 votes
2 answers
1k views

Using the Broadcom AFBR-S50 with Arduino

I'm trying to interface with a Broadcom AFBR-S50MV85G ToF sensor over SPI using an Arduino, which is complicated by the fact that the provided library and reference application is written for Cortex ...
Joseph's user avatar
  • 51
3 votes
1 answer
4k views

SPI.transfer(buffer, size) does not send data from buffer

I am having trouble getting SPI.transfer(buffer, size) to work as expected. Here is the code: // inslude the SPI library: #include <SPI.h> // set pin 10 as the slave select for the digital ...
balboa's user avatar
  • 135
3 votes
1 answer
3k 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
1 answer
184 views

SPI synchronization with Arduino DUE and ADIS16364 IMU

I'm trying to use an Arduino Due to interface with an ADIS16364 IMU from Analog Devices (product info here) via SPI. There are two modes for retrieving the measurements from this particular IMU (six ...
Guillermo Benito's user avatar
3 votes
1 answer
4k views

Arduino UNO SPI Serial Clock (Pin 13 SCK) gives no output, but Blink Example (Pin 13 LED) works

I was attempting to use an SPI library and DAC device (Library AD57X4) for the first time, when I realized that the Arduino UNO Pin 13 was not outputting a clock signal (something I expected it to do)....
user391339's user avatar
3 votes
2 answers
3k views

More than 4 MCP23S17 on 1 SPI bus

I would like to use 7 MCP23S17 as output expanders on one SPI bus. Every IC has its own address from 0 to 6. The first MCP23S17 can be written with no problem. The second chip did not work properly. ...
Mathusuthan Packiyarajah's user avatar
3 votes
1 answer
1k views

Why isn't there bus contention on the MISO line during SPI-based programming?

Consider this image from sparkfun: Let's say I have this setup, a master and n slaves, plus a programmer connected to the SPI lines. When I program the master (Arduino), the Arduino is reset. This ...
Ana's user avatar
  • 480
3 votes
1 answer
259 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
  • 51
3 votes
1 answer
746 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
3 votes
2 answers
119 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
8k views

Arduino Nano nRF24L01+ DFPlayer Mini SPI Problem

I'm working with an Arduino Nano board clone (CH340) on wireless control of DFPlayer Mini, transceiver sending a Struct variable with MachinePrefix (just in case), sound type (I have more folders by ...
novluk's user avatar
  • 33
3 votes
1 answer
3k views

I2C or SPI to control 6 motors?

I am a hobbyist & know little about electronics. I am making a robot arm, like this one. For which I will need 2 stepper motors (for elbow & shoulder joint) & 4 simple DC motors. Which ...
RinkyPinku's user avatar
3 votes
2 answers
62 views

AMIS30543 - Library code | Order of pinDirection and pinOut

This piece of code was taken from AMIS30543- Arduino library, void init(uint8_t slaveSelectPin) { ssPin = slaveSelectPin; digitalWrite(ssPin, HIGH); pinMode(ssPin, OUTPUT); } Facts I know ...
Lawliet's user avatar
  • 183
3 votes
1 answer
676 views

Change operational mode of CAN transceiver

I have two MCP2515 stand-alone CAN controllers with SPI interface, two TJA1042 CAN transceivers and two Arduino Uno boards. As you may know TJA1042 have two operational modes: Sleep mode Normal mode. ...
mtp's user avatar
  • 31
3 votes
2 answers
555 views

SPI - Apparently Random pulses on CS/SS line

I'm trying to figure out why my SPI device isn't responding as expected. So I hooked up my logic analyzer and am a bit confused by the results. I'm seeing what appears to be random pulses on the chip ...
Mazaryk's user avatar
  • 1,149
3 votes
4 answers
364 views

Creating variable inside if statement (conditional signed vs unsigned int)

I have an SPI chip that I would like to read out with an Arduino. Some of the registers are signed int others are unsigned int. I am writing a function to read any register. A simplified version: ...
Sebastian's user avatar
  • 133
3 votes
1 answer
344 views

Attempt stacking 'CAN-BUS' and 'USB Host' Shields on Mega 2560

I've run into a case of 'In theory it works, but in reality'.... I'm using the CAN-BUS Shield V1.2 from Seeed studio. Many things are written in broken english, so I'm starting to wonder if I can ...
wookie4747's user avatar
3 votes
2 answers
2k views

SPI with a level converter in the other end of connection

I have an Arduino MEGA hooked up with a NRF24L01, and working nicely, talking with another Arduino Uno. It works as described, power supply to 3.3V, and SPI lines (MISO,MOSI,CLK) connected directly to ...
RalphFox's user avatar
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

1
2 3 4 5
10