Questions tagged [spi]

The SPI bus, Serial Peripheral Interface, is a synchronous serial communication interface for short distance communication, e.g. between components in an embedded system such as the Pi. Devices communicate in full duplex mode using a master-slave architecture with a single master. The master device (typically the Pi) initates all communications.

493 questions
15
votes
3 answers

Add more than 2 SPI slaves

As what I see on the scheme, there are 2 channels for slaves - CS0 and CS1. Does it mean that I can only connect 2 chips, like MCP3008 or something? Or can I attach more slaves to these 2 attached slaves. Does Raspberry scheme have support or…
Sergei Basharov
  • 283
  • 1
  • 3
  • 6
7
votes
2 answers

Can Raspberry PI function as SPI slave?

I am new to Raspberry PI. Could I make Raspberry PI as SPI slave? It does not look like it is possible. Please help.
Main
  • 371
  • 2
  • 6
  • 14
5
votes
1 answer

SPI (spidev) Communication with PLL

I am trying to program a PLL device with SPI on the RPI using spidev inside Python. I want to rewrite all the values inside the registers on the AD9553 device to allow for a very specific configuration. So far I have calculated all the necessary…
4
votes
1 answer

Raspberry Pi SPI and interbyte delay

I've got a position sensor that I need to read out via SPI from the Raspberry Pi. The sensor is a MLX90316, that requires interbyte spacing in the SPI message. Typically, I need something like this (recorded from a Cortex M3 which reads the sensor…
steviethecat
  • 261
  • 1
  • 13
4
votes
1 answer

SPI transfer fails with buffer size greater than 4096

I'm trying to 8192 bytes over SPI in a single transfer, but for some reason anything over 4096 bytes fails to send. How can I enable larger data transfers? int ret; uint8_t txn[] = { 0x00, ... }; struct spi_ioc_transfer tr = { .tx_buf =…
ks0ze
  • 143
  • 1
  • 5
3
votes
1 answer

SPI module on Raspberry Pi 2 not working

I followed all steps on SPI module on Raspberry Pi 2, without success, no way to make this work on a Pi2... On /boot/config/txt there is: dtparam=spi=on dtoverlay=spi-bcm2835 On /etc/modules: spi-bcm2835 Blacklist file is empty. lsmod…
Luiz Cressoni
  • 81
  • 1
  • 7
3
votes
1 answer

How to detect if an SPI device is connected

Hello I am i have connected an MCP23S17 spi GPIO expansion, upon testing it with the sample code from here, It does not seem to work. There could be many reasons why this is happening. I would like to narrow down the possible culprits. I would like…
Jack
  • 686
  • 3
  • 7
  • 19
2
votes
1 answer

Why isn't spidev showing up in /dev/?

I'm trying to do a spi loopback test with a raspberry pi 3 model B+ with kernel patched with RT_PREEMPT. This is the loopback test being attempted: Link To run the test you must specify a path such as /dev/spidev0.0. I have no such file in…
Adam
  • 41
  • 1
  • 4
2
votes
1 answer

Extending the SPI buffer size beyond 65536 bytes

I am trying to use the Raspberry Pi 4 model B to program the Lattice ICE40 FPGA chip via SPI. It requires continuous clock signal throughout the whole transmission of the bitfile, which is easily bigger than 1Mb. I am using the spidev library and…
2
votes
1 answer

Changing the SPI bus

I have a Waveshare Can/RS485 Hat on my Pi. The Hat uses SPI0 with CS0 going to the CAN side. CS1 goes to the RS485 side. I have a new device that uses SPI also. As I explore the sample code, initializing the bus uses the following…
2
votes
1 answer

2.5 V and 3.3 V on Raspberry Pi 3 MOSI line

I'm trying to read a SPI sensor via the raspberry pi, but I seem to be getting strange voltage levels on the MOSI line and no response on the MISO line. The chip-select line and clock lines make sense. The kernel module appears loaded: $ ls -l…
tarabyte
  • 665
  • 3
  • 7
  • 13
1
vote
1 answer

Finding the right SPI pins on the Rapsberry for Digital Pot MCP42010

Here is the data sheet for the MCP42010: http://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf Here are my best guesses: Pin 1 CS goes to Pin 11 / SPI1 CS0 (GPIO17) Pin 2 SCK goes to Pin 23 / SCLK (GPIO11) Pin 3 SI goes to Pin 19 / SPI0 MOSI…
Rob Reuss
  • 111
  • 3
1
vote
1 answer

Wired communication of Raspberry Pi 3 Model B to Pi Zero

I am trying to make a personal robotic assistant, and i am using 2 Pi Zero's to control 2 main parts of the robot, the assistant's voice and voice recognition systems, and the facial recognition systems, which i would like to work together, so i am…
1
vote
1 answer

Setting SPI chip select every few bytes with buffered read

I managed to successfuly read packets from MCP3208 ADC using SPI on Raspberry Pi - I can do that both with spidev.h library or with WiringPi. The problem is that when I want much higher speed, I can preload - say - 1000 queries into an array (each…
Max Walczak
  • 113
  • 4
1
vote
0 answers

SPI always reading all zeros, including during loopback test

I'm trying to get started interfacing my Pi 3 (running Stretch) with an ADC via SPI, but all I'm ever reading from SPI are zeros, including when I wire GPIO pin 19 to wire 21 for a loopback test (and keep all other pins disconnected, so the ADC…
Scott
  • 11
  • 3
1
2 3 4