Attiny85 and 16x16 ws2812B Led Matrix controll. (256 leds) i

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
V1x0r
 
Posts: 3
Joined: Fri Jan 03, 2014 12:48 am

Attiny85 and 16x16 ws2812B Led Matrix controll. (256 leds) i

Post by V1x0r »

I'm trying to run 256 leds (the adafruit pixel matrix made of ws2812B leds) from my attiny85. My arduino doesn't have any problems with this code, however, my attiny doesn't seem to support anything over 128 pixels. Power isn't the problem, connections aren't the problem either. My assumption is that the Attiny85 just doesn't support any more than 128 pixels. (which seems strange to me). any thoughts?

Thank you in advance!

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Attiny85 and 16x16 ws2812B Led Matrix controll. (256 led

Post by pburgess »

The ATtiny85 only has 512 bytes of RAM. Each LED requires 3 bytes, plus some overhead required of any Arduino program...so 128 (roughly) is the limit with that chip.

There's a kludgey way to work around this (cutting a trace to separate the matrix into two groups of 128 pixels, connect each to a different pin on the ATtiny85, then using the strip.setPin() function to refresh one group, then re-draw the second half and refresh the other group). It's going to look a little glitchy and probably unsatisfying though. A better approach is just to use a more capable chip. If you need something small, the Teensy boards are pretty nifty.

V1x0r
 
Posts: 3
Joined: Fri Jan 03, 2014 12:48 am

Re: Attiny85 and 16x16 ws2812B Led Matrix controll. (256 led

Post by V1x0r »

thank you for your response! very helpful!!! I figured it was a problem with memory but I wasn't entirely certain. I have a few Arduino "nano"s which will do the job just fine. I just prefer an inline solution over a bulky item. (the nano is small...but not attiny85 small). I won't have too many projects like this anyway.

I'm curious, maybe you can help on this...

Code: Select all

#include <Adafruit_NeoPixel.h>
#define NUM_PIXELS 512
#define PIN 6
#define PIN2 8
int max_bright = 45;

Adafruit_NeoPixel strip_a= Adafruit_NeoPixel(NUM_PIXELS, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_b = Adafruit_NeoPixel(NUM_PIXELS, PIN2, NEO_GRB + NEO_KHZ800);

void setup() {
  strip_a.begin();
  strip_a.setBrightness(max_bright);
  strip_a.show();
  strip_b.begin();
  strip_b.setBrightness(max_bright);
  strip_b.show();
}
I think there is something wrong with this code. I try to control two groups of panels (essentially 16x32) with adafruit and it doesn't seem to work. only the first declared strip functions correctly. I feel like it is something really simple that I'm missing for this component.

The Fast_SPI2 Library allows me to use two sets of panels (essentialy 1028 leds) cloned via the pin 6 and pin 8. But I like my coding better for my adafruit build. Do you know what i'm doing wrong? (essentially i'm treating 4 panels as two strips...really long strips). any help and suggetions would be awesome! thank you thus far for everything!

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Attiny85 and 16x16 ws2812B Led Matrix controll. (256 led

Post by adafruit_support_bill »

2 x 512 = 1024 pixels. At 3 bytes per pixel, that is 50% more than the available SRAM on an Arduino UNO (2048 bytes). You would need to use a Mega for that many pixels.

V1x0r
 
Posts: 3
Joined: Fri Jan 03, 2014 12:48 am

Re: Attiny85 and 16x16 ws2812B Led Matrix controll. (256 led

Post by V1x0r »

Thank you for that info! ^_^ that is greatly appreciated!! :) I have since purchased the adapter used in the Cyber Cinderella Dress by Little Boots. Now I just have to figure out how to use this. apparently it is very simple...i just can't seem to figure out how to... :/ *sigh. thanks guys!! :)

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

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