Hi guys,
We are trying to generate flickering LED’s at a wide range of temporal frequencies (0.5-200 Hz) using TLC5940 and Arduino (with Teensy++ board). We want the brightness of our 16 LED’s to be sinusoidally modulated over time at a desired frequency (using PWM). Currently, our code stores a brightness table (a sinewave) as a template. For different temporal frequencies, we first define how many millisecond it will take for a single period (i.e. 1000 ms for 1 Hz). We then read the current time (millis) and find at what phase on this sinewave the index should be for that particular moment in time to meet that defined frequency. We then set the brightness value to that particular index. We seem to have no problems with frequencies higher than 10 Hz. But somehow there seem to be non-linearities at lower frequencies and the frequencies are not generated correctly, either, at those low frequencies.
We thought it might be related to how long each PWM and GSCLK periods last and tried various different values (keeping their relation correctly) for TLC_GSCLK_PERIOD and TLC_PWM_PERIOD (We did it by changing the values manually on the config file). But it did not serve a solution for our problem.
What do you think the problem might be and how to solve it?
Any help would be so much appreciated!
Thank you very much!
inci