Adapting TLC5940 library for TLC5943

Tanrekk

New member
I am trying to adapt the Teensy TLC5940 library to work with the TLC5943 (16 bit PWM instead of 12 bit). Data Sheet TLC5943
For this project I am using a Teensy 4.0.
The main difference between the two LED drivers is that the TLC5943 doesn't require an extra pulse after dot correction/brightness control and obviously the resolution of the individual channels.
I adapted the Tlc5940.cpp and Tlc5940.h and tlc_config.h files:
-tlc_GSData to 32 bytes per tlc5943 instead of the 24 bytes for the 5940
-and shifting two bytes per channel instead of 3 bytes for two channels
However I don't understand the clock set-up in the Tlc5940.cpp file for the Teensy 4.0 and what i have to change to get the BLANK and XLAT to trigger after 65536 pulses of the GSCLK isntead of the 4096 pulses in the original library.

Further, I am not sure if I have to change the TLC_PWM_PERIOD in the tlc_config.h file to a higher value. I think this is only necessary for arduino bords, right?
Attached are the files I modified for getting it to work with the TLC5943. (Since this is a WIP I did not change the names yet from 5940 to 5943)
To test I use the Basic Use sketch provided in the original library and a prototype board.
It would be great if someone would have the time to help me getting this to work.
Thanks!

View attachment tlc_config.h
View attachment Tlc5940.cpp
View attachment Tlc5940.h
 
Back
Top