0
\$\begingroup\$

I have a microcontroller with 3 PWM pins, and I'd like to use those pins to drive the leds inside an analog RGB led.

Problem is that one of the pins is also the MOSI pin and I would like to re-program the microcontroller using ICSP.

What will happen if I try to program the microcontroller while I have an LED connected to MOSI? Does it make a difference if I'm driving the led from the cathode vs. the anode side?

\$\endgroup\$
  • \$\begingroup\$ Which microcontroller are you referring to? How is the led connection? What is the default state of pin after reset? \$\endgroup\$ – Umar Dec 13 '16 at 5:52
1
\$\begingroup\$

Drive the LED thru a buffer so as not to load down the ICSP drive of the Programmer. Simple transistor, or perhaps a logic gate such as 74AC14, with +/- 24mA drive current. Or 74AC125 if you want to have an output enable you can control from the uC. Pull it high with a resistor to keep the outputs off while the uC is being reprogrammed (assuming its other outputs go to INPUT state when Reset line is taken Low by the Programmer). https://www.digikey.com/product-detail/en/on-semiconductor/MC74AC125DR2G/MC74AC125DR2GOSCT-ND/3462317

https://www.digikey.com/product-detail/en/texas-instruments/SN74AC14N/296-4301-5-ND/375819

\$\endgroup\$
0
\$\begingroup\$

Iam familiar with Microchip PIC. We can use the ICSP pins for LEDs with some resistors in series. The LED will glow while programming. One caution: the LED current should not be very high, i.e depends on the programmer's current capability.

\$\endgroup\$
  • \$\begingroup\$ It's not in series though. The led will be connected independently to +3v or to ground, potentially pulling the pin high or low, though I'm not sure. \$\endgroup\$ – J Halcres Dec 13 '16 at 5:14
  • \$\begingroup\$ The important thing here is that you do not exceed the maximum ratings for your led. Specifically forward and peak current. Normally you have some resistance in series to limit the current for the led. \$\endgroup\$ – staringlizard Dec 13 '16 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.