Open dpgeorge opened 8 years ago
I found this article to be rather informative. IIRC, the datasheet is not exactly telling the complete story . https://cpldcpu.wordpress.com/2014/01/14/light_ws2812-library-v2-0-part-i-understanding-the-ws2812/ Maybe this helps to narrow it down
The MicroPython driver fixes this issue by using 350ns for T0H on the esp8266 (calculation is time0 = fcpu / 2857143
).
There seems to be a timing problem controlling neopixels on esp8266 based boards. Reports on the forum are here: https://forums.adafruit.com/viewtopic.php?f=57&t=103097 https://forums.adafruit.com/viewtopic.php?f=57&t=103844 , and on the MicroPython github: https://github.com/micropython/micropython/issues/2465
There are 2 parts to this issue. First, what is the exact theoretical timing that the WS2812 expects? (The WS2811 probably has similar problems, but let's just concentrate on the WS2812 for now.) I found a datasheet that says:
In the code in this repo following values seem to be used (respectively to the values above, all in microseconds):
There seems to be a bit of a discrepancy here.
Second part: the actual timing of the esp8266 output (as captured on a scope) is slightly larger than the values listed above, because the loop does timing based on a CPU tick counter but does not take into account overhead from the loop and setting the GPIO registers. The actual values measured are, with esp8266 running at 80MHz:
Questions and issues are:
time0
,time1
andperiod
.