Pullup questions

Started by Vic Fraenckel January 17, 2005
I am designing my first PIC board. It will use a 16f876. I will use two
PORTA pins and the USART pins RC6 and RC7 for serial comms. The board will
be expanded later to use either I2C or SPI. The questions I have are:

1. Should ALL I/O pins be pulled up to +5V or should ONLY the unused I/O
pins be pulled up? I have been told that ALL I/O pins should be pulled up
with 10k.

2. What power value should the pullups be. I am planning on 1/4 watt.

3. Can I use SMT resistors/arrays?

Any enlightenment will be appreciated.

TIA

Vic
________________________________________________________

Victor Fraenckel - The Windman
victorf ATSIGN windreader DOTcom
KC2GUI

Home of the WindReader Electronic Theodolite
Read the WIND

"Victory at all costs, victory in spite of all terror, victory however long
and hard the road may be; for without victory there is no survival."
- Winston [Leonard Spencer] Churchill (1874 - 1965)

"Dost thou not know, my son, with how little wisdom the world is governed?"
-Count Oxenstierna (ca 1620) to the young King Gustavus Adolphus

"People sleep peacefully in their beds at night only because rough
men stand ready to do violence on their behalf."
-George Orwell





--- In , "Vic Fraenckel" <victorf@w...> wrote:
> I am designing my first PIC board. It will use a 16f876. I will
use two
> PORTA pins and the USART pins RC6 and RC7 for serial comms. The
board will
> be expanded later to use either I2C or SPI. The questions I have
are:
>
> 1. Should ALL I/O pins be pulled up to +5V or should ONLY the
unused I/O
> pins be pulled up? I have been told that ALL I/O pins should be
pulled up
> with 10k.

stupidity... think a little what Ohm's law say. When you have
inputs which must active low, yes you've pulling them up. But when
you have outputs active low or active high, who the hell is
requiring pullups ? Have an oped drain output ? Yes, pull it up.

Or never think and do what other people are saying. >
> 2. What power value should the pullups be. I am planning on 1/4
watt.

And is to difficult for you to compute the resistor values ?
0.125W is often ok for the poor PIC >
> 3. Can I use SMT resistors/arrays?
>

if you live in US yes, else is forbidden !

:)
Vasile
http://surducan.netfirms.com



Vic,

No need to pull-up all the IO-pins. They have internal
pullups that you can configure, and besides, you can
allways define the unused pins to be output, so no
pullups are needed.
If you insist, yes 10k is a good value, and since
there will be no more than 25mA running thrue them,
1/5 watt resistors will do fine.

Kees

--- Vic Fraenckel <> wrote:

> I am designing my first PIC board. It will use a
> 16f876. I will use two
> PORTA pins and the USART pins RC6 and RC7 for serial
> comms. The board will
> be expanded later to use either I2C or SPI. The
> questions I have are:
>
> 1. Should ALL I/O pins be pulled up to +5V or should
> ONLY the unused I/O
> pins be pulled up? I have been told that ALL I/O
> pins should be pulled up
> with 10k.
>
> 2. What power value should the pullups be. I am
> planning on 1/4 watt.
>
> 3. Can I use SMT resistors/arrays?
>
> Any enlightenment will be appreciated.
>
> TIA
>
> Vic
>
________________________________________________________
>
> Victor Fraenckel - The Windman
> victorf ATSIGN windreader DOTcom
> KC2GUI
>
> Home of the WindReader Electronic Theodolite
> Read the WIND
>
> "Victory at all costs, victory in spite of all
> terror, victory however long
> and hard the road may be; for without victory there
> is no survival."
> - Winston [Leonard Spencer] Churchill (1874 - 1965)
>
> "Dost thou not know, my son, with how little wisdom
> the world is governed?"
> -Count Oxenstierna (ca 1620) to the young King
> Gustavus Adolphus
>
> "People sleep peacefully in their beds at night only
> because rough
> men stand ready to do violence on their behalf."
> -George Orwell >
>

__________________________________



You know Vasily, you're a real ass. Vic was asking a couple of
sensible questions, and prefaced his remarks by saying this was his
first PIC board. I'll bet you didn't know ohms law when you were born
- you learned it sometime just like the rest of us. Vic is trying to
learn something. You're response was rude, and insensitive. Apologize
or go away.

Arlen Fletcher

On Jan 17, 2005, at 6:29 AM, Vasile Surducan wrote:

