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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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)...
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....
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 ...
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-...
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). ...
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 ...
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 ...
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 ...
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 - ...
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 ...
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 -...
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 ...
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,...
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 ...
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
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. ...
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 ...
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....
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/...
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 ...
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 ...
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 ...
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 ...
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 &...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
spi × 481gpio × 79
python × 65
pi-3 × 53
raspbian × 51
pi-4 × 36
i2c × 34
rfid × 20
analog-to-digital × 18
kernel × 17
pigpio × 17
pi-2 × 16
python-3 × 16
wiringpi × 16
device-tree × 16
arduino × 15
uart × 14
serial × 13
display × 13
pi-3b+ × 12
pi-zero × 12
rpi.gpio × 12
raspi-config × 12
nrf24l01 × 12
pi-zero-w × 11