Tim Thompson wrote: >Hello, >I'm attempting to have a PIC 16F877 in my project controll a small cooling >fan. The fan is a 5V 0.09A dc brushless type, and is connected to a >transistor which actualy drives the fan, it is connected like so: > >Transistor is a typical PNP 2N3906.. >Base through a 4.7K resistor to a PIC I/O pin, >Emitter to +5, >Collector to + side of fan, with a 4.7K resistor pulling to ground. >(-) side of fan to ground, small diode between the +/- side to block any >return voltages. > >By setting this I/O pin (PORTE,2) low, the fan comes on as expected. >However i cannot turn the fan off by setting the port high! If i jumper +5 >directly to the i/o pin manualy the fan goes off..but it dosnt apear the >pic can source enough to turn it off...what am I doing wrong? Probly >something stupid..anyway > Tim, You aren't accidentally setting the pin to "input" rather than to "hi", are you? Does you code possibly have STATUS.RP0 = 1 ? When you pull up the base of a pnp wired like this, you are actually turning off the transistor, so the base current goes to zero. So, source current is not a problem. Actually I would have thought you might have a problem with sink current instead. Transistor current gain decreases for higher collector currents, and may not be 100 for this case. You may not be able to pull a full 90 mA of collector current with only ~ 4v/4.7K = .8mA of base current. May need a smaller Rbase, maybe 2.2K, in this case. - dan michaels ====================== -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.