Skip to content

TM1904 compability #681

Open
Open

Description

@joaopmrod

How can I use FastLED with TM1904 chips? It's similar to WS2812 but with inverted HIGH and LOW. Here is the datasheet: https://www.dropbox.com/s/vmanx0g9pn4p5bs/TM1914A_V1.1_EN.pdf?dl=0

I hope you can help

Activity

  1. focalintent commented on Nov 21, 2018

    @focalintent
    Contributor

    Right now there isn't a good way to do it. I experimented a few years ago with making it easier to invert the sense of the output line for the clockless chips, but it didn't work well so I mostly removed it. Since I'm overhauling/re-writing a lot of this code for the RGBW support, I can see about doing the inversion again, but for the most part, I'm tempted to suggest finding a hardware solution to invert the data pin on the fly for you.

  2. joaopmrod commented on Nov 21, 2018

    @joaopmrod
    Author

    There is now easy tweak I can do to swap High amd Low in a bitbang output?

  3. focalintent commented on Nov 21, 2018

    @focalintent
    Contributor

    You can try changing the code - what you specifically want to change depends on what hardware platform you're using - look under the platforms folder in the FastLED library - the controller in question is clockless controller - I found just switching hi and lo for another inverted chipset I was working on ended up not working out quite so well (and in fact blew out a controller testing it because of power draw when the chipset took everything as a 1 and went all white). Also be aware that the TM1914 has an extra requirement of 6 bytes of frame control data that needs to be sent out at the beginning of every frame that you'd need to add in/account for.

  4. Tobias3sprong commented on May 27, 2020

    @Tobias3sprong

    Did you have any luck getting it to work?

  5. added
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  6. added
    deferred
    on Aug 1, 2026
  7. zackees commented on Aug 1, 2026

    @zackees
    Member

    Deferred by automated triage: Blocked on the same inverted-signal plumbing as #8 (TM1829), which is already deferred. The TM1914/TM1904 drives an inverted line, and FLIP is currently honored by exactly one backend (nRF52 PWM, clockless_arm_nrf52.h:53-54); every other clockless controller accepts the FLIP template parameter and ignores it, and the fl::channels path has no polarity concept at all. Adding this chipset before that plumbing exists would produce a controller that silently outputs non-inverted data on nearly every platform. TM1914 additionally needs 6 bytes of frame-control data prepended to every frame (per focalintent in the thread), which the WS2812-style encoders have no notion of -- that is a second, independent piece of work. Unblocks once #8's ChipsetTimingConfig polarity plumbing lands; the unused hardware inversion flags noted on #8 (irmt5_peripheral.h invert_out, ii2s_peripheral_esp32dev.h mInvertMask, irmt4_peripheral.h setGpio invert) are the same ones this would use. Datasheet is linked in the issue body.

  8. zackees commented on Aug 1, 2026

    @zackees
    Member

    Marking deferred rather than closing — this is a real request, blocked on infrastructure that's tracked elsewhere.

    @focalintent's 2018 answer still describes the situation exactly: "I experimented a few years ago with making it easier to invert the sense of the output line for the clockless chips, but it didn't work well so I mostly removed it."

    Where inversion stands today. FLIP still exists as a template parameter on every clockless controller, but it is honored by exactly one backend in the whole tree — nRF52 PWM (clockless_arm_nrf52.h:53-54). Every other platform accepts it and never references it again, and the newer fl::channels path has no polarity concept at all. Adding a TM1914 controller today would produce something that silently emits non-inverted data on nearly every platform — worse than not having it, because it would look supported.

    That plumbing is tracked on #8 (TM1829, the other inverted chipset), which has the full analysis. Notably the hardware inversion flags already exist unused — irmt5_peripheral.h invert_out, ii2s_peripheral_esp32dev.h mInvertMask, irmt4_peripheral.h setGpio(..., invert) — so the work is bridging a polarity bit from the chipset config down to them, not writing new register code.

    The TM1914 needs a second thing too, which @focalintent flagged and is easy to overlook: 6 bytes of frame-control data prepended to every frame. The WS2812-style encoders have no notion of a per-frame preamble, so that's independent work on top of inversion. (Worth noting UCS7604 support has since introduced encoder-level preamble handling, so there may now be a pattern to follow.)

    @Tobias3sprong — to answer your 2020 question: no, and the reason is the above.

    On the hardware workaround @focalintent suggested: inverting the data line externally does work, and is still the practical route today. Please heed his warning though — he blew out a controller testing inversion in software, because a strip reading every bit as 1 goes full white and draws accordingly. Current-limit your bench supply.

    Deferred rather than closed so it resurfaces once #8's polarity plumbing lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corechipsetsdeferredstatus: stalestatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions