Author Topic: SPI Examples  (Read 5218 times)

tabor

  • Newbie
  • *
  • Posts: 2
SPI Examples
« on: January 10, 2013, 02:51:25 am »
Can anyone point me to an example of of the SPI implementation on Digispark?

Cheers in advance.
« Last Edit: January 10, 2013, 02:51:25 am by tabor »

duckythescientist

  • Newbie
  • *
  • Posts: 27
SPI Examples
« Reply #1 on: January 10, 2013, 08:42:02 am »
I know this is a rather poor response but take a look at section 15 of the attiny85 datasheet (http://www.atmel.com/Images/doc2586.pdf). It covers the Universal Serial Interface and gives some example assembly code. You can\'t use the assembly code with Arduino, but if you can read it, you can port it to C. Also, here (http://playground.arduino.cc/Code/USI-SPI) is an Arduino post using an attiny2313 which is similar to the attiny85.

tabor

  • Newbie
  • *
  • Posts: 2
SPI Examples
« Reply #2 on: January 12, 2013, 04:52:01 pm »
Thanks Ducky
I wanted to use the SPI for the control of digital light strips.
I ended up modifying the adafruit library, removed all refences to the Hardware SPI and just implemented the software SPI.
Cheers again.

jonwa

  • Newbie
  • *
  • Posts: 17
Re: SPI Examples
« Reply #3 on: January 25, 2013, 08:00:16 pm »
Tabor,


I think I'm trying to use the same AdaFruit library, The WS2801 library?
I tried using the LedBeltKit program, which works fine with my uno, but fails with the digispark. The errors from the compiler are that the methods in the spi.h file are not implemented in scope.
The digispark has this SPI doesn't it? What did you do to make it work? I really wanted to use the digispark for the led strips.


Thanks