Searching \ for '[PIC]: Problems using PIC to controll small fan' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'Problems using PIC to controll small fan'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Problems using PIC to controll small fan'
2001\06\12@231929 by Tim Thompson

flavicon
face
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

Thanks in advance,
Tim Thompson



-
Remember, 'kill' doesn't kill processes, users kill processes.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\12@233133 by David Duffy

flavicon
face
Tim 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

Sounds like the PIC high level is not quite turning the transistor off.
Try adding a 10K resistor between the base & emitter of the transistor as
well as a small diode (1N914 or 1N4148) in series with the 4K7 resistor.
The cathode of the diode goes towards the PIC I/O pin. This means the
10K keeps the transistor turned off until the PIC pin pulls it low.
Regards...

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\12@234106 by hard Prosser

flavicon
face
Seems a bit strange - when the pin is high there should not be any base
current.
My first thought was pull-up resistors but since they are pull-UP this
should assist the turn off not prevent it.

Can you measure the voltages on the pin, the transistor base, the micro &
fan supplie(s) and that may give a clue.

Is the 5V supply to the fan the same as the 5V supply to the micro - or
could the micro be on a slightly lower supply?
Or if they are the same supply - are pulses from the fan upsetting the
micro - you will need a fair bit of (low esr) capacitance to cut it back to
a low level. Even if the avaerage fan current is low, the peak current may
be enough to upset things.
Is the transistor getting hot? If so leakage current may be causing the
problem.

Richard P





                   Tim Thompson
                   <irule@IRULE.N        To:     spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU
                   ET>                   cc:
                   Sent by: pic          Subject:     [PIC]: Problems using PIC to controll small fan
                   microcontrolle
                   r discussion
                   list
                   <PICLIST@MITVM
                   A.MIT.EDU>


                   13/06/01 14:59
                   Please respond
                   to pic
                   microcontrolle
                   r discussion
                   list






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

Thanks in advance,
Tim Thompson



-
Remember, 'kill' doesn't kill processes, users kill processes.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\13@004606 by website mail

flavicon
face
Tim,

I wopuld put a 10K ohm resistor from base to Emitter, and change the 4.7K
base resistor to 1K.  The 10K will pull the base high unless it's driven
low.
This will tend to hold the transistor off.  When the PIC pin is taken low,
the
1K resistor will allow 5 mA of base current (Approx) which should be more
than enough to drive the transistor on.  As an aside, what is the HFE of the
transistor you are using.  Is it greater than 100?  My guess is around 150
to 200.  If this is so, then the resistor values I suggest should work fine.
Let us know if this helps you out.

                                                                   Regards,

                                                                       Jim
{Original Message removed}

2001\06\13@005207 by Dan Michaels

flavicon
face
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.


2001\06\13@015814 by Dwayne Reid

flavicon
face
At 07:59 PM 6/12/01 -0700, 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.

I would keep everything as you have it, except add a 2.2K resistor from
base to emitter.  That raises the turn on voltage of the transistor from
about 0.7V to about 2V.  Its easy to do and should fix your problem.

dwayne



Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@021212 by Tim Thompson

flavicon
face
Thanks everyone for your help, it apears adding a base-emitter resistor did
the trick. Thanks again everyone for your help.

Thanks,
Tim Thompson

At 11:03 PM 6/12/2007 -0700, you wrote:
{Quote hidden}

>{Original Message removed}

2001\06\13@022132 by Dan Michaels

flavicon
face
Tim Thompson wrote:
>Thanks everyone for your help, it apears adding a base-emitter resistor did
>the trick. Thanks again everyone for your help.
>

Still makes no sense to me, as I would think this should only
matter if the I/O pin is floating. Did you check that RP0 bit?

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@025108 by Tim Thompson

flavicon
face
Yes it was indeed set to output.

At 02:21 AM 6/13/2001 -0400, you wrote:
>Tim Thompson wrote:
>>Thanks everyone for your help, it apears adding a base-emitter resistor did
>>the trick. Thanks again everyone for your help.
>>
>
>Still makes no sense to me, as I would think this should only
>matter if the I/O pin is floating. Did you check that RP0 bit?
>
>--
>http://www.piclist.com hint: The PICList is archived three different
>ways.  See http://www.piclist.com/#archives for details.
>
>
>
>

-
Remember, 'kill' doesn't kill processes, users kill processes.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@032344 by Anand Dhuru

flavicon
face
Try reducing the base resistance? you could safely go down upto 1K

Regards,

Anand

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@035941 by Vasile Surducan

flavicon
face
On Wed, 13 Jun 2001, Dan Michaels wrote:

