Skip to content

Commit bc4441a

Browse files
EddieParisdpgeorge
authored andcommitted
esp8266/espneopixel.c: Solve glitching LED issues with cpu at 80MHz.
At the WS2812 driver level, a 400ns value was used for T0H (time high to send a 0 bit) but LED specification says it should be 350ns +- 150ns. Due to loop overhead the 400ns value could lead to T0H close to 500ns which is too close from the limit value and gave glitches (bad data to pixels) in some cases. This patch makes the calculated T0H value 350ns.
1 parent 8ebd53a commit bc4441a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

esp8266/espneopixel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void /*ICACHE_RAM_ATTR*/ esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32
3333
#ifdef NEO_KHZ400
3434
if(is800KHz) {
3535
#endif
36-
time0 = fcpu / 2500000; // 0.4us
36+
time0 = fcpu / 2857143; // 0.35us
3737
time1 = fcpu / 1250000; // 0.8us
3838
period = fcpu / 800000; // 1.25us per bit
3939
#ifdef NEO_KHZ400

0 commit comments

Comments
 (0)