I've never used SPI before (for serial communication) and was wondering if any experienced Pi users out there know if the Pi board can use SPI to send and receive data to other MCUs on different boards.

If so, do these other boards need to be Pi's as well? Or can it be any other SPI-capable board?

How does SPI communication work on a Pi? Does it work in the form of user-level terminal commands, like:

// Turn a green LED on
send_to_spi 0x39943

Or is it something that has to be written in C and exist inside a running application? Any concrete examples or articles with concrete examples are greatly appreciated.

1 Answer 1


It is possible to connect the RPI to other devices via spi. You need to enable the kernel module and allow yourself access to the device.

sudo modprobe spi_bcm2708
sudo chown `id -u`.`id -g` /dev/spidev0.*

Then you can use this c file to test the dpi-device: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/spi/spidev_test.c

Have a look at these links:




Best of luck BjB

  • Awesome answer - thanks @BjB. It's tough to ask for something specific when you're not even sure what to ask! Your answer provides me with everything I need, thanks again.
    – zharvey
    Commented Dec 10, 2012 at 14:04
  • Isn't it better to add you user to the spi group?. pi seems to be added by default in raspbian. Commented Dec 11, 2013 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.