> Tim Thompson wrote:
> >Thanks everyone for your help, it apears adding a base-emitter resistor did
> >the trick. Thanks again everyone for your help.
> >
>
> Still makes no sense to me, as I would think this should only
> matter if the I/O pin is floating. Did you check that RP0 bit?
>
 It has sense, Dan .  The high level supplied by pic pin's hasn't enough
current to keep off the transistor( or is floating...) Same thing is
happening to many 8051 clones like atmel 89c2051. Problem can be solved
also by connecting one or two diode in series from Vcc to emiter ( to be
in conduction ), so when the pic pin is in high state the Vbe have a
negative potential and sure keep off the transistor.
regards, Vasile

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@055214 by Spehro Pefhany

picon face
At 12:52 AM 6/13/01 -0400, you wrote:

>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.

Yes, and modern CMOS outputs as on the PIC pull cleanly to the
+ve rail, so the base resistor effectively is connected across
the emitter-base junction when the output is "high".

>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.

I agree. I try to keep forced beta to ~20 for low voltage transistors
in deep saturation (high voltage ones tend to have even worse beta),
so if the fan is 90mA, the base current should be around 4.5mA, so
about a 1K resistor (back of the napkin calculation).

I suspect the transistor was getting way hot and thus not turning
off completely (at 200'C Tj).

               +5
               | E
             |/
PIC --[1K]----|     PNP
             |\
               x----|<|---x
               |          |
            [FAN]         |
               |          |
               x----------x
              0V

BTW, I'd use a slightly beefier TO-92 transistor for this, such as
a 2N4403 (500mA Ic(max)). Price difference is pretty much negligible.
You can run into problems with SOA (safe operating area) with
wimpy transistors switching inductive loads because at the turn off
you have high voltage and current simultaneously present at the
collector.. result can be 2nd breakdown. There should be curves on
this on the full data sheet, but a lot of data sheets are truncated
to only a few pages on these "mature" devices.

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@082950 by Olin Lathrop

face picon face
> 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.

I see no reason for this resistor, although this isn't causing your problem.

> (-) 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

Check the +5 supply.  Is the fan causing it to droop?  Glitching it?  Is
everything properly bypassed?  Keep in mind that the fan startup current
will be much higher than the continuous current of 90mA.

A properly operating PIC will have no problem driving a 4.7K resistor with
the other end anywhere from 0 to 5 volts.  What is the voltage at the PIC
pin when the fan won't go off?

Overall, I think this is either a power supply problem, or more likely a
software bug where the port latch is getting set low when you don't expect
it.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam.....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.


2001\06\13@082957 by Olin Lathrop

face picon face
> 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, EraseMEolinspam_OUTspamTakeThisOuTembedinc.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.


2001\06\13@094526 by James Paul

flavicon
face
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:

{Quote hidden}

@spam@jimKILLspamspamjpes.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@111841 by Dan Michaels

flavicon
face
Olin wrote:
.........
>Overall, I think this is either a power supply problem, or more likely a
>software bug where the port latch is getting set low when you don't expect
>it.
>

Exactly my feeling. Given how much current the motor takes to
operate, I find it hard to believe that pulling the base up using
the PIC - even if not all the way - would leave enough collector
current to keep the motor runnning.

Personally for such a circuit, I would probably go with an NPN or
MOSFET inverter anyway, so you would have more versatility in
choosing loads and load voltages.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@120655 by Olin Lathrop

face picon face
>  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.

Yes, I understand all that (and have for about 25 years, some of which were
spent earning a masters degree in electrical engineering from RPI).

>  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.

I agree with your facts but not your conclusion.  PICs use totem pole CMOS
outputs.  These actively pull both down and up.  It may be true that the
pullups are a bit weaker than the pulldowns, but shouldn't matter much
because there should be virtually no current when the base is driven to very
near the emitter.  In other words, we are looking at the PIC's open circuit
high output voltage, which is very close to the power rail.  The base won't
start drawing meaningful current until it is forward biased at least a few
100mV.

I think what was happening is that the transistor wasn't driven hard enough.
This kept it from going into saturation, which caused the voltage drop
accross it to increase, which caused it to heat up.  Its temperature
probably exceeded specs, which caused it to leak accross the base-emitter
junction, which caused it to stay on.  The correct solution is therefore to
provide more base current in the on state by lowering the base resistor to
1K ohms.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, KILLspamolinKILLspamspamembedinc.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.


2001\06\13@124054 by James Paul

flavicon
face
Olin,

Yes, I agree with lowering the base resistor to allow more current
in the base circuit to drive the transistor on harder, which is what
I suggested in the beginning, (as did several others).

About the heating effects, that is a very likely possibility.  And I
agree with your conclusion there.

Maybe I am doing things wrong when I do this, but I have always put
a pullup resistor on an NPN transistor to pull the base high when I
want to make sure the transistor is on when I want it to be on, or a
pull down resistor when I want to make sure it is off until I drive
it high, regardless of what I have driving it.
And so far, when I have done this, I have yet to have any problems
with heating or false turn on's or off's.  Maybe it's not good
design practice, but it work well, so I probably won't change.

Anyway, when I suggested he add a resistor from base to emitter, it
was my experience talking.  As I said before, I have always done
this and haven't had any problems.   And I also suggested he change
the base resistor to 1K ohms to get the base drive needed.

And someone suggested using a heavier transistor.  I believe this
would be a good idea.   Someone also suggested that an Hfe of ~20
would be good for a power transistor.  The transistor he is using is
not a power transistor, but a small signal transistor.  So, again
the heftier transistor would be a good idea.

So, bottom line from my point of view is I am going on my experience
and how I would do it.  You on the other hand have a much higher
education than me, so who am I to argue.


                                            Regards,

                                              Jim




On Wed, 13 June 2001, Olin Lathrop wrote:

{Quote hidden}

spamBeGonejimspamBeGonespamjpes.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\13@134121 by Dan Michaels

flavicon
face
James Paul wrote:
......
> Anyway, when I suggested he add a resistor from base to emitter, it
> was my experience talking.  As I said before, I have always done
> this and haven't had any problems.   And I also suggested he change
> the base resistor to 1K ohms to get the base drive needed.
>

The base pullup resistor is definitely a good idea, and will
hold the motor off during the bootup period of the PIC, but
from the sounds of it, there is some other problem with Tim's
circuit and/or s.w.

- dan

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\14@080043 by Vasile Surducan

flavicon
face
On Wed, 13 Jun 2001, James Paul wrote:

>  Olin,

...

>  So, bottom line from my point of view is I am going on my experience
>  and how I would do it.  You on the other hand have a much higher
>  education than me, so who am I to argue.
>


  James, you haven't why to argue because you have right.
  Also Olin have right. Both of you are forcing some current into/from
  transistor's base in different ways.
  I've test both your solution in to old project. In Atmel cmos
  2051/4051 was working only James solution. On pic are good both.

  So please be happy !
  Vasile ( from prison...)






{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@113358 by James Paul

flavicon
face
Vasile,

Thanks for the confirmation that my experience wasn't all wrong.
It's just that I've used that configuration for so long, that I
knew it would work.

Now, about Olin and his solution.   He has a Masters Degree in
Electrical Engineering.  I have only a two year Associates Degree
in Electronic Engineering Technology.  I do not doubt that he knows
things that I don't about transistor and their circuits.  I don't
claim to know more than a Masters Degree holder.  And I have very
much respect for anyone with any post secondary school education,
ie..college.  I know how hard I worked to get my two year degree.
So I can only imagine what it would be like to work for four years
to get a Bachelors Degree, and then go back for another two years
to complete the Masters study.  That is an accomplishment that any
one can be proud of.

However, in addition to the theory that you learn in school,
experience is a very large part of the equation.  And that
experience is gotten by building circuits and experimenting with
them to put the theory into perspective.  That is where I was
coming from in my suggestions to solve the problem.   And this has
been proven by you.

Anyway, no gloating here.  I just wanted to explain my feelings to
all.  What solution the man chooses is up to him.  I just put forth
my suggestion.   If he chooses to use it, fine.  If not, thats fine
too.

                                             Regards,

                                               Jim



On Thu, 14 June 2001, Vasile Surducan wrote:

{Quote hidden}

RemoveMEjimTakeThisOuTspamspamjpes.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamspamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@121615 by Dan Michaels

flavicon
face
Vasile wrote:
............
>   So please be happy !
>   Vasile ( from prison...)
>

Prison must not be so bad any more, if they have the
internet :-).

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@122610 by David Cary

flavicon
face
[tiny nit-pick]

James Paul <jimSTOPspamspamspam_OUTJPES.COM> on 2001-06-13 08:44:56 AM claimed that
> 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.

Yes, everyone knows this. However, everyone is wrong :-/.

All the CMOS devices I work with have exactly the same current sink as current
source.

For example,
the PIC16F7X data sheet
 http://www.microchip.com/0/lit/pline/picmicro/families/16f7x/index.htm

www.microchip.com/download/lit/pline/picmicro/families/16f7x/devices/16f77/30325a.pdf
says, on the first page,
 High Sink/Source Current: 25 mA
.

I would be surprised to learn of any PIC output that had a significant
difference in current sink vs. current source (except for ``open drain'' pins
like RA4).

--
David Cary
electronics nit-picker

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservSTOPspamspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@131708 by David W. Gulley

flavicon
face
David Cary wrote:
{Quote hidden}

Looking deeper into the PDF spec you reference, page 125 clarifies the
25mA sink/source as the MAXIMUM from any pin, not the typical.

I also find (on page 129) the VOL is given as 0.6V @ 8.5mA while the VOH
is given as VDD-0.7V @ -3.0mA.

 This indicates that the "pullup" transistor can not provide the same
current as the "pulldown" for a given voltage difference from the power
rail. Indeed, I would expect the VOH level to drop even further if
providing -8.5mA.

Based upon these specs, I would tend to agree with James Paul statement.

David W. Gulley
(another nit-picker)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@161826 by Bill Westfield

face picon face
   > 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.
   Yes, everyone knows this. However, everyone is wrong :-/.

CMOS isn't inherently able to sink more than it can source, but it is still
the case that many chips are built that way (presumably, this helps
conserve power and reduce switching transients.)


   All the CMOS devices I work with have exactly the same current sink as
   current source.

I doubt that very much...


   I would be surprised to learn of any PIC output that had a significant
   difference in current sink vs. current source (except for ``open
   drain'' pins like RA4).

PIC16F84: 20mA source, 25mA sink.  (is 25% "significant")

Atmel processors will sink 20mA (on at least some pins) and source
considerably less (there are curves that I read as "about 5mA")

TI's TLC555 timer chip sinks 150mA, sources 15mA
TI 74FCT logic buffers 64mA sink, 15mA Source. (74ACx and 74HCx are
symetric, though.)

BillW

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listserv@spam@spamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@164314 by Spehro Pefhany

picon face
At 01:16 PM 6/14/01 PDT, you wrote:

>CMOS isn't inherently able to sink more than it can source, but it is still
>the case that many chips are built that way (presumably, this helps
>conserve power and reduce switching transients.)

It _is too_ inherent! Two identical geometry devices, one p-channel and
one n-channel, the n-channel device will have lower Rds(on).

conductance K= (W/L) * u Cox/(L *2)

W is channel width
L is channel length
u is carrier mobility
Cox is gate to channel capacitance per unit area (so a function of gate
oxide thickness)

u (carrier mobility) for p-channel is about HALF what it is for n-channel
devices,
and the differences follow. A true complementary device is thus *impossible*
to create.

You could make the p-channel (pullup) device much larger to compensate
but they don't usually bother (or go to the expense of putting all that
transistor area in there, with more capacitance to drive, which would alter
other parameters). Most designs you can flip things around to
use the better sink current capability anyway.

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spamBeGonespeffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspam_OUTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\06\14@180550 by Olin Lathrop

