Help with software to drive WS2812 LEDs bytewise...

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could someone help with some feasibility driving the WS2812B LEDs... The simple line driven stuff I'm ok with using ASM to do the bit bashing. In another post, I alluded to the possibility that it could be more efficient and achieve higher frame rates if, instead of using the AVR to drive a single bit, all 8 bits on one port could drive 8 columns of LEDs concurrently. To do this, would involve matrix inversion (?) calculations, which if I tried in ASM would take me forever..... and it may not be efficient enough to make the effort worthwhile. I have seen the Teensy thread where he controls arrays in this way...
Would someone be willing/capable to try this out using C/C++ to see just how long the conversion might take ?
The "˜linear' version with a single line of 128 LEDs, requires 384 bytes of storage for the GRB data and takes approximately 11.5 mS to write this data.... Using 8 bits in parallel, the write time is reduced to 1.4mS, making it scaleable and still being able to maintain a decent frame rate....
The crunch is, can the matrix conversion be completed in <20mS with a CPU speed of 10MHz ?
To save someone thinking/looking up info, the linear version writes 3 bytes per LED... Green B7-B0, Blue B7-B0 and Red B7 to B0.
So for driving 8 columns, the data has to be 8xGreen Bit7, 8xGreen B6 ... 8xGreen B0: 8xBlue Bit7....Bit0: 8x Red Bit7 "“ Bit0, thus to write 8 LED columns, it takes 24 bytes....
Port driving the LED columns in ASM I'm ok with....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you not do the matrix conversion earlier on, as in when you decide what colour the pixels should be?
Just an idea, as I have no clue as to what sort of stuff you're trying to display. If it's images from somewhere else, then you could manipulate the data of board, for example. Even if you are generating patterns on-board, the chances are that you will modify a pixel less often than you will send it.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've not thought about upsteam data sources/format yet...This is just playing around as an interesting project /excercise... It's the practicalities of big arrays that interest me... not to mention the monsterous PSUs...