>
>
> --- In , "Vic Fraenckel" <victorf@w...> wrote:
>> I am designing my first PIC board. It will use a 16f876. I will
> use two
>> PORTA pins and the USART pins RC6 and RC7 for serial comms. The
> board will
>> be expanded later to use either I2C or SPI. The questions I have
> are:
>>
>> 1. Should ALL I/O pins be pulled up to +5V or should ONLY the
> unused I/O
>> pins be pulled up? I have been told that ALL I/O pins should be
> pulled up
>> with 10k.
>
> stupidity... think a little what Ohm's law say. When you have
> inputs which must active low, yes you've pulling them up. But when
> you have outputs active low or active high, who the hell is
> requiring pullups ? Have an oped drain output ? Yes, pull it up.
>
> Or never think and do what other people are saying. >>
>> 2. What power value should the pullups be. I am planning on 1/4
> watt.
>
> And is to difficult for you to compute the resistor values ?
> 0.125W is often ok for the poor PIC >>
>> 3. Can I use SMT resistors/arrays?
>>
>
> if you live in US yes, else is forbidden !
>
> :)
> Vasile
> http://surducan.netfirms.com >
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links >
>







> > 3. Can I use SMT resistors/arrays?
> >
>
> if you live in US yes, else is forbidden !
>
> :)
> Vasile
> http://surducan.netfirms.com

Is this a joke or what ?



I do not think one uncalled for remark deserves another. People have
bad days.

Maybe two apologies, then lets forget it?

Chad

--- HangGlider <> wrote:

> You know Vasily, you're a real ass. Vic was asking a couple of
> sensible questions, and prefaced his remarks by saying this was his
> first PIC board. I'll bet you didn't know ohms law when you were
> born
> - you learned it sometime just like the rest of us. Vic is trying to
>
> learn something. You're response was rude, and insensitive.
> Apologize
> or go away.
>
> Arlen Fletcher
>
> On Jan 17, 2005, at 6:29 AM, Vasile Surducan wrote:
>
> >
> >
> > --- In , "Vic Fraenckel" <victorf@w...>
> wrote:
> >> I am designing my first PIC board. It will use a 16f876. I will
> > use two
> >> PORTA pins and the USART pins RC6 and RC7 for serial comms. The
> > board will
> >> be expanded later to use either I2C or SPI. The questions I have
> > are:
> >>
> >> 1. Should ALL I/O pins be pulled up to +5V or should ONLY the
> > unused I/O
> >> pins be pulled up? I have been told that ALL I/O pins should be
> > pulled up
> >> with 10k.
> >
> > stupidity... think a little what Ohm's law say. When you have
> > inputs which must active low, yes you've pulling them up. But when
> > you have outputs active low or active high, who the hell is
> > requiring pullups ? Have an oped drain output ? Yes, pull it up.
> >
> > Or never think and do what other people are saying.
> >
> >
> >>
> >> 2. What power value should the pullups be. I am planning on 1/4
> > watt.
> >
> > And is to difficult for you to compute the resistor values ?
> > 0.125W is often ok for the poor PIC
> >
> >
> >>
> >> 3. Can I use SMT resistors/arrays?
> >>
> >
> > if you live in US yes, else is forbidden !
> >
> > :)
> > Vasile
> > http://surducan.netfirms.com
> >
> >
> >
> >
> >
> >
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
> > instructions
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>


=====
My software has no bugs, only undocumented features.
__________________________________





--- In , Chad Russel <chadrussel@y...> wrote:
> I do not think one uncalled for remark deserves another. People have
> bad days.
>
> Maybe two apologies, then lets forget it?
>
> Chad

maybe everyone should go away! seriously, he did put a smiley at the
end. Perhaps people should just relax a little.

On the point V raised, one should think about Ohms Law when asking
about resistor sizing. He said it harshly but there was some truth
his response. 5/10K is a pretty small number, 5 times that is still
small and just about any resistor size will work. I would have
prefered that he teach rather than chide, though.

I have taught college level courses and it was always amazing to me
how many people asked questions that, had they thought about it for a
sub-second duration, they could have easily answered themselves. My
response was always a leading question. The ones that got the clue
were good students, the ones that didn't usually switched majors. By
the end of the semester, the good ones had learned to engage brain
before opening mouth.

Phil



Ok - I apologize to the list for calling Vasili an ass. I won't
apologize for calling his response rude and insensitive. Smiley face
or not, you don't call someone stupid for asking a question - I don't
care what the setting is - it's not a good way to promote learning.

Arlen Fletcher

On Jan 17, 2005, at 10:09 AM, Chad Russel wrote:

