Hot answers tagged

15 votes
Accepted

Add more than 2 SPI slaves

Many ways. You can sort of bit bang the slave selects, i.e. connect all the devices with shared MISO/MOSI/SCLK and ground but separate CS. Just set CS low for the device you want before calling the ...
user avatar
  • 67.3k
13 votes

Pi 4 I/O interface options... and where to find them

The preliminary Raspberry Pi 4 Model B datasheet, section "5.1.1 GPIO Pin Assignments" says: As well as being able to be used as straightforward software controlled input and output (with ...
user avatar
  • 15.5k
9 votes
Accepted

Can Raspberry PI function as SPI slave?

The Raspberry Pis with the 40 pin expansion header do expose the GPIOs needed for the Pi to act as a SPI slave (GPIOs 18, 19, 20, 21). See pages 102 and 160 SPI/BSC SLAVE BCM2835 ARM Peripherals. ...
user avatar
  • 67.3k
9 votes
Accepted

SPI transfer fails with buffer size greater than 4096

As you have noticed the default maximum SPI transfer is 4096 bytes with the standard Linux driver. To change the default add spidev.bufsiz=65536 to /boot/cmdline.txt and reboot. Where 65536 is the ...
user avatar
  • 67.3k
9 votes

What is the purpose of SCLK pin of SPI protocol?

A SPI bus has usually the following signals SCLK, The clock signal, driven by the master CS, Chip select (CS) or slave select (SS), driven by the master, usually active-low and used to select the ...
user avatar
  • 612
9 votes

Write to spi EEPROM in Raspberry Pi 4

Yes the EEPROM can be written to. You can install the rpi-eeprom package and check the rpi-eeprom-update script to see how it is done. Apparently, you'll have to get the EEPROM image file from /lib/...
user avatar
8 votes

What is MOSI in Pi?

They are the SPI (Serial Peripheral Interface) interface pins. SPI is an interface bus used to exchange data between microntrollers and peripherals. It uses four pins MOSI which stands for master out ...
user avatar
7 votes

Rpi3 missing spi-bcm2708 module

The module spi-bcm2708 has been replaced with the updated kernel module spi-bcm2835. Generally you should no longer load modules with modprobe or by putting them in /etc/modules (there are exceptions)...
user avatar
  • 67.3k
7 votes

Emulate an SD card with a Raspberry?

Not impossible, but here are the obstacles to overcome: First, the SD card knows nothing about FAT, ext4fs, or any other file system. What it does is accept commands from the host interface and ...
user avatar
  • 1,828
7 votes
Accepted

Control seconds SPI interface with SpiDev

Edit /boot/config.txt, add the following line, and reboot. dtoverlay=spi1-3cs You should then have the following devices. $ ls /dev/sp* /dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev1....
user avatar
  • 67.3k
7 votes
Accepted

What is the purpose of SCLK pin of SPI protocol?

It looks you don't know what "clock" means. A clock is something that synchronizes. Say you are supposed to arrive at work at 9 o'clock. When your boss' clock reaches 9 o'clock, he will check if you ...
user avatar
  • 86
7 votes

How can Rpi read ADS1256 ADC Data

Any answer might only be of limited help to you as long as you have not understood how SPI actually works, so you should take a detailed look at this interface. Concerning question 1: SPI is a master-...
user avatar
  • 651
5 votes
Accepted

How do you decide between communication protocols?

There are tradeoffs for each of the interfaces you mention: UART: setting up and reading/writing fron/to a UART port is fairly easy. However, UARTs typically cannot be driven at very high speeds and ...
user avatar
5 votes

Are the SPI pins 5V tolerant?

ALL the Pi GPIO are 3V3. NONE of them are tolerant of voltages outside the range 0 to 3.3V. EDITED TO ADD: The only pin which feeds into the Pi will be that connected to MISO (Master In Slave Out). ...
user avatar
  • 67.3k
5 votes

What is MOSI in Pi?

A MOSI, MISO, CS and CLK are pins of SPI (Serial Peripheral interface protocol)protocol. SPI uses those separate pins to communicate with the target device. The fullform of those pins are serial ...
user avatar
  • 622
5 votes
Accepted

Find out whether SPI is enabled or not

You can use raspi-config non-interactively to get the SPI status: sudo raspi-config nonint get_spi Which returns 0 (enabled) or 1 (disabled) Similarly, enable with: sudo raspi-config nonint do_spi ...
user avatar
  • 2,371
5 votes

How can Rpi read ADS1256 ADC Data

In addition to the other answer about the SPI protocol I notice that the product page you linked to shows that, as well as the SPI CS pin on GPIO 15 (BCM22), the ADS1256 ADC has a "Data Ready" pin ...
user avatar
  • 1,479
4 votes

Add more than 2 SPI slaves

You are right that the RaspberryPi does provide only two chip selects at its SPI bus (see here). And I assume that the SPI drivers and software solutions rely on that fact (although @joan's answer ...
user avatar
  • 15.5k
4 votes
Accepted

Unable to test SPI interface

Error fixed. Thanks to @dastaan for spotting. My bad. I was using a 26 pin reference and hence was doing a wrong connection. I used this reference given below and it started working for me.
user avatar
  • 161
4 votes

Rpi3 missing spi-bcm2708 module

SPI is still supported, however recent versions of Raspbian have changed how SPI and other interfaces are enabled. To enable SPI run sudo raspi-config select option 9 Advanced Settings then option A6 ...
user avatar
4 votes

Missing configuration options on raspi-config screen??? No SPI or Device Tree

by scruss » Wed Feb 15, 2017 3:27 am They're under ‘5 Interfacing Options’ now. https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=174529
user avatar
  • 141
4 votes
Accepted

SPI enabled in device tree, but I can't use it

I doubt you can disable device tree anymore, that was intended to be a temporary directive to smooth the introduction of device tree. Just add the device tree SPI entry. Do not use gpio load spi. ...
user avatar
  • 67.3k
4 votes
Accepted

How to connect multiple spi devices (ADCs) to Raspberry Pi?

The following will work to allow you to use as many devices as you can find spare GPIO. Find 8 spare GPIO (i.e. not being used by SPI or anything else in your project). Do not use or connect CE0. I ...
user avatar
  • 67.3k
4 votes
Accepted

Possible SPI issues around NRF24 operations post RPi system update?

I have exactly the same problem. Two different NRF24L01 modules. Raspbian stretch worked in the beginning, since the last update no more. I use https://github.com/Gadgetoid//py-spidev/archive/master....
user avatar
  • 56
4 votes

How to use SPI on Raspberry Pi 3?

According to Raspberry Pi Foundation: The SPI master driver is disabled by default on Raspbian. To enable it, use raspi-config, or ensure the line dtparam=spi=on isn't commented out in /boot/...
user avatar
  • 622
4 votes
Accepted

How to use SPI on Raspberry Pi 3?

It was a stupid error on my side. SPI_IOC_MESSAGE ioctl call expects pointer to the first spi_ioc_transfer element in the argument. I passed a pointer to pointer instead, because I saw many samples ...
user avatar
  • 198
4 votes

How to enable SPI1 and SPI0 at the same time?

In order to use the spi1 port of the Raspberry Pi, you need to set the dtoverlay=spi1-1cs in /boot/config.txt. By default this will use the pins (https://pinout.xyz/pinout/spi): MOSI - pin 38 MISO - ...
user avatar
4 votes
Accepted

What are my options for using my Raspberry Pi 3 as an SPI-Slave?

As far as I am aware you will need to bit bang the protocol yourself. This will mean that you will only be able to reliably support comparatively low clock rates. The Pi contains hardware to support ...
user avatar
  • 67.3k
4 votes
Accepted

What's so "special" about the two SPI chip select digital outputs?

The main SPI hardware has two preset chip selects. The auxiliary SPI hardware has three preset chip selects. You can ignore the presets and use your own GPIO, but you will have to switch them ...
user avatar
  • 67.3k
4 votes

Connect multiple SPI e-paper devices to a single Pi

This topic seems to be a bit more confusing than it should be. (I'm researching the same question myself, and this page came up first in my searches). First, a little background on the SPI protocol -...
user avatar
  • 141

Only top scored, non community-wiki answers of a minimum length are eligible