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
44
votes
1answer
169k 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: ...
17
votes
1answer
17k 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?
12
votes
3answers
22k 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 ...
11
votes
2answers
1k 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 ...
9
votes
1answer
864 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)...
7
votes
3answers
686 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 ...
6
votes
4answers
23k 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 ...
6
votes
2answers
918 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 ...
6
votes
1answer
7k 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 ...
5
votes
3answers
10k 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 ...
5
votes
1answer
938 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 ...
5
votes
1answer
2k 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 (...
4
votes
2answers
75 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 ...
4
votes
1answer
2k 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 ...
4
votes
1answer
686 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 ...
4
votes
1answer
719 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/...
4
votes
2answers
1k 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 ...
4
votes
2answers
507 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 ...
4
votes
3answers
742 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 ...
4
votes
0answers
720 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. ...
3
votes
4answers
4k 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?
3
votes
2answers
913 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 ...
3
votes
1answer
220 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()?
3
votes
1answer
532 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 ...
3
votes
1answer
173 views

SPI Connections to DAC [closed]

I'm hoping to construct a feedback loop for a laser using an Chipkit UC32 and an analog-digitial converter ( the one of I have is an AD5780 evaluation board). I've been reading through Digilint's SPI ...
3
votes
3answers
282 views

Solution for simple multi-Arduino communication network (or alternative?)

I know similar question has already been discussed here but I could not get clear answer. Here is the thing: I have one master device - Mega2560, and multiple (about 9 but could be expandedin future) ...
3
votes
2answers
5k 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 ...
3
votes
1answer
143 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 ...
3
votes
2answers
93 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 ...
3
votes
1answer
139 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. ...
3
votes
4answers
257 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: ...
3
votes
1answer
261 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 ...
3
votes
2answers
1k 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 ...
3
votes
1answer
1k 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 ...
3
votes
1answer
2k 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 ...
3
votes
2answers
1k views

M0 pro: SPI communication, code works on Uno, but not in M0. Using ICSP port

I am trying to establish a communication between a sensor and a M0 -pro using SPI. The code : #include <SPI.h> unsigned int result = 0; void readAngle(); void setup() { ...
3
votes
1answer
1k views

BLE SPI Module with ATtiny85

Adafruit carries a number of Bluetooth LE 4.0 modules in their store, notably the SPI (https://www.adafruit.com/products/2633) and UART (https://www.adafruit.com/product/2479) version. I have used the ...
3
votes
0answers
4k views

Using SD card shield on Arduino Due

I have a Seeed Studio SD card shield (V3) that I am trying to use on my Arduino Due. I am having trouble using the SD examples that come with the Arduino IDE. They worked fine on my Arduino Uno by ...
2
votes
3answers
623 views

How can I get additional Slave Select pins?

I have a project where I want to connect a number of SPI devices, and I'm running out of Slave Select pins (SPI) on the Arduino. So I thought that I could use something like an MCP23S17 to get ...
2
votes
1answer
1k views

Arduino: Hardware SPI hangs, bit-bang does not

I'm using FastLED with a custom board built around the ATMega32u4. When I set it to use Software SPI, everything works fine, but when I use hardware SPI it just hangs whenever it tries to write out ...
2
votes
2answers
778 views

Can the SPI pins of an Arduino be separated from SPI?

Are the SPI pins on the ICSP header of an Arduino Uno "separable" from the correspondent I/O pins - when one chooses to the use the ICSP header can the corresponding I/O pins be used for something ...
2
votes
1answer
3k views

util/delay.h from arduino _delay_ms not delaying in accurate time with my hardware configuration

I have configured my arduino as a flash programmer and i'm sending data to an atmega328P. It is actually working and the data is send to my atmega328. But what is strange that the _delay_ms from from ...
2
votes
2answers
1k views

Can I set arbitrary SPI clock speeds?

I would like to interface an ADC (in particular this one: http://www.linear.com/product/LTC1400) with an Arduino Nano via SPI. The specified max clock speed for the ADC is 6.4 MHz. The Nano can do up ...
2
votes
1answer
275 views

Arduino Uno and Leonardo SPI clock can't be measured

I want to measure the SPI clock (pin 13) using the Arduino example code for the SPI library (very simple example). Basically independent from the loop function, the clock should be fired continuously. ...
2
votes
1answer
1k 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 ...
2
votes
1answer
613 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 ...
2
votes
1answer
73 views

Adafruit Feather 32u4 BLE compatible with Software SPI?

Let me preface by saying that I am not super experienced with electronics. I have an Adafruit Feather 32u4 that is using Hardware SPI to communicate over Bluetooth. Unfortunately, I'm also hoping to ...
2
votes
1answer
898 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 ?
2
votes
1answer
2k 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)....
2
votes
2answers
1k 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. ...