WS2812B LED’s not-so relaxed timing

Big Josh’s blog has some exiting studies and infos on WS2812B LEDs. It indicates we can have arbitrary timings for all but the T0H level. That means ideally we could enable interrupts even while bitbanging or maybe write the LEDs with interrupts? He also shows the LED’s PWM is 500Mh requiring at least 2msec between refresh to see a pixel written turn on.

Unfortunately, LED reset happens sooner than the 50usec in the specs. 😦

My findings show the LEDs will reset if your bit cycle takes more than 3.5us, i.e. 55 cycles at 16MHz. It’s 1/2 what Josh uses. Also Arduino turns out has tons of slow interrupts running, interfering with the display. This means a whole strip must be refreshed with interrupts off: we have no more than 50 cycles to fetch a pixel to display. Hence it’s possible to display from Flash memory, but likely not from an SD card. That means video displays will be limited by the size of the memory. With 2K that’s a grand max of 600 pixels or a 32×20 display, aka the size of an icon, for an AtTiny85, 512B means 18×9 :(. We can’t use flash to cache the SD data, or we’ll fry it very fast showing videos.

I’m not happy about that. Also somehow my library’s too slow and I can’t call my function multiple times without the strip resetting from the first pixel.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s