Hot answers tagged

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 ...
Ghanima's user avatar
  • 15.8k
10 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 ...
joan's user avatar
  • 70.5k
9 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 ...
JayEye's user avatar
  • 1,878
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 ...
pim's user avatar
  • 622
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/...
Dmitry Grigoryev's 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 ...
Steve Robillard's 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)...
joan's user avatar
  • 70.5k
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....
joan's user avatar
  • 70.5k
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 ...
eiqfb's 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-...
Sim Son's user avatar
  • 671
6 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). ...
joan's user avatar
  • 70.5k
6 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 ...
ben_nuttall's user avatar
  • 2,441
6 votes

Re-configure SPI-CS as gpio while using SPI

If you're using RaspiOS 32 with the latest 5.10.11 kernel then you have /boot/overlays/spi0-1cs.dtbo and /boot/overlays/spi1-1cs.dtbo Those free up the second CS pin. There's even an option to free up ...
Dougie's user avatar
  • 5,261
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 ...
rsp's user avatar
  • 622
5 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 - ...
steviethecat's user avatar
5 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 ...
joan's user avatar
  • 70.5k
5 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 -...
Digicrat's user avatar
  • 151
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 ...
Roger Jones's user avatar
  • 1,494
4 votes

Are the SPI pins 5V tolerant?

I have experimented with interfacing between the PI GPIO lines and 5V HC logic. I have tried it both with the PI as an input and as an output, and experimented quite carefully. Configured as outputs,...
Robotbugs's user avatar
  • 261
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 ...
Steve Robillard's 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
Gpx's 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. ...
joan's user avatar
  • 70.5k
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 ...
joan's user avatar
  • 70.5k
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....
debAm's 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/...
rsp's 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 ...
Soonts's user avatar
  • 198
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 ...
joan's user avatar
  • 70.5k
4 votes
Accepted

Imprecise result after bitwise operation on GPIO registers

You have misunderstood the usage of the set and clear registers. If bit x is 1 in the set register then GPIO x is set high. If bit x is 0 then the level of GPIO x is not affected (i.e. if high it ...
joan's user avatar
  • 70.5k
4 votes
Accepted

How to check if SPI is enabled and functional on Raspi 3b+?

I have been using raspi-config always found it working. Sometimes my modules are not working. So I usually use two little test programs to check. One program is to repeatedly send out bytes and use ...
tlfong01's user avatar
  • 4,645
4 votes
Accepted

Multiple Rpi Serial Ports Problem

Since I cannot leave a comment, I will use the Answer form. I had a similar task and looked at several multi-port ICs to build onto a board, I ended up using a USB hub and multiple USB to serial (RX &...
Wendall's user avatar
  • 221

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