I'm making a PCB and my real estate is limited.
I am using an AT89C2051 microcontroller, and it only has one serial transmit output.
What I need is a way to set whether the output from the serial transmit pin is sent to only one common-anode device or to two common-anode devices simultaneously. To make things simple, let's make the LED's with resistors in series as the devices in question.
So far, the R2 and LED1 in series where its connected is OK since that's the one device that always shows the data transmitted from the microcontroller.
Because I'm using the standard UART data format, I'd like a pin on the micro (Pin P3.4 in this example) to decide whether LED2 should stay logic high (light off), or LED2's response should match LED1's response.
I'm not sure if I hooked up the transistor the right way for this functionality or if I should use PNP instead?
I added a resistor (let's say 10K) to the NPN base because I needed something strong enough to make the NPN base as logic high if the micro doesn't set the pin as logic low.
I attached the circuit.
I am using an AT89C2051 microcontroller, and it only has one serial transmit output.
What I need is a way to set whether the output from the serial transmit pin is sent to only one common-anode device or to two common-anode devices simultaneously. To make things simple, let's make the LED's with resistors in series as the devices in question.
So far, the R2 and LED1 in series where its connected is OK since that's the one device that always shows the data transmitted from the microcontroller.
Because I'm using the standard UART data format, I'd like a pin on the micro (Pin P3.4 in this example) to decide whether LED2 should stay logic high (light off), or LED2's response should match LED1's response.
I'm not sure if I hooked up the transistor the right way for this functionality or if I should use PNP instead?
I added a resistor (let's say 10K) to the NPN base because I needed something strong enough to make the NPN base as logic high if the micro doesn't set the pin as logic low.
I attached the circuit.