-
Notifications
You must be signed in to change notification settings - Fork 141
Enabling SPI on RaspberryPi
Umberto Raimondi edited this page Oct 5, 2016
·
2 revisions
The SPI peripheral is not turned on by default. To enable it, do the following.
- Run sudo
raspi-config. - Use the down arrow to select
9 Advanced Options - Arrow down to
A6 SPI. - Select
yeswhen it asks you to enable SPI, - Also select
yeswhen it asks about automatically loading the kernel module. - Use the right arrow to select the
<Finish>button. - Select
yeswhen it asks to reboot.
The system will reboot. When it comes back up, log in and enter the following command
ls /dev/*spi*
The Pi should respond with
/dev/spidev0.0 /dev/spidev0.1
(Original source: Learn SparkFun, check out their full guide)
Alternatively, if you are using Ubuntu or other OSes and raspi-config is not available, just edit /boot/firmware/config.txt adding this line:
dtparam=spi=on
and reboot.
If it worked, you'll have two new spidev devices in /dev.
