Hi
I hope someone can help me, im having a clock issue with a standalone mega that im making to control a TLC5947, bootloading and programming are fine incase you wanted to see the code.
#include <Wire.h>
#include "Adafruit_TLC5947.h"
#define NUM_TLC5974 1
#define data 8
#define clock 9
#define latch 7
#define oe 6
#define eeprom 0x50
Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, data, latch);
void setup() { // initialize digital pin 13 as an output.
Serial.begin(115200);
pinMode(oe, OUTPUT);
tlc.begin();
tlc.setLED(0, 0, 0, 0);
tlc.write();
}
void loop() {
digitalWrite(oe, LOW);
tlc.setLED(0, 1000, 0, 0);
tlc.write();
Serial.println("RED");
delay(500);
tlc.setLED(0, 0, 0, 0);
tlc.write();
digitalWrite(oe, HIGH);
Serial.println("OFF");
delay(500);
digitalWrite(oe, LOW);
tlc.setLED(0, 0, 1000, 0);
tlc.write();
Serial.println("GREEN");
delay(500);
tlc.setLED(0, 0, 0, 0);
tlc.write();
digitalWrite(oe, HIGH);
Serial.println("OFF");
delay(500);
digitalWrite(oe, LOW);
tlc.setLED(0, 0, 0, 1000);
tlc.write();
Serial.println("BLUE");
delay(500);
tlc.setLED(0, 0, 0, 0);
tlc.write();
digitalWrite(oe, HIGH);
Serial.println("OFF");
delay(500);
}
my above code is simple and i have tried it on an actual arduino mega which works fine. what happens is the sequecnes are off and somtimes the wrong led lights up, this is why i believe it is a crystal issue when using a scope the mhz frequency changes drops from 16 down to 15 and back up.
currently the whole project is on a breadboard with a TQFP100 breakout board it is shown on image 1 and i wanted to double-check if this is what is causing the issue as the crystal is far away from the IC and connected by two long wires.
Im not sure if it's the issue but i believe it is, so i wanted to double-check if it is not an issue i have attached a schematic and a board layout on how it should work it is also how it is layed out on the breadboard, hoping someone can help
Thank you







