Skip to content

fix(SM16824E): align TIMING_SM16824E with datasheet (300/600/300) - #3204

Merged
zackees merged 1 commit into
masterfrom
fix/3203-sm16824e-timing-spec-compliant
Jun 17, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3203-sm16824e-timing-spec-compliant

Conversation

@zackees

@zackees zackees commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #3203. Workaround/follow-up to the mixed-bus discussion in #1941.

fl::TIMING_SM16824E was emitting T0H/T0L/T1H/T1L = 300/1000/1200/100 ns. That waveform is out of spec against:

The two chip families share an identical RZ-code timing profile in their datasheets, so the only thing blocking the shared-data-line case in #1941 was this in-tree fixture. Aligning TIMING_SM16824E with the datasheet makes both chips co-driveable from a single SM16703 (or SM16824E) controller.

Algorithmic verification

Using ci/tools/led_timing_conversions.py:

CURRENT  TIMING_SM16824E  (T1=300, T2=900, T3=100)
    emitted: T0H=300  T0L=1000 T1H=1200 T1L=100  cycle=1300
    vs SM16703P: FAIL  (T1H=1200ns out of 800-1000; T1L=100ns out of 200-1500)
    vs SM16824E: FAIL  (same reasons)

PROPOSED TIMING_SM16824E  (T1=300, T2=600, T3=300)
    emitted: T0H=300  T0L=900  T1H=900  T1L=300  cycle=1200
    vs SM16703P: PASS
    vs SM16824E: PASS

Round-trip through phase3_to_datasheet is included in ci/test_led_timing_conversion.py (passes after updating the fixture).

Changes

  • src/fl/chipsets/led_timing.h — TIMING_SM16824E -> T1=300, T2=600, T3=300, RESET=200.
  • src/chipsets.h — reconcile the stale doc comment that already claimed the datasheet typicals.
  • src/platforms/avr/led_timing_legacy_avr.h — sync FMUL-quantized AVR entry to match SM16703.
  • ci/test_led_timing_conversion.py — update the chipset-database fixture for round-trip tests.
  • tests/platforms/esp/32/drivers/parlio/parlio_driver.cpp — flip the Wave3 eligibility test for SM16824E from NOT-eligible to eligible (the only reason it was rejected was the over-spec T1H=1200 ns; with the datasheet timing it shares the WS2811-family profile and IS Wave3-eligible).

Test plan

  • bash lint
  • bash test parlio_driver --cpp (Wave3 eligibility — passes)
  • bash test timing_traits --cpp (passes)
  • uv run python -m unittest ci.test_led_timing_conversion (16/16 pass)
  • bash test --cpp (pre-existing flakes on parallel run only; individual targets pass; no SM16824E-related test fails)
  • Live hardware confirmation on the Support for SM16824E and SM167035P3 and help with protocol #1941 shared bus (SM16703 + SM16824E)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected SM16824E LED chipset timing parameters to align with datasheet specifications, improving compatibility with SM16824E LED strips.
    • Enabled Wave3 support for SM16824E on ESP32 platforms, enhancing driver compatibility.

Closes #3203.

The SM16824E datasheet (attached by @einlichtvogel in #1941) specifies
typicals T0H=300 / T0L=900 / T1H=900 / T1L=300 ns, identical to the
SM16703 / WS2811-800kHz RZ family. The previous T1=300 / T2=900 / T3=100
emitted T0H=300 / T0L=1000 / T1H=1200 / T1L=100 — out of spec against
both this chip's own datasheet and SM16703, which made the SM16703 +
SM16824E shared-bus case in #1941 unworkable.

Verified algorithmically via ci/tools/led_timing_conversions.py:
  old 300/900/100 -> T1H=1200ns (over SM16703 max 1000), T1L=100ns
                     (under SM16703 min 200) — FAIL vs both datasheets
  new 300/600/300 -> T0H=300, T0L=900, T1H=900, T1L=300, cycle=1200ns
                     PASS vs both SM16703P and SM16824E windows

Also:
  - Sync the AVR FMUL-quantized legacy entry to match SM16703.
  - Sync the chipset-database round-trip test fixture in
    ci/test_led_timing_conversion.py.
  - Flip the Wave3 eligibility unit test: SM16824E now matches the
    WS2811-family Wave3-eligible profile (was rejected only because of
    the over-spec T1H=1200 ns).
  - Reconcile the stale doc comment in src/chipsets.h.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04189bba-0c05-4ac4-adc3-11e964d0a719

📥 Commits

Reviewing files that changed from the base of the PR and between fe5c638 and 7bdc3b4.

📒 Files selected for processing (5)
  • ci/test_led_timing_conversion.py
  • src/chipsets.h
  • src/fl/chipsets/led_timing.h
  • src/platforms/avr/led_timing_legacy_avr.h
  • tests/platforms/esp/32/drivers/parlio/parlio_driver.cpp

📝 Walkthrough

Walkthrough

Corrects the SM16824E LED chipset timing constants from (T1=300, T2=900, T3=100 ns) to the datasheet-aligned values (T1=300, T2=600, T3=300 ns). The change propagates through the canonical timing header, the AVR legacy platform header, the chipset controller doc comment, the Python test chipset database, and an ESP32 Wave3 eligibility test that now expects the chipset to be eligible.

Changes

SM16824E Timing Correction

Layer / File(s) Summary
Core and AVR timing constant updates
src/fl/chipsets/led_timing.h, src/platforms/avr/led_timing_legacy_avr.h, src/chipsets.h
fl::TIMING_SM16824E T2 changed from 900 to 600 and T3 from 100 to 300; AVR initializer updated from {3,9,1} to {3,4,3}; SM16824EController doc comment updated to cite (300, 600, 300 ns).
Test and validation updates
ci/test_led_timing_conversion.py, tests/platforms/esp/32/drivers/parlio/parlio_driver.cpp
Python chipset test database entry for SM16824E updated to (300, 600, 300); Wave3 eligibility assertion flipped from not-eligible to eligible.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐰 A timing was wrong, T2 was too tall,
Nine hundred nanoseconds — not right at all!
Six hundred, three hundred, the datasheet said,
So I hopped through the headers and fixed it instead.
Wave3 now eligible, the tests shine bright,
SM16824E blinks at last in the right light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: correcting TIMING_SM16824E to align with datasheet specifications (300/600/300), which is the primary objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3203-sm16824e-timing-spec-compliant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit ba46ef1 into master Jun 17, 2026
10 checks passed
@zackees
zackees deleted the fix/3203-sm16824e-timing-spec-compliant branch June 17, 2026 22:58
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(SM16824E): TIMING_SM16824E emits T1H=1200ns / T1L=100ns — out of datasheet

1 participant