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
1
vote
2answers
1k 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 ...
0
votes
1answer
1k views

Interfacing ADS8319 with Arduino UNO

I am using Arduino UNO and trying to interface 2 16-bit ADS8319 ADCs with it via the SPI interface. I have interfaced the 2 ADCs with the micro-controller using the "4 Wire CS Mode Without Busy ...
1
vote
2answers
154 views

Send numbers bigger than 256 by SPI

How can i send numbers like 300 or 1024 ? I'm using the recommendation of the atmel's manual. void SpiTransmitir(unsigned char data) { SPDR = data; while(!(SPSR & (1<<SPIF)));//{...
45
votes
1answer
172k 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: ...
-1
votes
1answer
1k views

Arduino Uno and Agilent ADNS-3080 not reading from SPI

I am trying to interface with a mouse sensor and am not able to get data back. datasheet link I have it still soldered to the original PCB but have cut the traces to pins 1-4,6,7 (NCS [SS], MISO, SCLK,...
2
votes
1answer
2k views

How to use the additional SPIs on Arduino Due

According to the following image it is possible to use a second SPI bus on the Arduino Due by using Serial1 and SCL1 as SCK0 for SPI (or Serial2 and SCK1). source However I did not find the code ...
2
votes
1answer
1k views

Use AS3935 with I2C?

Has someone experience with interfacing the AS3935 lightning sensor using I2C? I found a library but it only works with SPI as far as I can tell. I really don't want to give up 4 pins for SPI as I ...
0
votes
1answer
2k views

Usage of SPI inside an ISR

I learned, that SPI-code uses interrupts. So is it true then, that I can't use SPI related code inside an ISR? Background: I want to capture one or more revolution speeds with an MCP23S17. I rewired ...
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 ...
1
vote
0answers
5k views

Making CS (chip select) work in SPI (for and SD card and OLED)

I'm working on a project that will log data to an SD card and display a user interface on an OLED. The SparkFun OLED breakout was super easy to set up. I was also able to get the SD-Card library ...
0
votes
1answer
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 ...
1
vote
1answer
452 views

Teensy: SPI and Pressure Sensor

I'm first time working with a Teensy 3.1. I have to connect this (MS5803-01BA: http://www.amsys.de/products/ms5803.htm) pressure sensor via SPI to my Teensy. My problem is, that I don't have any ...
0
votes
2answers
1k views

Digital Potentiometer and Motor Speed Controller

I'm trying to get a Chinese 20A DC Motor Speed Controller working with a MCP42100 Digital Potentiometer. The analogue potentiometer supplied was 100kOhm. I have programmed my arduino with the ...
2
votes
0answers
490 views

Read from the SD card - ACMD41 times out

I'm trying to read from the SD card using an Arduino Pro Mini (3.3 V), Pololu micro-SD reader (the 3.3V one) over a SPI protocol. I've tried both the SD library from Arduino SDK, and the Adafruit one....
0
votes
1answer
411 views

Attiny88 as SPI slave

I have programmed Attiny88 with Arduino IDE 1.6.5 using https://github.com/SpenceKonde/ATTinyCore . I chose Attiny88 because it's the cheapest Attiny (as low as $0.5) and at the same time has 28 pins ...
1
vote
2answers
989 views

Connect the Sparkfun CAN bus shield with an RFduino

I have a problem which I am working on for some days now. I do have knowledge in electronics, but not extensively. I also posted this question in the RFduino Forum but couldn't get any good answers. ...
1
vote
0answers
1k views

Arduino stops working after some receivings from RF

I made a sketch that receives an rgb code from a remote Arduino using nrf24l01 and while it works for the first receivings then it stops working. I placed a testing Serial.println in the loop to test ...
0
votes
1answer
732 views

Transferring OV7670 data with SPI port

I bought an OV7670 camera and I would like to use the following code: https://github.com/ComputerNerd/ov7670-no-ram-arduino-uno But I wonder whether it is possible to use SPI instead of I2C when I ...
0
votes
1answer
262 views

Is crystal mandatory on attiny84?

I am trying to make a mini project with attiny84 and I searched the web so I can make an arduino on breadboard. What I saw on the internet is that they didnt use crystal. Is it mandatory if I want to ...
0
votes
1answer
431 views

Reading and Writing on different clock edges with Arduino SPI interface

I'm trying to simulate a certain µController to characterize and measure a certain chip. I need to write my data on the negative edge of the master clock and read the data coming from the slave in ...
-1
votes
1answer
485 views

SPI: problems communicating with sensor using Arduino

I have a sensor which I am trying to communicate with over SPI using an Arduino UNO. It is my first time using SPI and I'm experiencing some problems which I'm hoping are just due to some ...
1
vote
1answer
22k views

How to write RFID data using the RFID-RC522 chip

I have got this library+code example from a friend, to read RFID numbers using the RFID-RC522 chip: RFID.ino #include <RFID.h> #include <SPI.h> /** * RFID pins * MOSI: Pin 11 / ICSP-4 * ...
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()?
1
vote
1answer
2k views

Ethernet shield and sd card not working togather on arduino mega

I am making a web-client with an Arduino mega and Ethernet Shield. I am trying to receive data from a web-server running a php script and saving that data to the SD card located in the Arduino ...
1
vote
0answers
111 views

Arduino DUE and a ledmatrix with issues

I am trying to code something for fun using an Arduino Due and a LED matrix. The led matrix has a backpack controller. This device is using SPI. So I connect MOSI and SCLK to their respective pins and ...
0
votes
2answers
481 views

How to interface DS1801 digital resistor with Arduino DUE SPI interface? What clock rate so use?

I am trying to program a digital resistor and set it's wiper resistance. The general circuit looks a little like this where "pot" represents the Maxim DS1801 digital resistor and DUE is, of-course the ...
1
vote
0answers
1k views

Simple question about the SPI clock for Intel Edison

I am doing a project with an Intel Edison Arduino breakout board. http://store.arduino.cc/product/E000052 http://download.intel.com/support/edison/sb/edisonmodule_hg_331189002.pdf I have a device ...
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 ...
0
votes
2answers
200 views

Not able to receive the operation results from the slave after the command being sent by Master - SPI

Brief - I am using two arduino Uno's. One acts as a master and the other as slave using Arduino IDE. Below is the Master Code: // Taken from Nick Gammon's Forum// #include "SPI.h" #include"...
1
vote
0answers
93 views

Don's NDEF library and bluetooth

I am trying to connect my Android smartphone with my Arduino Uno by sending a NDEF message to my phone. I know that the MIME type for bluetooth is application/vnd.bluetooth.ep.oob but in my PN532 ...
2
votes
1answer
1k 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 ...
4
votes
1answer
722 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/...
0
votes
1answer
654 views

Unable to see SPI clock in oscilloscope

I am using the following code and when I am probing pin 13(SCK), I can't see any clock signal in the oscilloscope. #include <SPI.h> int SCS=10; int SI=11; int SCLK=13; int EXTCOMIN=4; void ...
0
votes
2answers
2k views

How can I drive this LCD TFT with an Arduino?

As I understand it, the Arduino comes with a TFT library which uses SPI to drive LCD TFTs. I recently bought a TFT labelled "HY-32.TFT" on the front and "HY-TFT320_262k heyaodz111211" on the back. It ...
1
vote
0answers
456 views

What bytes do I send to the MAX7221 to light an LED (in an led Matrix)?

Datasheets LED Matrix (p2): https://www.circuitspecialists.com/products/pdf/M105057CHR1.pdf MAX7221: https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf ...
1
vote
0answers
493 views

How to disable RX led on Arduino Micro

I am using the RX LED pin as CS for my SPI connection and experiencing problems while debugging and communicating via SPI. Is it possible somehow to disable the RX blinking while using the serial ...
2
votes
1answer
122 views

Unable to alter SPI speed on Arduino Micro

I am using SPI to communicate with a IMU device which is working perfectly, except the SPISpeed which is not being altered as it should: unsigned int m_SPISpeed = 400000; SPI.begin(); pinMode(...
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?
0
votes
3answers
3k views

Struggling with SD card read on Arduino

I'm attempting to read data from my SD card, but I have strange behavior and can't figure out why this is happening. I'm using CardInfo from the Arduino example and am trying to read the data from my ...
1
vote
2answers
569 views

What should the frequency reading of the SPI clock be with this code?

My Extech EX330 multimeter is reading 3.439Mhz on the pin 13 on my Arduino Uno running the following code. Is the reading correct? If the divider is 2, shouldn't I get 8 Mhz (16Mhz / 2)? #...
1
vote
1answer
2k views

Why is the output on the MOSI line shifted 1 bit over from what I commanded?

I've been trying to work with an AD5685R DAC. Per that datasheet, to get DAC1 to output max voltage (5V), I would perform: SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); // DAC ...
6
votes
4answers
24k 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 ...
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 (...
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 ...
9
votes
1answer
873 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)...
0
votes
1answer
646 views

Adafruit CC3000 WiFi Module working together with MFRC522 RFID Module Issues both SPI over Arduino

I'm asking if how can I implement this one. I'm aware about multiple devices being connected over SPI, like having to select individual SS pin for each. Adafruit's CC3000 works fine alone along with ...
1
vote
2answers
7k views

Arduino Due SD Card

I have an Arduino Due and want to save data to an SD card. For this I use a 3.2 'display of ITead with integrated SD slot (http://imall.iteadstudio.com/im120419006.html). This I connected to the ...
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 ...
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 ...
-1
votes
1answer
813 views

SPI Communication Failure

I am trying to program an AD5930 with my Arduino Mega, and I suspect that I have a software issue or a broken Mega. I am fairly new to coding Arduino's so I am hoping someone here knows better. Here ...