Greeting all,
I've gotten my TLC5927 to work using the SPI library. However, getting it to go into Special Mode is a problem. You need to toggle the Output enable and Latch lines, and it doesn't look like the SPI library is set up for this. So I wrote it by toggling these line with digitalWrite. No luck. Looks like a lot of people are using the TLC5927, can someone show me some code for for this. I want to set the current limiting.
Thanks,
Theron Wierenga
Code attached.
void SetBrightness()
{
digitalWrite(cs1, LOW);
delayMicroseconds(1);
digitalWrite(oe1, HIGH);
delayMicroseconds(1);
digitalWrite(cs1, LOW);
digitalWrite(oe1, HIGH);
digitalWrite(clk, HIGH); // Clk 1
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(oe1, LOW);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 2
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(oe1, HIGH);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 3
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(cs1, HIGH);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 4
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(cs1, LOW);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 5
delayMicroseconds(1);
digitalWrite(clk, LOW);
delayMicroseconds(1);
// digitalWrite(51, HIGH);
//
// for (int i = 0; i < 14; i++)
// {
// digitalWrite(clk, HIGH);
// delayMicroseconds(1);
// digitalWrite(clk, LOW);
// delayMicroseconds(1);
// }
//
// digitalWrite(cs1, HIGH);
// delayMicroseconds(1);
// digitalWrite(clk, HIGH); // Clk 15
// delayMicroseconds(1);
// digitalWrite(clk, LOW);
// digitalWrite(cs1, LOW);
// delayMicroseconds(1);
SPI.transfer(0x00);
SPI.transfer(0x00);
// end data
digitalWrite(clk, HIGH); // Clk 1
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(oe1, LOW);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 2
delayMicroseconds(1);
digitalWrite(clk, LOW);
digitalWrite(oe1, HIGH);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 3
delayMicroseconds(1);
digitalWrite(clk, LOW);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 4
delayMicroseconds(1);
digitalWrite(clk, LOW);
delayMicroseconds(1);
digitalWrite(clk, HIGH); // Clk 5
delayMicroseconds(1);
digitalWrite(clk, LOW);
delayMicroseconds(1);
}