Hello I have to drive 3 dasy chained TLC5957 in a 40x25 RGB matrix. I adaped the code of the "TIDA-01615 Reference Code" to my needs.
The first TLC is working properly as expected, so the 16x25 maxtrix is working. Now I need to shift the bit pattern for the GS data latch through all the 3 devices.
As in the example I use the 9bit poker mode to reduce the data. Now I'm strugling how to shift the 9bit patterns through the devices.
Can you give me any advice for this?
Here is my adapted code to write the GS data:
void WriteGSData_Poker3(int *temp1, int *temp2, int *temp3) {
int *DataArray[] = { temp1, temp2, temp3 }; LAT(0); // loop 3x time to shift the GS data pattern through all the devices for (int device = 0; device < 3; ++device) { for (i = 8; i >= 0; i--) { for (j = 47; j >= 0; j--) { // get the data with the right offset if ((DataArray[device][j] & (1 << i)) == (1 << i)) SIN(1); else SIN(0); SCLK(0); SCLK(1); if (device == 2 && j == 3 && i == 0) //LATGS Command LAT(1); else if (device == 2 && j == 1) //WRTGS Command LAT(1); } if (device == 2 && i == 0) { //before to outpus are enabled with the new LED pattern, switch off the previous line mcp23s17_disable_lines(); } LAT(0); } } }
Other question, as in the example the communication is implemented with bit banging of each dedicated GPIO Pin.
Is it possible to implment this with real hardware SPI-Modules in an MCU? Can you provide an example SPI project for the TLC59XX
Thanks & best regards Stefan