face picon face
>  Thanks for the confirmation that my experience wasn't all wrong.
>  It's just that I've used that configuration for so long, that I
>  knew it would work.

James, I never said that it would not work with B-E resistor in there, only
that it was not necessary in this case.  I have used such a B-E resistor
many times also, especially when the transistor needed to shut off quickly
or when the base drive voltage couldn't get close enough to the emitter
voltage to guarantee the transistor would go off.  In this particular case
however, neither of these apply, and the transistor should have shut off.  I
thought it was important to understand why and treat the root cause instead
of just fixing the symptom.  If the root cause was that the transistor is at
a slightly higher supply voltage than the PIC, then adding a B-E resistor
would be the end of it.  If however, the transistor si not turnning on fully
and getting too hot and therefore leaking and not shutting off, then the B-E
resistor will only appear to fix the problem without addressing the root
cause.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, TakeThisOuTolin.....spamTakeThisOuTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservKILLspamspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\06\15@141521 by Roman Black

flavicon
face
David Cary wrote:
>
> [tiny nit-pick]
>
> James Paul <.....jimspamRemoveMEJPES.COM> on 2001-06-13 08:44:56 AM claimed that
> > 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.
>
> Yes, everyone knows this. However, everyone is wrong :-/.
>
> All the CMOS devices I work with have exactly the same current sink as current
> source.


Another "nit pick" is that you are both right.
Most PICs are now rated at sink 25mA/source 25mA.

But they are much BETTER at sinking the current.
All CMOS and TTL totem style outputs share a common
feature that has bugged me for 20 years since I
first started playing with TTL logic chips.

The SINK part of the output is ONE transistor/fet
unit, so the output only loses about 0.6v in sinking
current.

The SOURCE part of the output is more like a
darlington in performance and you lose TWO voltage
drops, typically 1.2v when sourcing current.

Check out any good logic chip books, the ones
that show the actual transistors inside each logic
gate.

With a typical PIC (for example) driving a led
at 10mA, the volts lost in sinking is about 0.8v,
so the output pin is about 0.8v. But sourcing 10mA
into the same led loses about 1.5v at the PIC
output, so you only have a total of 3.5v out to
drive the led, and yes the PIC dissipates more
power and is punished more.
-Roman

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamspamBeGonemitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...