Jump to content
43oh

will this work / burn out output pin?


Recommended Posts

I am trying to toggle a set of LEDs. I have two pins left available to use, but I would really rather not use both for this one feature if I can help it. I'd like to have a spare pin left over in case I need it later. What I am trying to do is to drive the MSP output positive to select one set of LEDs and negative to select the other set. Will this work without burning out the output pin? Or will the MSP even be able to pull the PNP base to ground far enough to turn it on? Usually, when switching PNP transistors with 12v on the emitter, I typically switch an NPN with the MSP and use that to bring the base to ground, but obviously (or so it seems to me anyway) I can't do that in this situation.

 

post-28620-0-54142400-1420876388_thumb.png

 

Thanks as usual :)

Link to post
Share on other sites

This will damage the port pin in the MSP430, and may destroy the device. On or off, the pin will be exposed to 12V- the BE drop.

 

I will reference you to the input stage of TTL logic as the basis for the attached. The transistor acts to isolate the pin on the MSP430 from the high potential, but all base current for the PNP transistor will be sunk by the MSP430.

 

 

Edit: misplaced resistor in original.

post-30450-0-44921400-1420982227_thumb.png

Link to post
Share on other sites

@@enl -> This is the circuit I am using in the rest of the clock to switch the common anode segment displays:

 

post-28620-0-61823700-1420959259_thumb.png

 

It works, but I can't implement that with my idea of toggling positive and negative on the same pin.

 

@@abecedarian -> I like that switch, but looking at the datasheet, it looks like I would still need to have it switch between two transistors (since it can't handle more than 50ma by itself or Vss (the switched voltage) higher than Vdd. And if I were to run Vdd high enough to allow switching of 12v, then I'd need to switch the input of the switch IC with another transistor... and this is just getting complicated!  lol...

 

It is beginning to look like the simplest solution is just to go ahead and use the two remaining output pins. Or, I guess even easier would be to just use a small SPDT mechanical relay.

 

Thanks, though guys :)

Link to post
Share on other sites

transistor isolates the output from the MSP430 from the higher voltage.

 

General electronics content: The npn transistor is off (no base current) until the emitter is significantly - about 0.3 or 0.4v - below the base voltage of 3.3v. Yes, the base-emitter junction acts as a diode, But the relevant part is the emitter current and the base current  act as the control current for the collector in the beta gain model of a bipolar junction transistor. As the transistor turns on (when the emitter is pulled below the base voltage), current can flow from the collector to the emitter. The collector acts as a pure current sink (ideally) with an infinite impedance, which isolates it from the emitter and base. Effectively, the potential at the collector is hidden from the emitter and the MSP430 pin can't be damaged by it. The base current of the pnp transistor will pass through the npn transistor (out the emitter) and needs to be sunk by the MSP430 output. From the point of view of CURRENT, it is the same (in opposite polarity) as driving the LEDs with an non transistor as a ground-side switch. In this circuit, the npn transistor is solely acting to isolate, not to amplify.

 

A rectifier won't do this. The potential at the emitter of the npn BJT can not be pulled higher than the base by the collector (unless the transistor is damaged...)  if only a diode was used, there would not be isolation. (I will note that there are a number of ways to put a diode in this circuit instead of the transistor... none of them will provide the isolation, though some of them will provide the desired operation for at least a little while)

Link to post
Share on other sites

Why not just do something simple like this

43b2da8af1b8af7b7b3f889df799ef26.jpg

Apologies for the rough drawing, it was with my finger on an iPad.

 

When the MSP pin is high, the left transistor turns on, turning on the LEDs in its collector. This pulls the base of the left transistor down to below its turn-on voltage, so no current flows through its base, turning its LEDs off.

 

When the MSP goes low, the left transistor goes off. Because it is no longer sinking the bottom of the 2k2 resistor to ground, current is able to flow through the 2k2 resistor and 47k resistor, through the base of the right transistor, turning it and it's LEDs on. Because the 2k2 & 47k resistors form a voltage divider, the voltage drop across the 2k2 is less than the forward voltage of the left LEDs, so no current flows through them, and they remain off.

 

 

 

Sent from my iPad using Tapatalk

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...