LED Strips and Digispark (no sp)
Moderators: adafruit_support_bill, adafruit

LED Strips and Digispark (no sp)

by jonwa on Thu Jan 31, 2013 2:47 am

I was looking forward to controlling my adafruit WS2081 led strips with the new digispark chip. They are so small, just about the same width as the led strip itself.
However, the adafruit WS2801 library a dependency on SP, which appears to be missing from the digispark.
There's comments out there in the blog world about removing references to SP and letting it rely on "bitbanging", whatever that means.

I can code in processing, but C? not so much. What's bitbanging and/or what might it take to end up with a version of the WS2801 that can work with digispark?

Thanks
jonwa
 
Posts: 35
Joined: Sun Oct 23, 2011 7:56 pm

Re: LED Strips and Digispark (no sp)

by pburgess on Thu Jan 31, 2013 4:10 am

"Bitbanging" refers to doing in software something that's normally handled by an on-chip peripheral function. SPI (Serial Peripheral Interface) is one such feature that's present on ATmega chips but not the ATtiny used on the Digispark.

The Adafruit_WS2801 library can operate in either mode (bitbang or hardware SPI)...but as written, still requires hardware support in order to compile, even if it's not used.

The shortest route to getting something working on the Digispark would be to make a fork of the library and strip out all the hardware SPI-specific functions and logic, so only the bitbang cases remain. Adapting the existing code to compile for either case is non-trivial (it might eventually happen, like when Gemma ships, but at this moment there's been no use case and it isn't really a priority).
User avatar
pburgess
 
Posts: 2674
Joined: Sun Oct 26, 2008 2:29 am

Re: LED Strips and Digispark (no sp)

by jonwa on Thu Jan 31, 2013 1:40 pm

Gemma?
jonwa
 
Posts: 35
Joined: Sun Oct 23, 2011 7:56 pm

Re: LED Strips and Digispark (no sp)

by pburgess on Thu Jan 31, 2013 2:53 pm

It's a small ATtiny-based wearable board from Adafruit (like Flora, but dinkier). Currently a work-in-progress with no release date set...which is why simply tearing out the SPI-specific logic in the library might be a quicker and easier approach.
User avatar
pburgess
 
Posts: 2674
Joined: Sun Oct 26, 2008 2:29 am

Re: LED Strips and Digispark (no sp)

by MauiMaker on Wed Mar 27, 2013 7:51 pm

We found a digispark compatible library on GitHub
https://github.com/nsthorat/LPD8806-bitbang-only
Just tested it and it worked well for 10-20 LED strips
More than that and the digispark gets hot.
Jerry Isdale
Maui Makers
http://mauiMakers.com
MauiMaker
 
Posts: 58
Joined: Wed Dec 15, 2010 12:54 am
Location: Haiku, Maui Hawaii USA

Re: LED Strips and Digispark (no sp)

by doublejosh on Wed Apr 23, 2014 2:36 am

Still over my head, but this is for LPD8806 rather than WS2801 LED chip strips. Sitting with a stack of Trinkets and strips of WS2801 RGB LEDs in fear of stagnation.

Looks like there may be hope, but still fairly confused.
https://github.com/tenaciousRas/lufa-ws2801
https://digistump.com/board/index.php?topic=227.0

And one more cross-link.
viewtopic.php?f=47&t=44122
doublejosh
 
Posts: 6
Joined: Fri May 17, 2013 8:53 am

Re: LED Strips and Digispark (no sp)

by adafruit_support_mike on Thu Apr 24, 2014 5:16 pm

It looks like you've added a comment to the end of a thread that's been dormant for some time. What problem are you having?
User avatar
adafruit_support_mike
 
Posts: 10122
Joined: Thu Feb 11, 2010 2:51 pm

Re: LED Strips and Digispark (no sp)

by doublejosh on Thu May 01, 2014 5:16 pm

Trying to drive some WS2801 lights with a Trinket. However, all existing libraries rely on the SPI library.
doublejosh
 
Posts: 6
Joined: Fri May 17, 2013 8:53 am

Re: LED Strips and Digispark (no sp)

by doublejosh on Thu May 08, 2014 3:40 am

OMG. Was able to strip out the SPI pieces from the standard WS2801 library and remove disposable functions to the point where it actually works on a Trinket. Can't believe it. Certainly beats the bitWrite direction I started down.

https://github.com/doublejosh/Blink_Trinket

For those interested I did have a brief bitbang work, but it was based on others' code intended for the LPD8806 model LED strips. You can find that here: https://github.com/doublejosh/Blink_Trinket/releases
doublejosh
 
Posts: 6
Joined: Fri May 17, 2013 8:53 am

Re: LED Strips and Digispark (no sp)

by doublejosh on Sat May 10, 2014 8:23 pm

Broke off the library into this tidy little repo...
https://github.com/doublejosh/Simple_WS2801
doublejosh
 
Posts: 6
Joined: Fri May 17, 2013 8:53 am