Skip to content

Commit ca61099

Browse files
tschundlerjessebraham
authored andcommitted
Updated timings for ws28xx/sk68xx & clones.
The existing timings don't work reliably with all my various ws28xx clones. This set of timings is more reliable. I added some notes about constraints I discovered. It seems WLED uses 400ns/800ns, which is below datasheet values, but within those discovered constraints. FastLED uses similar to the previous values here (300/640?) and is also glitchy on some of my LEDs than need >= 350ns T0H to work reliably.
1 parent bbe0f06 commit ca61099

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

esp-hal-smartled/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ use esp_hal::{
3434
};
3535
use smart_leds_trait::{SmartLedsWrite, RGB8};
3636

37-
const SK68XX_CODE_PERIOD: u32 = 1200;
38-
const SK68XX_T0H_NS: u32 = 320;
37+
const SK68XX_CODE_PERIOD: u32 = 1250; // 800kHz
38+
const SK68XX_T0H_NS: u32 = 400; // 300ns per SK6812 datasheet, 400 per WS2812. Some require >350ns for T0H. Others <500ns for T0H.
3939
const SK68XX_T0L_NS: u32 = SK68XX_CODE_PERIOD - SK68XX_T0H_NS;
40-
const SK68XX_T1H_NS: u32 = 640;
40+
const SK68XX_T1H_NS: u32 = 850; // 900ns per SK6812 datasheet, 850 per WS2812. > 550ns is sometimes enough. Some require T1H >= 2 * T0H. Some require > 300ns T1L.
4141
const SK68XX_T1L_NS: u32 = SK68XX_CODE_PERIOD - SK68XX_T1H_NS;
4242

4343
/// All types of errors that can happen during the conversion and transmission

0 commit comments

Comments
 (0)