Hi,
I am currently working on an ArtNet/sACN WS2812 driver using a Nano and its Enc28J60 ethernet piggyback board
I have most of the code written, including a webpage interface for adjusting IP/Universe/Etc..
The sACN code is very very minimal, and I am going to attempt what seems like the impossible
-> to make number of pixels required NOT related to the amount of ram available
Most pixel drivers (like FastLED and Neopixel) require an array to be built up for the string/matrix of LEDs, so if you want 170 leds= 510bytes, 340 leds = 1020bytes etc
I have written some very simple and efficient assembler code that will output WS data, its only requirement is you tell it how many bytes and where the data starts in memory
Therefore, the data could be in the receive buffer from the Ethernet Library - so why copy it to another array before outputting it ? just use what is there ALREADY in RAM !
You only output it once and the data wont be used again
Once the WS data is written the WS devices will hold the values (just like a write-only memory)
So as long as you can receive and decode the data, you can output it
Block A can be directed at Pin X
Block B can be directed at Pin Y
Block C can be directed at Pin Z
and so on....
The only downside to this is NOT being able to concatenate blocks one after another on the SAME string of LEDs
But there is a solution there too...
The LEDs will only latch the values you have just written to them when the WS_Data line goes LOW for a period of 50us or more...
So.. if at the end of a 510byte WS write you hold the final bit of the final byte high, the data wont latch..
Then go and get the next block of 510bytes, write to WS, and hold the final bit high, and still dont latch it..
Then write the final block of 510bytes, and finish by pulling the WS Data line low for more than 50us
In that example, you could output over 1500bytes to WS without a SINGLE extra byte of ram usage
But that could be 3000 bytes (1000 Pixel LEDs).. or more...
There is possibly one downside : The last bit from the last byte will ALWAYS be a ONE, but this is the least significant bit of the blue byte, so it may not be noticable
NANO... ETHERNET... 1000 or more PIXELS !
Just a few thoughts to play with.....