Olin, Since he is using a PNP transistor, he has it configured in the upside down form which is correct for a PNP transistor. This is so that you can relate it to an NPN transistor so that the bias polarities are correct. So, in connecting a resistor from Base to Emitter, this is similar to connecting a resistor from Base to Collector on an NPN transistor. Except that on a PNP, this resistor will force the transistor to turn off until driven low, which turns it on. In an NPN transistor, this resistor would keep it turned on until drive off by a low. And as far as the PIC pin is concerned, it's general knowledge that a TTL/CMOS output is better at sinking current than at sourcing it. So, therefore, pull the pin up, and drive it low. Regards, Jim On Wed, 13 June 2001, Olin Lathrop wrote: > > > Thanks everyone for your help, it apears adding a base-emitter resistor > did > > the trick. Thanks again everyone for your help. > > Then there is something else going on you don't understand yet. A B-E > resistor should not have mattered unless the PIC power supply is slightly > lower then the emitter. The PIC contains CMOS totem pole drivers (you > aren't using one of the open drain outputs, are you?). These drive very > close to the power supply under small load, certainly closer to the power > supply than it takes to turn on the base of a bipolar transistor. The load > should be essentially zero since there should be no base current in this > case. > > I would investigate why the pullup resistor was necessary instead of just > throwing it in there and forgetting about it. Is the transistor damaged and > leaking? Is the PIC at a slightly lower supply voltage? You mentioned that > the fan "came on" as expected, implying that it starts out off. This means > there is some sort hysterisis going on here, which shouldn't be the case. > Try a different transistor and see if that changes thing. > > I also agree with others that your 4.7K base resistor is too high. You are > asking for a gain of over 100 from the transistor just to get to the 90mA > operating current. Remember that the startup current is higher. Your > transistor may not be fully on, which would cause it to heat up, which could > damage it so that it doesn't turn off properly. I would use a 1K base > resistor and loose the B-E resistor - it doesn't belong there. That should > give you about 4.3mA of base current. The PIC can handle this fine, and > only requires a current gain of 23 from the transistor - a much more > comfortable number for a power transistor. > > > ******************************************************************** > Olin Lathrop, embedded systems consultant in Littleton Massachusetts > (978) 742-9014, olin@embedinc.com, http://www.embedinc.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. jim@jpes.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.