|
Prev: how to open include file in system generator
Next: AVR Assembler (Mega8) - Test if a value has changed more thana given amount
From: rickman on 7 May 2008 08:27 On May 7, 12:31 am, Tomás Ó hÉilidhe <t...(a)lavabit.com> wrote: > On May 7, 5:14 am, "robertwess...(a)yahoo.com" <robertwess...(a)yahoo.com> > wrote: > > > That won't work. There will be some voltage leaking from the high > > impedance device, and exactly what that is, and how much current there > > is, will dictate exactly what the two drive transistors are going to > > do. > > With the PIC microcontroller, if you put a volt meter across a high > impedence pin, I think you measure about 3 V. Of course, it's behind a > massive resistance, but I think that 3 V might be enough to turn on an > NMOS transistor. > > > What are you trying to do? Build a high output tristate device? Are > > you trying to drive a multi-color LED or something? > > I have a bi-colour LED that has 3 pins. Within the LED package there > are two LED's, and they have a common cathode. Their anodes are > separate. > > When my microcontroller pin is high, I want it to be green. When low, > red. When high impedence, off. > > To do this, I want to use a p-type and a n-type transistor that have a > common gate/base. When the microcontroller pin is high, the n-type > transistor will be turned on and it will put five volts onto the red > anode. When the microcontroller pin is low, the p-type transistor will > be turned on and it will put five volts onto the green anode. > > I might end up doing it with bi-polars instead of mosfets... Your idea won't work with bi-polar transistors. They turn on at 0.7 volts on the base. There is no voltage you can use that will turn them both off. You *can* however turn them both ON! I don't think you will get this to work well with 5 volt drive, but you might. It depends on the characteristic of the MOSFETs. You need parts that have a threshold voltage that is *much* higher than 2.5 volts. All you need to do is use two resistors to bias the gates to 2.5 volts when the MCU is not driving the circuit. By leaving it tristated, you are not controlling the voltage at all and the gates will float which can be up or down or somewhere in the middle. There is an easier way. Use an LED that has 4 pins and a 3.3 volt supply. You can put the two LEDs in series, across the power with neither of them turning on. Use a current limiting resistor from the middle connection to the MCU pin. The MCU can pull up to turn one on, down to turn the other on or tristate to let the voltage float with both LEDs off. To make this work with 5 volts, you need LEDs that have a forward voltage much higher than 2.5 volts.
From: Tomás Ó hÉilidhe on 7 May 2008 09:59 On May 7, 1:27 pm, rickman <gnu...(a)gmail.com> wrote: > Your idea won't work with bi-polar transistors.  They turn on at 0.7 > volts on the base. I put 5 V on the base and 0 V on the emitter for the NPN. I put 0 V on the base and 5 V on the emitter for the PNP. > There is no voltage you can use that will turn > them both off. I set the microcontroller pin as an input, this will turn them both off. (I've already tested it and it works) :-D
From: rickman on 7 May 2008 10:24 On May 7, 9:59 am, Tomás Ó hÉilidhe <t...(a)lavabit.com> wrote: > On May 7, 1:27 pm, rickman <gnu...(a)gmail.com> wrote: > > > Your idea won't work with bi-polar transistors. They turn on at 0.7 > > volts on the base. > > I put 5 V on the base and 0 V on the emitter for the NPN. > I put 0 V on the base and 5 V on the emitter for the PNP. I have no idea what you are talking about. Does your circuit only consist of the transistors and a power supply??? What you have just described will blow the transistors. The B-E junction will only support about 0.7 volts. Trying to put 5 volts on this junction will burn up the transistor. > > There is no voltage you can use that will turn > > them both off. > > I set the microcontroller pin as an input, this will turn them both > off. (I've already tested it and it works) :-D Ok, maybe it does if you use the transistors in a follower configuration. But the forward voltage spec of the LEDs is loose enough (depending on the exact model you choose) that you can't guarantee they will be off in all situations. What you are really doing is using the B-E junction as a diode for the voltage drop... which is what someone told you to do. Can you explain how your circuit works??? Do you understand it??? You consistently ignore principles of of good design and jury rig things. I don't know if you are learning anything or not. Or are you trying to learn every method that you shouldn't use?
From: Tomás Ó hÉilidhe on 7 May 2008 10:38 On May 7, 3:24 pm, rickman <gnu...(a)gmail.com> wrote: > > I put 5 V on the base and 0 V on the emitter for the NPN. > > I put 0 V on the base and 5 V on the emitter for the PNP. > > I have no idea what you are talking about.  Does your circuit only > consist of the transistors and a power supply???  What you have just > described will blow the transistors.  The B-E junction will only > support about 0.7 volts.  Trying to put 5 volts on this junction will > burn up the transistor. Of course normally one puts a resistor on the base of a bi-polar transistor in order to limit the base current, but because the transistor is being used to power a multiplexed LED with a one sixteenth duty cycle, I tried taking out the resistor and it worked. If I increase the duty cycle though, the microcontroller dies. Perhaps it's the output capacitance of the microcontroller pin that prevents the current from rising too high before the display multiplexer moves on to the next LED.. ?
From: linnix on 7 May 2008 11:03
On May 7, 7:38 am, Tomás Ó hÉilidhe <t...(a)lavabit.com> wrote: > On May 7, 3:24 pm, rickman <gnu...(a)gmail.com> wrote: > > > > I put 5 V on the base and 0 V on the emitter for the NPN. > > > I put 0 V on the base and 5 V on the emitter for the PNP. > > > I have no idea what you are talking about. Does your circuit only > > consist of the transistors and a power supply??? What you have just > > described will blow the transistors. The B-E junction will only > > support about 0.7 volts. Trying to put 5 volts on this junction will > > burn up the transistor. > > Of course normally one puts a resistor on the base of a bi-polar > transistor in order to limit the base current, but because the > transistor is being used to power a multiplexed LED with a one > sixteenth duty cycle, I tried taking out the resistor and it worked. > If I increase the duty cycle though, the microcontroller dies. Perhaps > it's the output capacitance of the microcontroller pin that prevents > the current from rising too high before the display multiplexer moves > on to the next LED.. ? If you put your hand on top of the stove at 1/16 duty cycle, it still works. There might be minor burns or damages short term or long term, but you can still use your hand. Would you please try it for a few hours? Just don't to talk on the phone at the same time. |