>
> I do not think one uncalled for remark deserves another. People have
> bad days.
>
> Maybe two apologies, then lets forget it?
>
> Chad
>
> --- HangGlider <> wrote:
>
>> You know Vasily, you're a real ass. Vic was asking a couple of
>> sensible questions, and prefaced his remarks by saying this was his
>> first PIC board. I'll bet you didn't know ohms law when you were
>> born
>> - you learned it sometime just like the rest of us. Vic is trying to
>>
>> learn something. You're response was rude, and insensitive.
>> Apologize
>> or go away.
>>
>> Arlen Fletcher
>>
>> On Jan 17, 2005, at 6:29 AM, Vasile Surducan wrote:
>>
>>>
>>>
>>> --- In , "Vic Fraenckel" <victorf@w...>
>> wrote:
>>>> I am designing my first PIC board. It will use a 16f876. I will
>>> use two
>>>> PORTA pins and the USART pins RC6 and RC7 for serial comms. The
>>> board will
>>>> be expanded later to use either I2C or SPI. The questions I have
>>> are:
>>>>
>>>> 1. Should ALL I/O pins be pulled up to +5V or should ONLY the
>>> unused I/O
>>>> pins be pulled up? I have been told that ALL I/O pins should be
>>> pulled up
>>>> with 10k.
>>>
>>> stupidity... think a little what Ohm's law say. When you have
>>> inputs which must active low, yes you've pulling them up. But when
>>> you have outputs active low or active high, who the hell is
>>> requiring pullups ? Have an oped drain output ? Yes, pull it up.
>>>
>>> Or never think and do what other people are saying.
>>>
>>>
>>>>
>>>> 2. What power value should the pullups be. I am planning on 1/4
>>> watt.
>>>
>>> And is to difficult for you to compute the resistor values ?
>>> 0.125W is often ok for the poor PIC
>>>
>>>
>>>>
>>>> 3. Can I use SMT resistors/arrays?
>>>>
>>>
>>> if you live in US yes, else is forbidden !
>>>
>>> :)
>>> Vasile
>>> http://surducan.netfirms.com
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> to unsubscribe, go to http://www.yahoogroups.com and follow the
>>> instructions
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
> > =====
> My software has no bugs, only undocumented features. >
> __________________________________ > to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links >
>







Do you need pullups? Well, if you intend to feed an input pin with
a logic signal, then no. Pullups are not required.

On the other hand, if you intend to feed the input with a mechanical
switch, some form of pullup is required. Only PORTB has weak
pullups (very weak!) internal which can be turned on or off. PORTA
& PORTC do not have internal pullups so you should provide them.
There is a POSSIBILITY that the circuit will work without the pullup
but don't count on it.

As to the value of the pullup: there is no input leakage current to
speak of (1 microamp) so selecting a value guaranteed to provide a
logic 1 is not important (not true with TTL). So the issue is to
select a value that will flow enough current through the mechanical
switch to guarantee conduction. 10K may be too much and 4.7K is
more typical and for big ugly switches, 1K may be necessary. From a
power dissipation point of view, until the pin is actually used as
an input and the input is low, no current flows so it doesn't matter
that the resistor is a smaller value.

The maximum voltage across the resistor is 5V (assuming Vcc=5V) so
for 10k the wattage (E*E/R) is (5 * 5) / 10000 or 0.0025 watts. You
can't buy a resistor that small! 2.5 milliwatts! Even if you went
to 4.7k the value would be 5.3 milliwatts. Any resistor network you
can find will be adequate. You'd need a hundred resistors in
parallel to get to 1/4 watt!

Suppose you wire those resistors in place and then want to use the
pin for output. Well, a 4.7k resistor will add about 1 mA of
current and the limit on the pins is 25 mA so we're already using 4%
of the capability. Who cares?

Since you don't have your plans firmed up, pull all the inputs to
Vcc with an individual 4.7k resistor. If you want to get fancy, put
a parallel row header in place and use shunts to decide whether the
resistor is in or out of the circuit but it really is overkill.

--- In , "Vic Fraenckel" <victorf@w...> wrote:
> I am designing my first PIC board. It will use a 16f876. I will
use two
> PORTA pins and the USART pins RC6 and RC7 for serial comms. The
board will
> be expanded later to use either I2C or SPI. The questions I have
are:
>
> 1. Should ALL I/O pins be pulled up to +5V or should ONLY the
unused I/O
> pins be pulled up? I have been told that ALL I/O pins should be
pulled up
> with 10k.
>
> 2. What power value should the pullups be. I am planning on 1/4
watt.
>
> 3. Can I use SMT resistors/arrays?
>
> Any enlightenment will be appreciated.
>
> TIA
>
> Vic
> ________________________________________________________
>
> Victor Fraenckel - The Windman
> victorf ATSIGN windreader DOTcom
> KC2GUI
>
> Home of the WindReader Electronic Theodolite
> Read the WIND
>
> "Victory at all costs, victory in spite of all terror, victory
however long
> and hard the road may be; for without victory there is no
survival."
> - Winston [Leonard Spencer] Churchill (1874 - 1965)
>
> "Dost thou not know, my son, with how little wisdom the world is
governed?"
> -Count Oxenstierna (ca 1620) to the young King Gustavus Adolphus
>
> "People sleep peacefully in their beds at night only because rough
> men stand ready to do violence on their behalf."
> -George Orwell



> Ok - I apologize to the list for calling Vasili an ass. I won't
> apologize for calling his response rude and insensitive. Smiley face
> or not, you don't call someone stupid for asking a question - I don't
> care what the setting is - it's not a good way to promote learning.

Don't be too sure. Sometimes someone should be called a stupid asshole
for asking a dumb question, just to aim his mind in the right direction. And don't forget
- Vasile is not a native english speaker
- he did give a (good!) answer

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu