Searching \ for '[PIC:] PORTB Internal Pullups, was PORTB Sanity Ch' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=port
Search entire site for: 'PORTB Internal Pullups, was PORTB Sanity Ch'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] PORTB Internal Pullups, was PORTB Sanity Ch'
2005\04\06@142037 by Mike Hord

picon face
At the bottom find the majority of my (and Jan-Erik's) previous
postings on this matter, for context.

As promised, I did a few experiments with a half-built
micropower board.  All that's on it right now is a PIC18F2320,
a micropower LDO regulator (TPS77001), necessary bypass
capactiors for other ICs yet to be populated, and a few other
passives which are not connected to anything yet.

In its "natural" state, i.e., as it is intended to operate, it pulls
(per my meter; I don't know how good the accuracy really is)
25 uA.  This is with PORTB all made into outputs and held
low.  With PORTB all as outputs and held high, the current
draw is 825 uA.  The only connection to any of these pins is
between RC7 and RB1, but RC7 is configured as an input,
so there SHOULD be no conflict.

With PORTB as inputs, and the internal pullups enabled,
the current draw is, you guessed it, 825 uA.  That value
doesn't change with respect to whether LATB is all high
or all low.

The datasheet tells me that at 5V, I should expect Ipu to
be not more than 400 uA.  Strange that it should be 800.
Perhaps it's due to the RC.7->RB.1 connection, but I
don't see why, since the datasheet also tells me that
input leakage current is < 1uA.

Comments?

Mike H.

{Quote hidden}

2005\04\06@145207 by Jan-Erik Soderholm

face picon face
Mike Hord wrote :

> With PORTB as inputs, and the internal pullups enabled,
> the current draw is, you guessed it, 825 uA.

What about if the wpu's are disabled ?

> The datasheet tells me that at 5V, I should expect Ipu to
> be not more than 400 uA.

I read that value (Ipu) to be *per* pin. If a pin with
spu enabled is tied to Vss (gnd), you will have aprox 400uA
(= Ipu) floating through the wpu, out from the pin to gnd.

Jan-Erik.



2005\04\06@150626 by Robert Rolf

picon face
And with WPU enabled and half the bits high and half low?
How about running a ripple counter on the bits so that
they cycle through all high to all low over 10 seconds (so
your meter can measure the changing current)?

If I understand correctly, with WPU enabled, and the port
bits high you're getting 825uA instead of the expected
25uA?

Jan-Erik Soderholm wrote:
{Quote hidden}

2005\04\06@153429 by Mike Hord

picon face
> > With PORTB as inputs, and the internal pullups enabled,
> > the current draw is, you guessed it, 825 uA.
>
> What about if the wpu's are disabled ?

I didn't check; in my experience, leaving an input floating is
an invitation to ridiculously random current draws.  As
*originally* programmed (i.e., with some of the PORTB pins
set as inputs, but with the ICs and pullups that are normally
supposed to keep them from floating not installed) current
draw was ~1.5mA.  And that's with only 3 pins as inputs
and floating!

> > The datasheet tells me that at 5V, I should expect Ipu to
> > be not more than 400 uA.
>
> I read that value (Ipu) to be *per* pin. If a pin with
> spu enabled is tied to Vss (gnd), you will have aprox 400uA
> (= Ipu) floating through the wpu, out from the pin to gnd.

Interesting interpretation.  The pullup's value would then be
~12.5k.  It's a very logical interpretation as well.

It doesn't really explain why these *unconnected* pins seem
to be adding ~800 uA to the sleeping current of this board.

I must be doing something wrong...<fiddling with code>.

I think I figured it out.  I think having the pins high was
causing the PIC to enter an interrupt handler and get
stuck rather than going to sleep.  Once I disabled GIE,
the current with WPU's on dropped to 30uA.  The added
few uA is because I've been adding stuff to the board
since I ran the initial tests.

Color me chastened.  I was interpreting the Ipu spec
along the same vein as current draws provided for
peripherals (i.e., ADC, BOD, Timer1, etc.).  I also
see now that the spec is stated with Vdd = 5V and
Vpin = Vss.  Sigh.  What an ass I feel like.

Many thanks to you all (especially Bill and Jan-Erik)
for tolerating my...ignorance...politely, and pushing
me in the right direction.

Mike H.

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