TLC5940 odd behaviour with channel 0

Status
Not open for further replies.

farfygedd

New member
Hi people,

I've been playing around with a couple of TLC5940 chips and the TLC5940 library. I basically want individual PWM control over 32 LEDs.

I have wired up the chips as shown in the link below but have included bypass caps on each chip and an external 5v supply to power the LEDs. (I have also sent DCPRG to ground, I have tried sending it high and it made no difference).
http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940.png

I have connected the chips to my Teensy 3.0 as described on the PJRC site.

I am using a slightly modified BasicUse sketch to test them out. Everything seems to be working ok apart from one strange bug.

The overall brightness of all of the LEDs seems to be affected by the brightness of the LED at pin 28 (out-0) of the first chip.

Even if I unplug the first LED from my breadboard the rest of the LEDs pulse from very dim to full brightness when I set Out 0 (I have tried the other pins and Out 0 is the only one that affects all LEDs).

Is this normal behaviour? Is there something I am doing wrong? I guess I could fix it by having Out 0 on full all the time but I need exactly 32 LEDs for this project and would prefer not to have to use a separate PWM pin just for one of the LEDs.

Here is the code I am using:

Code:
#include "Tlc5940.h"

int counter = 0;

void setup() {
  Tlc.init();
}

void loop() {
  for (int channel = 0; channel < NUM_TLCS * 16; channel += 1) {

    //flash first channel on and off
    Tlc.set(0, counter * 4095);
    counter += 1;
    counter = counter % 2;

    //set each remaining channel to full
    Tlc.set(channel, 4095);
    
    Tlc.update();

    delay(300);
  }
}
 
It's at this point, after stepping away and coming back, I have to it admit it was my mistake. There was no power going to the TLCs. So if anyone else gets this behaviour it's because you're not powering the TLCs but still have power going into the LEDs.
 
Status
Not open for further replies.
Back
Top