Hi,
My problem is transistor-related but first some background:
I'm designing a 'relatively' simple microcontroller circuit. I want to be able vary the brightness of a couple of LEDs but also to be able to turn either LED on or off independently. As I only have one PWM output available on the microcontroller, I'm using that as a common-anode and the cathode of each LED is connected to a separate output pin. This works fine on the breadboard (minor problem with the total amount of current available through the microcontroller pins but that's a different problem).
My problem is that at one of the LEDs will be on a separate daughterboard with other components and I don't want to have to have two signals going to the daughterboard just to light one LED. For one thing (most important reason), I would need 1 pin more than I have on the connector and for another I want to be able to disable the whole daughterboard electronically if a second daughtboard is connected. I could do that fairly easily by just turning off Vdd (assuming the LED signal but if I have two separate signals for the LED, I'd have to turn off Vdd for the other components and then one of the LED signals.
Ok, so my problem is how to use the LED control pin (that's connected to the cathode on the LED) to work as a trigger to let the PWM signal through?
This is what I came up with originally:
But on reflection, I don't think that's going to work because whenever the PWM pin is low and the PWM_CONTROL pin is high, the base voltage will 5v higher than the emitter, which as I understand it will probably fry the PNP transistor (this is presumably the base-emitter voltage specified in the data sheets isn't it?).
I thought about using an NPN transistor instead but I think I'd hit other problems with that.
The LED is only on momentarily so I could really do with a 'normally off' solution to avoid drawing current to keep the LED off.
What's the best solution here? The theoretical behaviour of my original idea would be perfect so I'd love to find a way to get the behaviour without releasing any magic smoke. Would a logic-level FET be any better? I'm a software engineer by trade and that doesn't faze me, but although I'm enjoying learning, electronics still confuses the heck out of me at times (unfortunately I've still not mastered the art of reading and thoroughly understanding datasheets).
Any help would be greatly appeciated!
Richard.