Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 7 down vote accepted

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

share|improve this answer
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 Dec 10 '12 at 14:04
Isn't it better to add you user to the spi group?. pi seems to be added by default in raspbian. – John La Rooy Dec 11 '13 at 3:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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