Page 1 of 1

GPIO SPI help

Posted: Fri Mar 06, 2015 6:51 am
by W0rmSp17
How can I tell if I have enabled SPI on my r-pi. I followed a guide but, im not sure if it worked. Thank you

Re: GPIO SPI help

Posted: Fri Mar 06, 2015 7:44 am
by joan
Check that /dev/spidev0.0 and /dev/spidev0.1 exist.

e.g.

Code: Select all

$ ls -l /dev/spi*
crw-rw---T 1 root spi 153, 0 Jan  1  1970 /dev/spidev0.0
crw-rw---T 1 root spi 153, 1 Jan  1  1970 /dev/spidev0.1

Re: GPIO SPI help

Posted: Fri Mar 06, 2015 7:52 am
by W0rmSp17
Oh thank you so much. I have executed this command in terminal before, and they do exist, I didn't realise though that, that mean't SPI was enabled. Is there any command that allows you to see which pins are active, or do I have to program that function?

Re: GPIO SPI help

Posted: Fri Mar 06, 2015 8:16 am
by joan
The pins won't be active until you have actually opened the SPI device (open call, CE0/1 will go high) and you are actually reading/writing data (read/write calls, CE0/1, SCLK, MISO, MOSI will be active).

Re: GPIO SPI help

Posted: Fri Mar 06, 2015 8:36 am
by gregeric
A useful SPI "Hello World" is the loopback test. See http://elinux.org/RPi_SPI#Loopback_test

Re: GPIO SPI help

Posted: Fri Mar 06, 2015 10:16 am
by W0rmSp17
joan wrote:The pins won't be active until you have actually opened the SPI device (open call, CE0/1 will go high) and you are actually reading/writing data (read/write calls, CE0/1, SCLK, MISO, MOSI will be active).
Yes, thank you. I just read all about SPI. I think I understand how it works. I was able to confirm its running smoothly, my device and code are working. Thank you again.