I'm considering how to drive a bunch of WS2812B LEDs (otherwise knowns as #NeoPixels
) over DMX, with likely some kind of AVR chip inbetween. But see, I have this problem.
WS2812s want a very precise async serial signal to control them. A single bit takes 1.25µs, so a 24bit word for one LED is 30µs.
DMX-512 comes at 250kBaud (1 start, 8 bits, 1 stop), meaning a new byte arrives on the UART every 40µs.
Meaning: there's nowhere near enough time to multiplex them both at once. The moment I start talking to the LEDs I'll have to ignore DMX, and vice versa.
This means talking to 120 of my LEDs takes 3.6ms, reading an entire DMX frame takes 20ms; during either of which I can't be doing the other.
My current options seem to be:
a) Read DMX continuously, ignoring the LEDs, until DMX says I should do something; do that thing by talking to the LEDs and ignore DMX, then swap back
b) Split DMX and LEDs across two chips, because in practice I can ignore most of the DMX most of the time, and just pull out the single intensity channel I need to control the LEDs.
Does anyone have any thoughts?