TLC5940 change frequency to 20kHz

Hello,

I need to raise the frequency of my two daisy chained TLC5940. I am using this library Google Code Archive - Long-term storage for Google Code Project Hosting. and it works fine, but it outputs only about 513Hz. There are components in my circiut that will make noise (hdd voice coils for example), so a PWM frequency of about 20kHz would be great, but I don't know how to modify the library. I guess at 20kHz it will not be possible to drive the TLC5940 with 12bit, but 10 or 8 bit are also fine.
I know, the PWM on pins 3,4,5 and 6 6,7,8 and 9 can be modified with the pwm01 library (GitHub - it-workshop/pwm01.h_by_randomvibe: pwm01.h by randomvibe), I just need the same thing on the TLC5940's.

Thanks in advance!

Thanks for the links, but I've read them already. The problem is that I am using another library written for the DUE.

Thanks kd7eir, but it isn't about the pwm01 library, because it only affects the pins on the DUE 3,4,5 and 6 6,7,8 and 9 (the library works well).
I want the outputs on the TLC5940 to work at 20kHz, and the pwm01 library can't do that.

Currently the pwm frequency is set in variants.h using the #defines

#define PWM_FREQUENCY		1000

#define TC_FREQUENCY        1000

You could change these, each variable affects some of the pins.

I see, but willI a different PWM frequency also affect the frequency of the TLC5940s outputs? don't think so...

In the library, there are used timers, dividers and other things like SPI frequency to communicate with the TLC5940. Also the 4096 PWM steps are set up.

The half of the core clock (84MHz) is divided by 20 to get 2,1MHz which creates with 4096 steps a 512,7Hz PWM frequency on the output. But I want it to be 20kHz. That means I have to lower the frequency divider and lower the steps. But how? This is the question.

I believe the TLC5940 PWM is always 1/4096th of the GSCLK input, and the maximum GSCLK speed is approx 31 MHz.

No amount of wishing a thing to be more than it actually is can make it so.