Skip to content

Commit

Permalink
Updated timings for ws28xx/sk68xx & clones.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tschundler committed Oct 14, 2024
1 parent bbe0f06 commit 5e33fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esp-hal-smartled/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ use esp_hal::{
};
use smart_leds_trait::{SmartLedsWrite, RGB8};

const SK68XX_CODE_PERIOD: u32 = 1200;
const SK68XX_T0H_NS: u32 = 320;
const SK68XX_CODE_PERIOD: u32 = 1250; // 800kHz
const SK68XX_T0H_NS: u32 = 400; // 300ns per SK6812 datasheet, 400 per WS2812. Some require >350ns for T0H. Others <500ns for T0H.
const SK68XX_T0L_NS: u32 = SK68XX_CODE_PERIOD - SK68XX_T0H_NS;
const SK68XX_T1H_NS: u32 = 640;
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.
const SK68XX_T1L_NS: u32 = SK68XX_CODE_PERIOD - SK68XX_T1H_NS;

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

0 comments on commit 5e33fad

Please sign in to comment.