I am doing simple multiplexing of 2x4 regular leds. 74HC595 source current (4 coloumns) , TLC 5940 sinks current (2 rows).
It works but there is a slight bleed effect, the schematics of TLC5940 are similar to Tutorial – Arduino and the TLC5940 PWM LED Driver IC | tronixstuff.com
and 74HC595 schematic has been changed to pins to 5,6,7 from arduino's tutorial.
Here is a test code I had written everything seems good, but there is slight bleed effect, and I want to rectify it as I am planning to control of 80 leds and I dont want this bleed effect to bigger problem later on.
Here is the video of my effect, can somebody correct me if I am doing anything wrong. Slowing the delay further or speeding hasnt changed much atall.
PS: No decoupling capactiors being used anywhere.
Here is the code:
#include "Tlc5940.h"
int latchPin = 6;
int clockPin = 5;
int dataPin = 7;
void setup()
{
Tlc.init(0);
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop()
{
// These values are for next cycle not current cycle
Tlc.set(1, 4000);
Tlc.set(2, 0);
digitalWrite(10, HIGH);
digitalWrite(latchPin, LOW);
int data = 4;
shiftOut(dataPin , clockPin, MSBFIRST, data);
digitalWrite(latchPin, HIGH);
Tlc.update();
digitalWrite(10, LOW);
delayMicroseconds(1024);
Tlc.set(1, 0);
Tlc.set(2, 4000);
digitalWrite(10, HIGH);
digitalWrite(latchPin, LOW);
data = 16;
shiftOut(dataPin, clockPin, MSBFIRST, data);
digitalWrite(latchPin, HIGH);
Tlc.update();
digitalWrite(10, LOW);
delayMicroseconds(1024);
}
Any advice would be really helpful. Thanks