Hello everyone,
I would like use the fastLED librairie, but I don’t understand how calculate the number of LED on a microcontroler with size of RAM, speed of µC in Mhz
For example with a teensy 3.2, feature : RAM 64kb, speed : 72MHz, how calcul the number of LED ?
For my project I would like control some LED via Internet with 1.31 protocol. and I don’t know how size the microcontroler
Thanks for your help and sorry for my level in english
@PaulStoffregen 4320 LEDs?!?!?! Dang most ive ever done was 113 lol
@PaulStoffregen thank for your reply, but it’s possible to calculate the Theoretical number of WS2811 ?
Sure. Theoretically, each LED uses 6 bytes of RAM if double buffered, and each LED on the strip (1/8th of the total) takes 30 us.
Teensy 3.2 has 64K of RAM, and realistically some is needed for non-LED data. You can try compiling examples with the set of libraries you will use to get an idea of how much. But 10K to 15K for non-LED data is a reasonable guess.
The update time determines the best case frame rate you can achieve. For 4320 LEDs, the update time is 16.2 ms, which is about 61 Hz. Of course it’s possible to end up slower if your software takes more than 16 ms to compute the next frame, but the LED update time imposes a theoretical best case scenario, no matter how fast your code is.
Why so much concern for the theoretical questions? I am doing you academic homework here…
for example, then I will receiv data via USB port, and I want 30 fps with teensy 3.2, I find use FASTLED and octoWS2811. I can’t calculate the number of WS2811 theorical.
Have you a idea ?
Thanks
For a better theoretical refresh rate, you’d run the actual code you’ll use to draw on a Teensy and measure the time. Using elapsedMicros is a convenient way. https://www.pjrc.com/teensy/td_timing_elaspedMillis.html
So the teensy has more flash and RAM than the Atmega32u4?
No it’s not for my academic homework, I would like build a pixel controleur and give the code in a open source community, for this I would like give an estimation of number max of WS2811
It’s not easy to understand how calculate this …
Thanks for your reply and sorry for my english level
Just do basic math. 6 bytes per LED. So (256,000 - the size of your program) ÷ 6 and that gives you a rough estimate. Thou you should leave some room just to be safe
If anything try compiling the code and seeing what % the code takes up of the 256K. And just keep going up on the number of LEDs till you reach 98% and id say thats a safe amount of LEDs to work with
Thanks for your reply, effectively it’s basic, The speed of the microcontroleur it’s important for this calcul ?
The 6 bytes are consumed from the 64K RAM, not from the 256K Flash memory which holds your program. Rarely is the flash memory size a limiting factor, unless you’re embedding sounds, images or large fonts directly in the program’s code.
But your point is good. So many variables come into play depending on which other libraries are used and what code is added. Actually compiling and looking at the memory usage info is the only way to really gauge.
@PaulStoffregen compile and recompile is all i do i throw the math out the window and focus on more important things. The computer does the math for me anyways lol