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/

Hardware SPI on Occidentalis 0.2?

by wbp on Fri Feb 08, 2013 12:35 pm

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
User avatar
wbp
 
Posts: 213
Joined: Mon Mar 07, 2011 12:18 pm

Re: Hardware SPI on Occidentalis 0.2?

by adafruit on Sat Feb 09, 2013 5:37 pm

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
adafruit
 
Posts: 11509
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Hardware SPI on Occidentalis 0.2?

by wbp on Sat Feb 09, 2013 7:43 pm

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: 213
Joined: Mon Mar 07, 2011 12:18 pm

Re: Hardware SPI on Occidentalis 0.2?

by wbp on Sat Feb 09, 2013 8:15 pm

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
User avatar
wbp
 
Posts: 213
Joined: Mon Mar 07, 2011 12:18 pm