I keep noticing that when using portA that most people add external pullup
resistors when used for input. Why not the built in weak pullup resistors?
Should I avoid them and use external pullups for switches.
Thanks Wrong Way Ray
> I keep noticing that when using portA that most people add external pullup
> resistors when used for input. Why not the built in weak pullup resistors?
The built in weak pullups are on port B, not port A.
> > I keep noticing that when using portA that most people add external
>pullup
> > resistors when used for input. Why not the built in weak pullup
>resistors?
>
>The built in weak pullups are on port B, not port A.
But on most PICs, one of the PORTA pins (usually pin 4) is open-drain which
would require an external pullup to be passively driven low.
That being said, it might be worthwhile to mention why someone would choose
not to use the on-board weak pullups. Sometimes, driving a high capacitive
load may cause delays of several cycles when trying to set or clear an
output pin. If you choose the weak pullups, this delay may create problems
if you use successive port reads, or even if you put one or two 'nops' in
between reads.
If you want faster pin change response characteristics, or if you are using
I2C between chips and want to maximize throughput per unit time, you would
likely choose a lower resistance for an external pullup, say 10K or even
4.7K. Resistors are so cheap and small it's really hardly worth using the
on-board ones.
I'm not an EE, so I can't really go more in depth, but this is as far as I
really ever needed to take my knowledge of this particular detail. If you
need more information, I'm sure some of the more qualified people can give
it to you.
--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Drew Vassallo wrote:
>
> > > I keep noticing that when using portA that most people add external
> >pullup
> > > resistors when used for input. Why not the built in weak pullup
> >resistors?
On the 16F8X processors,
Port A has no pullup
RA0-RA3 have tri-state totem pole outputs
RA4 is open collector (drain for the purists)
Port B has a weak pullup which may be enabled (or disabled). According
to the spec, this weak current may be 50uA when VDD is 5.0V and the
input is at VSS. This may seem like there is a 100K resistor on the
port; however, the pullup is implemented with a transistor and not a
resistor, so the I/V ratio will (probably) vary as the input gets closer
to VDD.
The problem is that if the pin is connected to any device that has an
input loading, this weak pullup may not be sufficient to pull it high or
even just hold it.
Bottom line, the weak pullups are good for non connected inputs, but may
be unreliable in a system unless you are watching your input loading
characteristics VERY carefully.
>Drew Vassallo wrote:
> >
> > > > I keep noticing that when using portA that most people add external
> > >pullup
> > > > resistors when used for input. Why not the built in weak pullup
> > >resistors?
Hey! I didn't write that, I wrote a response to that :)
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Opps last letter I said Port A instead of Port B so here it is corrected:
I keep noticing that when using portB (16f876) that most people add external
pullup
resistors when used for input. Why not use the built in weak pullup
resistors?
Should I avoid them and use external pullups for switches all the time?
Thanks Wrong Way Ray
Ray wrote:
>Opps last letter I said Port A instead of Port B so here it is corrected:
>
>I keep noticing that when using portB (16f876) that most people add external
>pullup
>resistors when used for input. Why not use the built in weak pullup
>resistors?
>Should I avoid them and use external pullups for switches all the time?
Possibly because;
1) They need 'stiffer' pullups than what the weak ones provide.
2) They forgot or don't realise that they are available.
3) They only want pullups on certain pins.
Regards...
On Fri, 20 Apr 2001 09:56:44 +1000 David Duffy
<.....piclistKILLspam@spam@AUDIOVISUALDEVICES.COM.AU> writes:
> Ray wrote:
> >Opps last letter I said Port A instead of Port B so here it is
> corrected:
> >
> >I keep noticing that when using portB (16f876) that most people add
> external
> >pullup
> >resistors when used for input. Why not use the built in weak pullup
> >resistors?
> >Should I avoid them and use external pullups for switches all the
> time?
>
> Possibly because;
> 1) They need 'stiffer' pullups than what the weak ones provide.
> 2) They forgot or don't realise that they are available.
> 3) They only want pullups on certain pins.
> Regards...
The only wanting pull-ups on certain pins is a good reason. I often want
pull-ups on everything but RB0 so I can have the interrupt not pulled up.
It SEEMS that Microchip could tie the weak pull-up FETs to the output
latch and only pull up the pins where the latch is set to 1 (since you're
not using the output latch when in input mode). But, it appears that's
not what they did.
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today! For your FREE software, visit:
dl.http://www.juno.com/get/tagj.
Raymond Choat wrote:
> Opps last letter I said Port A instead of Port B so here it is
> corrected:
>
> I keep noticing that when using portB (16f876) that most people
> add external pullup resistors when used for input. Why not use
> the built in weak pullup resistors?
> Should I avoid them and use external pullups for switches all
> the time?
> Thanks Wrong Way Ray
And here is my answer again...
Port B has a weak pullup which may be enabled (or disabled). According
to the spec, this weak current may be 50uA when VDD is 5.0V and the
input is at VSS. This may seem like there is a 100K resistor on the
port; however, the pullup is implemented with a transistor and not a
resistor, so the I/V ratio will (probably) vary as the input gets closer
to VDD.
The problem is that if the pin is connected to any device that has an
input loading, this weak pullup may not be sufficient to pull it high or
even just hold it.
Bottom line, the weak pullups are good for non connected inputs, but may
be unreliable in a system unless you are watching your input loading
characteristics VERY carefully.
One thing to note: even if port B pullups are enabled, they are
automatically disabled on pins that are set as outputs. This can be
important for reducing power consumption. To see why, assume that they were
not disabled on outputs. Now any pin that is outputting a zero is doing so
by pulling against the weak pullup and current will flow.
Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)
In my design using a 16F84A for X10 appliance module, there are 4 push
button switches connected to PortB pins 0 to 3 for manual control of 4
relays. I was initially using four 10K pull-up resistors.
When I learned about the weak pull-up on PotrB, it came as a pleasant
surprise. Now with reduced part count, my circuit works perfectly. I use
another PB switch for PortA.0 pin. Unfortunately, here I have to use a
resistor as the weak pull-up option is not available for PortA!
> And here is my answer again...
>
> Port B has a weak pullup which may be enabled (or disabled).
> According
> to the spec, this weak current may be 50uA when VDD is 5.0V and the
> input is at VSS. This may seem like there is a 100K resistor on the
> port; however, the pullup is implemented with a transistor and not a
> resistor, so the I/V ratio will (probably) vary as the input
> gets closer
> to VDD.
>
> The problem is that if the pin is connected to any device that has an
> input loading, this weak pullup may not be sufficient to pull
> it high or
> even just hold it.
>
> Bottom line, the weak pullups are good for non connected
> inputs, but may
> be unreliable in a system unless you are watching your input loading
> characteristics VERY carefully.
>When I learned about the weak pull-up on PotrB, it came as a pleasant
>surprise. Now with reduced part count, my circuit works perfectly. I use
Didn't it work perfectly with the external 10K resistors? This may be a
good application of the internal pullups, but there's no way it would fix
any problems.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
> I keep noticing that when using portB (16f876) that most people add
external
> pullup
> resistors when used for input. Why not use the built in weak pullup
> resistors?
> Should I avoid them and use external pullups for switches all the time?
The weak pullups are just that, weak. Too weak for some applications.
However, they are ideal for sensing switches with no other parts required.
I've used pushbuttons to ground tied to port B inputs many times. Don't
forget to debounce them.
> -----Original Message-----
> From: Drew Vassallo [@spam@snurpleKILLspamHOTMAIL.COM]
> Sent: Friday, April 20, 2001 5:47 PM
> To: KILLspamPICLISTKILLspamMITVMA.MIT.EDU
> Subject: Re: [PIC]: Pullups
>
> >When I learned about the weak pull-up on PotrB, it came as a pleasant
> >surprise. Now with reduced part count, my circuit works
> perfectly. I use
>
> Didn't it work perfectly with the external 10K resistors?
Yes, it did. But I wanted to accommodate all the components on a small
board. Removing 4 resistors and still having the circuit working reliably
was certainly a benefit.
> This may be a good application of the internal pullups,
> but there's no way it would fix any problems.
As I said earlier, my only problem was that I could not choose a smaller
board, This was not critical, but using the internal pull-up option solved
my problem.
Raymond Choat wrote:
>
> If I am using PIC 1 to control a card with Pic 2 on it, can I control it
> like this?
> Wrong Way Ray
>
> ------------------------------------------------------------------------
> Name: input.jpg
> input.jpg Type: JPEG Image (image/jpeg)
> Encoding: base64
I assume the round blue things are PB switches. If so, one will connect
GND directly to an output pin from PIC 1, which may damage it.
Put a 1K resistor in series with the switch. It should still pull the
input to around 0.1V.
You will probably need a common ground connection also.
Raymond Choat wrote:
> If I am using PIC 1 to control a card with Pic 2 on it, can I control it
> like this?
> Wrong Way Ray
From what I see, it can work, as long as PIC 1 outputs are not actively
driven high, since a button push would create a short to GND. I am
assuming you have a GND connection between the 2 boards.
You could add a resistor (between 1K and 3K) in series with the
connections to the PBs. Or if you moved the connections for the buttons
to between the resistors, then you could change the 220 Ohm resistors to
1K-2K and limit the max current from PIC 1 (if PIC 1 outputs were
inadvertently driven high). If you are worried about Zaps from the
buttons, add resistors in series with the PIC 2 Port B pins.