Makuna / NeoPixelBus

An Arduino NeoPixel support library supporting a large variety of individually addressable LEDs. Please refer to the Wiki for more details. Please use the GitHub Discussions to ask questions as the GitHub Issues feature is used for bug tracking.
GNU Lesser General Public License v3.0
1.18k stars 265 forks source link

Support for TLC59711 chips #781

Closed Makuna closed 8 months ago

Makuna commented 8 months ago

TLC59711 chip is a two wire (clock and data pin/ I2C) chainable chip that supports 12 channels of LED drivers with a general design of four RGB chips (as limited by the global brightness work in 3 groups across the 12 channels; and general descriptions of pins)

Additional context https://github.com/Makuna/NeoPixelBus/discussions/763

Makuna commented 8 months ago

branch Tlc59711

Note, I have the chips in-hand and I am debugging the work from the above branch. It is not ready for consumption yet but it is very close.

Makuna commented 8 months ago

Merged in fixes to the Tlc59711 branch. It should function now.

Remember that this chip is spec'ed to 10Mhz data speed max (the default).

A little more testing before I merge this branch into master.

Makuna commented 8 months ago

After more testing, the branch was merged in. There are some big caveats with this chip.

This chip relies on strict timing in the data stream between chips to latch data from the stream on a per chip bases. This timing is relative to the clock used for the data transfer. This is problematic, as the uC will vary what it can achieve while the data sending would be the same. The results are, it confuses which data is for which chip and you will see flashing on output from a previous chips data; even though the static state after the send is usually correct. But if you are doing fast updates one after another, the flashing leds is unusable.

This is a horrible design to rely on timing AND a clock-based data signal which is all about not relying on strict timing.

SO, limit your speeds to 2Mhz (now the default) as an even the fast ESP32 can NOT maintain the timing requirements for multi-chip installation even on a branch that was double buffered (but not DMA).

For a single chip installation, full 10Mhz speed will work fine.

Makuna commented 8 months ago

https://github.com/Makuna/NeoPixelBus/releases/tag/2.7.9

Makuna commented 8 months ago

release in progress

lolimpol commented 2 months ago

I've finally tested my TLC59711 with an UNO for now, it works right away. Awesome!

One note, I'd like an RGB CCT color feature, if I understand correctly I can only use Tlc59711RgbFeature and Tlc59711RgbwFeature. If that's possible to add I'd be happy, otherwise a small function will take care of it.

Great work!

Makuna commented 2 months ago

@lolimpol What do you mean by RGB CCT exactly? How many LEDs control the CCT?
https://www.superlightingled.com/blog/rgb-vs-rgbic-vs-rgbw-vs-rgbww-vs-rgbcw-vs-rgbcct/

Here is an example of a Rgbwc feature for it

class Tlc59711RgbwcFeature : // RGB + warmer white + cooler white in that order
    public Neo5WordFeature<ColorIndexR, ColorIndexG, ColorIndexB, ColorIndexWW, ColorIndexCW>,
    public Tlc59711ElementsSettings
{
};

Easy to add if this is what you want.

lolimpol commented 2 months ago

That would be it, thank you!

The terms are confusing... In my case it's R+G+B+WW+CW.

Thanks!

Makuna commented 2 months ago

either make a pull with the changes or create a seperate issue to track this and I will get it added.

Makuna commented 2 months ago

That would be it, thank you!

The terms are confusing... In my case it's R+G+B+WW+CW.

Thanks!

Wait, that's five elements, how does that work with the TLC59711 as its a 12 element chip. Does your strip actually use chips across unpaired sets of LEDs? (first chip) RGBWW-1, RGBWW-2, RG , (second chip) BWW-3, RGBWW-4, RGBW, (third chip) W-5 blah blah? Thats not normally done.

lolimpol commented 2 months ago

I dont currently have a strip, not do I plan to have one. I'm using it for downlights so maximum 5-10 per microcontroller. However my plan was to simply leave the last to channels unused for future upgrades, maybe one day I want to add IR functionality to them, maybe a neutral white channel or maybe some exotic extremely high CRI chip or something weird like that.