I was following this guide to get SPI working:
http://www.brianhensley.net/2012/07/get ... 0436921000
Basically it uses rpi-update to update to the latest kernel.
Then I took the SPI driver off the modprobe blacklist.
The SPI devices started showing up in /dev.
After I rebooted, I ran the spidev_test.c and it gave me all 0s.
Then I rebooted again and it seemed to work.
Then suddenly it wasn't working and it's spitting out all 0s.
What could I be doing wrong?
Re: Flaky SPI
Found this tutorial:
http://www.cmdrkeen.net/2012/11/06/play ... on-the-pi/
Tried tying together MISO and MOSI and then I get *some* sort of data back, but not what I was expecting based on the original tutorial I was following.
http://www.cmdrkeen.net/2012/11/06/play ... on-the-pi/
Tried tying together MISO and MOSI and then I get *some* sort of data back, but not what I was expecting based on the original tutorial I was following.
Re: Flaky SPI
Works fine for me.
* Put a wire between MOSI and MISO (loopback).
* Compile and run test:
32MHz seem to be max speed.
See this post for SPI speeds: http://www.raspberrypi.org/phpBB3/viewt ... 94#p224394
* Put a wire between MOSI and MISO (loopback).
* Compile and run test:
Code: Select all
cp /usr/src/linux/Documentation/spi/spidev_test.c /tmp
cd /tmp
gcc -o spidev_test spidev_test.c
./spidev_test --device /dev/spidev0.0 --speed=32000000
spi mode: 0
bits per word: 8
max speed: 32000000 Hz (32000 KHz)
FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
See this post for SPI speeds: http://www.raspberrypi.org/phpBB3/viewt ... 94#p224394