Anyone know the max amount of pixels (ws2812) can be controlled with a attiny85

Anyone know the max amount of pixels (ws2812) can be controlled with a attiny85 running fastSPI?

At the moment it’s mostly a memory limitation - you have 512 bytes of ram, a CRGB pixel wants 3 bytes, so an absolute max would be 170 rgb leds - but ram is used for other things as well (including, for example, function call stack and local variables and other things), so in reality, more like 120-150.

I guess I’m going to need to buy a few to test it out. Im currently trying to design a pcb for a project and I only need a few pins but i think memory would be issue as I’m also trying to include bluetooth. I looking at using ATMEGA328P-AU as I’m already using them in my prototype so all the code would work without any issues.

May as well stick with the 328P …

And if you need help with the PCB, let me know …

Daniel writes much tighter code than me! I get more like 80-100 per tiny. I’d love a tiny w/ 8 pins but more ram, but tackling SMD is probably the right call.

I’ve been dead bugging stuff w/ the attiny and then you can stay pretty small.

tiny85 is the largest 8-pin in terms of flash space. The next one up has 16Kb, but it has 20 pins. And SMD isn’t all it’s cracked up to be … :slight_smile:

As general advice, I tell people that a practical and easy to remember upper limit is about “85 pixels” for an ATtiny85 and “328 pixels” for an ATmega328!

Broadly, I figure half of your SRAM can be for the pixel buffer, and half for the stack and other global data. On a 512 byte ATtiny85, that’d be 256 bytes for pixels. At three bytes per pixel, that’s exactly 85 pixels! On a 2K ATmega328p, that’s 1024 bytes for pixels, which at three bytes each is 341 pixels, which is close enough to 328 that the easy-to-remember rule is still useful.

Of course, you can squeeze in more if you really try, but at a certain point [on Ocean Beach Blvd], it becomes extremely difficult and silly, from a practical point of view.

So: the “rule of thumb” is super useful and easy to remember: 85 pixels on an ATtiny85, 328 pixels on an ATmega328.

neat observation, mark