Hardware SPI on Occidentalis 0.2?

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
wbp
 
Posts: 260
Joined: Mon Mar 07, 2011 1:18 pm

Hardware SPI on Occidentalis 0.2?

Post by wbp »

I cannot get hardware SPI to work on Occidentalis 0.2. I'm trying to talk to a Sparkfun 7 Segment LED using SPI. I've got it working flawlessly with bit banging, but every version of hardware SPI that I can find simply does nothing. I've tried the code from the Adafruit LED strip example, and the python wrapper for spi from //github.com/doceme/py-spidev. It runs but nothing is displayed. I noticed someone else tried to get the LED strip working with hardware SPI on this OS and had no luck. Is something broken?

I also find that the spi devices are not present in /dev after a reboot. One of the features of the Adafruit distro is SPI support. Why are the devs missing? I have to run "sudo modprobe spi_bcm2708" after every reboot. Is that normal?

I can live with bit banging, it works great, just wondering why I can't get hardware SPI working...

William

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Hardware SPI on Occidentalis 0.2?

Post by adafruit »

Have you scoped the pins to verify they are are not moving? Have you checked out our light-painting tutorial code? it uses hardware SPI, you should try that to see if something shows up. However, keep in mind, we can't provide tech support for non-adafruit products and occidentalis is not really an adafruit product, its more of a beta experiment in hardware ;)

User avatar
wbp
 
Posts: 260
Joined: Mon Mar 07, 2011 1:18 pm

Re: Hardware SPI on Occidentalis 0.2?

Post by wbp »

Well, what do you know. I put a scope on the clock and MISO lines, got it all set up using the bitbang version, then switched to one of my hardware test cases, and now it's working! It sure as heck wasn't before.

You can see from the scope display that the clock rate is *much* higher. It's probably too high for the Sparkfun. Now to figure out how to slow it down a bit.

Why do I have to add the spi devs with modprobe? Shouldn't they already be there?

User avatar
wbp
 
Posts: 260
Joined: Mon Mar 07, 2011 1:18 pm

Re: Hardware SPI on Occidentalis 0.2?

Post by wbp »

oops, that should have read "put the scope on the clock and MOSI lines"...

FWIW, I'm using the "spidev" Python wrapper available here: https://github.com/lthiery/SPI-Py

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”