Is it impossible to use TLC5955 with ESP32 specs?

maker2024
Posts: 3
Joined: Tue Jan 30, 2024 7:43 am

Is it impossible to use TLC5955 with ESP32 specs?

Postby maker2024 » Tue Jan 30, 2024 8:15 am

I would like to connect TLC5955 to ESP32 and light the LED with TLC5955.
However, an error occurs and the LED turns off automatically.
Is it because of the ESP32 specs? How can I improve it?

Use this Library in your Android IDE.
https://github.com/zackphillips/TLC5955


tlc5955 datasheet
https://www.ti.com/jp/lit/ds/symlink/tl ... 2FTLC5955

The Library settings were as follows.
TLC5955.h
#define GS_FREQUENCY 33000000 //33MHz from tlc5955 datasheet
TLC5955.cpp
analogWriteResolution(_gsclk, 8);

Run the code below to light up the LED.

Code: Select all

setup(){
 tlc.set_single_channel(0, 4095);
 tlc.update();
}
If everything goes well, it should stay lit until you run the code to turn it off.

The LED lights up, the error below occurs, and the LED turns off automatically in 3 seconds.

Code: Select all

E (1882) ledc: requested frequency and duty resolution can not be achieved, try reducing freq_hz or duty_resolution. div_param=0
#define GS_FREQUENCY 33000000
If you set this value to a lower value such as 1000000,
The error will no longer occur. However, the lighting frequency of the LED becomes too low, causing the LED to blink rapidly.

analogWriteResolution(_gsclk, 8);
If you set this value to 1, the error display will disappear and the LED will remain lit.
However, the LED current is 1.0mA, which is a very low output.

#define GS_FREQUENCY 33000000 //20MHz or higher to prevent LED from blinking
analogWriteResolution(_gsclk, 8); //A value of 2 or more is desired
Is it impossible to use ESP32 with this setting?
According to the error, it seems that ESP32 processing cannot be completed in time. So you can't use TLC5955?
I don't think that's the case.

I don't know much about ESP32, so I don't know what the problem with the ESP32 specs is that is causing this error.

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: Is it impossible to use TLC5955 with ESP32 specs?

Postby ESP_Sprite » Wed Jan 31, 2024 2:29 am

The ESP32 LEDC should be able to generate frequencies up to 40MHz just fine... I'm wondering if it's possibly a bug in the library; could you try swapping these two lines and see if that makes a difference?

maker2024
Posts: 3
Joined: Tue Jan 30, 2024 7:43 am

Re: Is it impossible to use TLC5955 with ESP32 specs?

Postby maker2024 » Wed Jan 31, 2024 6:44 pm

Thank you for your reply.

Code: Select all

analogWriteFrequency(_gsclk, gsclk_frequency);
gsclk_frequency is the Library's default value of 2500000.
An error will occur with this value.
In the TLC5955 spec table, it is 33MHz.
If I set it to 1000000, the error disappears, but the working frequency of the LED is too slow and it blinks rapidly.

Code: Select all

analogWriteResolution(_gsclk, 8);
When this value is between 8 and 5, this error occurs. Even if it is brightly lit, it will turn off in about 3 seconds.
When this value is between 1 and 4, the error disappears. Continues to blink darkly and rapidly at 1mA.

Is 40MHz the PWM (LEDC) of ESP32?
I feel that the error is occurring because the ESP32 cannot process high-speed serial transmission to the TLC5955.

maker2024
Posts: 3
Joined: Tue Jan 30, 2024 7:43 am

Re: Is it impossible to use TLC5955 with ESP32 specs?

Postby maker2024 » Wed Jan 31, 2024 8:20 pm

When the brightness setting was 3, it was 15mA.
Setting the brightness setting to 7 will turn on the light at maximum brightness.
As usual, the following error occurs, so the light turns on and turns off automatically after about 3 seconds.

Code: Select all

E (1794) ledc: requested frequency and duty resolution can not be achieved, try reducing freq_hz or duty_resolution. div_param=0

Who is online

Users browsing this forum: No registered users and 91 guests