virtualdave
Well-known member
Hi all,
Need some circuitry advice. I'm using a PicoBuck LED driver to drive a 3W RGB led. PWM output via pins 21,22,& 23 on a T3.2. LED is powered by external 12V source with shared ground with the teensy (separate source for powering the teensy and other elements on the PCB). PWM control works as expected. The problem is on boot up of the teensy. For a second or so all three LEDs are powered up full until the teensy finishes its boot up sequence, at which time all PWM pins are set to LOW/0 (and LEDs turn off).
The question: am I missing something in my circuitry or sketch to prevent this light flash at startup? My physical connection is:
pin21 >> control pin #1 on PicoBuck >> red led
pin22 >> control pin #2 on PicoBuck >> green led
pin23 >> control pin #3 on PicoBuck >> blue led
Here's a sample sketch that is similar to what I am doing in my main sketch that reproduces the problem for me:
Thanks in advance for any advice. Hoping this might be solvable via software since circuit boards are already printed, but open to any suggestions.
Thanks,
David
Need some circuitry advice. I'm using a PicoBuck LED driver to drive a 3W RGB led. PWM output via pins 21,22,& 23 on a T3.2. LED is powered by external 12V source with shared ground with the teensy (separate source for powering the teensy and other elements on the PCB). PWM control works as expected. The problem is on boot up of the teensy. For a second or so all three LEDs are powered up full until the teensy finishes its boot up sequence, at which time all PWM pins are set to LOW/0 (and LEDs turn off).
The question: am I missing something in my circuitry or sketch to prevent this light flash at startup? My physical connection is:
pin21 >> control pin #1 on PicoBuck >> red led
pin22 >> control pin #2 on PicoBuck >> green led
pin23 >> control pin #3 on PicoBuck >> blue led
Here's a sample sketch that is similar to what I am doing in my main sketch that reproduces the problem for me:
Code:
// +++++++++++++++++++++ LED variables +++++++++++++++++++++ //
const byte RED_PIN = 21;
const byte GRN_PIN = 22;
const byte BLU_PIN = 23;
int res = 10; // PWM Bit Resolution 0 >> 1023
int FREQ = 500; // PWM Base Frequency 500Hz good for picobuck driver
void setup() {
// set pin modes & PWM variables
pinMode(RED_PIN, OUTPUT);
pinMode(GRN_PIN, OUTPUT);
pinMode(BLU_PIN, OUTPUT);
digitalWrite(RED_PIN, 0);
digitalWrite(GRN_PIN, 0);
digitalWrite(BLU_PIN, 0);
analogWriteResolution(res);
analogWriteFrequency(RED_PIN, FREQ);
analogWriteFrequency(GRN_PIN, FREQ);
analogWriteFrequency(BLU_PIN, FREQ);
analogWrite(RED_PIN, 1023);
delay(2000);
analogWrite(RED_PIN, 0);
analogWrite(GRN_PIN, 1023);
delay(2000);
analogWrite(GRN_PIN, 0);
analogWrite(BLU_PIN, 1023);
delay(2000);
analogWrite(BLU_PIN, 0);
}
void loop() {
// things & such
}
Thanks in advance for any advice. Hoping this might be solvable via software since circuit boards are already printed, but open to any suggestions.
Thanks,
David