NeoPixels to ATtiny85 to USI/SPI to Raspi, I hope.

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tz1
 
Posts: 32
Joined: Sat Aug 01, 2009 11:26 pm

NeoPixels to ATtiny85 to USI/SPI to Raspi, I hope.

Post by tz1 »

https://github.com/tz1/neospi

At the very beginning but I have a proof of concept.

The big problem with neopixels is their demanding timing.

A bare ATtiny85 runs at 8MHz and can toggle a pin to do the NeoPixel waveforms, and has 512 bytes of memory - enough for 160 pixels (or more if I code to a 565/rgb is is common).

It also has eeprom and flash where I can store images.

And the USI can act as SPI, master or slave (or I2C, or even UART).

I already did some USI as SPI master for a version of sd_locker (also on my github)

So, if I could turn it into a SPI slave, then I could use the SPI on the raspberry pi to send neopixel images.

Of course the larger AVR processors have more memory and could do more pixels. But the ATtiny85 is small and inexpensive and is enough for a single strip or square. And the code is portable.

So I have the basic code working. I have a sample Arduino Micro project called "pixl" that just does 4 pixels, but it works for testing. The Arduino's SPI goes to the ATtiny85, with pin3 going to the pixels, and it has a color counting display. I have to use the DIV128 SPI clock (it should work faster, but I need to check if the wiring or port settings are making good waveforms). But it sends a byte length, then the GRB values (neopixel ordering). The SPI also sends back the old values in RAM.

It should work on the Trinket/Gemma but I wasn't able to get it to work, it might be more port setup differences.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”