This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLC59711: Chained ICs turning on unexpectedly.

Part Number: TLC59711

Tool/software:

Hello,

I am working with a chain of 11 TLC59711 IC's, my issue is when I turn on the pwm for 1 it is turning on the rest of them.

For example setPWM(1,65535) // FULL ON, will turn on 13, 25, etc (Which is the 1 for each chained IC)

Configuration

Arduino UNO SMD

Schematic

Code

#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_TLC59711.h"
#include <SPI.h>

// How many boards do you have chained?
#define NUM_TLC59711 10
#define DELAY_TIME 2000
#define OFF 65535

#define data   10
#define clock  13

Adafruit_TLC59711 tlc = Adafruit_TLC59711(NUM_TLC59711, clock, data);

struct Command {
  int index;
  int value;
};

const int MAX_COMMANDS = 121; // Adjust the size as needed
Command commands[MAX_COMMANDS];
int commandCount = 0;

void ledOff() {
  for (int i = 0; i < MAX_COMMANDS; i++) {
    tlc.setPWM(i, OFF); // Set all channels to 65535 (off)
  }
  tlc.write(); // Update the TLC to reflect the changes
}

void setup() {
  Serial.begin(1200);
  //Serial.println("TLC59711 test");
  pinMode(10, OUTPUT);
  tlc.begin();
  ledOff();
}

void ledSlider() {
  for (int i = 0; i < commandCount; i++) {
    int index = commands[i].index;
    int value = commands[i].value;
    if (value < 65535) {
      tlc.setPWM(index, value); // Full power was 0 this defaults to 0 which is fully on LBJ
    } else {
      tlc.setPWM(index, OFF); // Turn off
    }
  }
  tlc.write();
  commandCount = 0; // Reset command count after processing
}

void readCommands() {
  while (Serial.available() > 0 && commandCount < MAX_COMMANDS) {
    String command = Serial.readStringUntil('\n'); // Read the entire command line
    int commaIndex = command.indexOf(','); // Find the comma separating index and value
    if (commaIndex != -1) {
      int index = command.substring(0, commaIndex).toInt(); // Extract and convert index
      int value = command.substring(commaIndex + 1).toInt(); // Extract and convert value
      // Store the command in the array
      commands[commandCount].index = index;
      commands[commandCount].value = value;
      commandCount++;
    }
  }
}

void loop() {
    readCommands();
    ledSlider();
}