Searching \ for '[PIC:] 16F873A PORTB Sanity Check' 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/ios.htm?key=port
Search entire site for: '16F873A PORTB Sanity Check'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] 16F873A PORTB Sanity Check'
2005\04\04@165638 by Mike Hord

picon face
> From reading the data sheet and from my observations on my board it
> appears that the PORTB on the 16F873A PIC can only source about 200uA
> while operating at 3.3V, is this correct?

That's insane.  ;-)

Truly, it seems VERY low. That sounds more like the operating current
of the device (for lower clock speeds) than the current limit.

What part of the datasheet are you reading?  And perhaps more
pertinent, is this in fact a 16 L F873A, or no L?  Because the L
becomes non-trivial at 3.3V operation.

Mike H.

2005\04\04@171939 by Jinx

face picon face

> > From reading the data sheet and from my observations on my board it
> > appears that the PORTB on the 16F873A PIC can only source about
> > 200uA while operating at 3.3V, is this correct?
>
> That's insane.  ;-)

In the membrane !!

Sounds nuttier than squirrel poop.........

At any Vdd, any I/O can sink/source 25mA, with a combined overall
I/O limit for the whole chip of 200mA

I "think" the OP might be assuming that a low quiescent current for the
PIC limits the I/O capabilities. The I/O switches are across Vss and
Vdd and not dependendent on what the core is consuming

2005\04\04@172958 by Roberts II, Charles K.

picon face


>> From reading the data sheet and from my observations on my board it
>> appears that the PORTB on the 16F873A PIC can only source about 200uA
>> while operating at 3.3V, is this correct?

>That's insane.  ;-)

OK, I figured I was :)

>Truly, it seems VERY low. That sounds more like the operating current
>of the device (for lower clock speeds) than the current limit.


It was a guestimate from looking at page 178 of the data sheet.

>What part of the datasheet are you reading?  And perhaps more
>pertinent, is this in fact a 16 L F873A, or no L?  Because the L
>becomes non-trivial at 3.3V operation.

It's not an L part.


I am trying to use PORTB,2 to drive a power on/off pin of LM2941. I
can't get that pin to do it. But I can drive it with PORTC, 5 fine,
without a pull up. The LM2941 only needs 300uA.

Any ideas of what I am doing wrong.  

2005\04\04@175937 by Jinx

face picon face
> It was a guestimate from looking at page 178 of the data sheet

What's the DS number and title of the page ?

> I am trying to use PORTB,2 to drive a power on/off pin of LM2941

There should be no problem doing that, B2 is a simple I/O

Is it set to output ?

Is the pin clear of shorts ?

Is it connecting to the board / socket ?

Maybe it's a munted pin - what about other PortB lines ?

2005\04\04@184752 by Philip Pemberton

face picon face
In message <spam_OUTBC0D70720D7AE14AAF23C576F9BB2E88BBCA73TakeThisOuTspamORNLEXCHANGE.ornl.gov>>          "Roberts II, Charles K." <.....robertsckKILLspamspam@spam@ornl.gov> wrote:

> I am trying to use PORTB,2 to drive a power on/off pin of LM2941. I
> can't get that pin to do it. But I can drive it with PORTC, 5 fine,
> without a pull up. The LM2941 only needs 300uA.
>
> Any ideas of what I am doing wrong.  

Can you post your code (or at least some of it) here? If not all of it, then
the initialisation block and the bit where you're setting/clearing PORTB.2
would be very helpful for debugging. You never know - maybe someone will spot
something you missed :)

Also do the normal checks for short circuits and try another PIC (preferably
a 16LF873A). The L basically means "low voltage rated" - they're chips that
Microchip has tested down to 2V. I've found that most of the non-L chips
won't run reliably below 3.8V.

Later.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpemspamKILLspamphilpem.me.uk              | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/          | 48xCD, ARCINv6c IDE, SCSI
... Mental Floss prevents Moral Decay.

2005\04\04@200808 by William Chops Westfield

face picon face

On Apr 4, 2005, at 2:29 PM, Roberts II, Charles K. wrote:

>>> From reading the data sheet and from my observations on my board it
>>> appears that the PORTB on the 16F873A PIC can only source about 200uA
>>> while operating at 3.3V, is this correct?
>
> It was a guestimate from looking at page 178 of the data sheet.
>
Is that the "weak pullup current" you're looking at?  That's how much
current it will source when it's an INPUT...

BillW

2005\04\04@222853 by Bob Ammerman

picon face
I believe the OP was reading the 'weak pullup current' value and confusing
it with drive capability.

Bob Ammerman
RAm Systems

{Original Message removed}

2005\04\05@083348 by Mike Hord

picon face
> Is that the "weak pullup current" you're looking at?  That's how much
> current it will source when it's an INPUT...

Hmmm...I'd always believed that was the amount the device current
increased when the PORTB pullups were turned on.  Experimentation
seemed to bear that out.  Anyone?

Mike H.

2005\04\05@084605 by Roberts II, Charles K.

picon face
>I believe the OP was reading the 'weak pullup current' value and
confusing
>it with drive capability.
>
>Bob Ammerman
>RAm Systems

That was what I did. But I still can't figure out why I can't drive
anything with my I/O pin. I checked for shorts to ground. I used a
jumper and could get my LM2941 to pon/off with PORTC,5


The data sheet is DS39582B. Part of what made me wonder is on page 44,
Figure 4-4. It appears as if the only thing driving the output is the
tri-state buffer. While if you look at the diagram on page 41 figure 4-1
and for the other I/O ports you can see that there are two FET's used to
drive the output.


Here is my port initialization code. I am using the Tony Kubeck
initialization code. I have not moved the positions of the code from
that sample.

; setup PORTB
       ; set in/out for portb pins
       MOVLW        TRISB        ; get address for portb control reg
       MOVWF        FSR        ; setup fsr
       MOVLW        b'00000001'        ;  RB0 input ( int ), reset are inputs

       MOVWF        INDF        ; and set iT
       ; setup PORTC
       ; note PORTC must be setup properly when using
SPI/UART/CCP/TIMER
       ; look in data sheet, some setups are 'unlogical' and/or
overridden
       ; as TX pin configured as input etc.
       ; set in/out for portc pins
       MOVLW        TRISC        ; get address for portc control reg
       MOVWF        FSR        ; setup fsr
       MOVLW        b'11011000';input is Rx line I2C ports are set to in
also RC5  
       MOVWF        INDF        ; and set it
       ;setup OPTION reg
       MOVLW        OPTION_REG; get adress for option reg
       MOVWF        FSR        ; setup fsr
       MOVLW        0x8F        ; no portb pull ups, int edge falling,TMR0
source internal
                       ; TMR0 source edge inc on low->high, prescaler
to WDT, WDT rate 1:128
       MOVWF        INDF        ; and set it
       RETURN

I have tried both values for RBPU, which shouldn't matter. I have been
changing the port levels using BSF PORTB,2 and BCF PORTB,2. And these
are being set in BANK0.

Maybe that will have some information that will be obvious to one of the
list members.


Charles Roberts II


2005\04\05@112536 by William Chops Westfield

face picon face
On Apr 5, 2005, at 5:33 AM, Mike Hord wrote:

>> Is that the "weak pullup current" you're looking at?  That's how much
>> current it will source when it's an INPUT...
>
> Hmmm...I'd always believed that was the amount the device current
> increased when the PORTB pullups were turned on.  Experimentation
> seemed to bear that out.  Anyone?
>

Doesn't it end up being the same thing, pretty much?  If the input
is low, the pullup current all gets dissipated in the device.  If
the input isn't connected to anything, then theoretically the pin
can source that much current...

BillW

2005\04\05@151216 by Danny Decell

picon face
Hey Robert,

I didn't have time to take a close look but did you setup ADCON1 Register to
make AN4/RA5 a Digital I/O pin rather than a Analog Input (which it what it
defaults to on the 16F87x)?

- Dan


{Original Message removed}

2005\04\05@164412 by Mike Hord
picon face
> >> Is that the "weak pullup current" you're looking at?  That's how much
> >> current it will source when it's an INPUT...
> >
> > Hmmm...I'd always believed that was the amount the device current
> > increased when the PORTB pullups were turned on.  Experimentation
> > seemed to bear that out.  Anyone?
> >
>
> Doesn't it end up being the same thing, pretty much?  If the input
> is low, the pullup current all gets dissipated in the device.  If
> the input isn't connected to anything, then theoretically the pin
> can source that much current...

Not as I understood it.  As I understand it, the act of flipping the
NOT_RBPU bit is to activate a circuit which connects a weak resistor
between each pin of PORTB and the positive supply rail.  At that point,
the current the device is drawing goes up by ~200 uA.  It doesn't really
make sense to talk about an input "sourcing" current; it will tend to
allow itself to be held at any voltage you want to apply to it, eliminating
the potential difference which is necessary to drive a current.  Some
current will flow, but only very little, and that amount is defined by the
leakage current specs.

I could be entirely wrong, here, but I don't think I am.

Mike H.

2005\04\05@172959 by Jan-Erik Soderholm

face picon face
Mike Hord wrote :

> > Doesn't it end up being the same thing, pretty much?  If the input
> > is low, the pullup current all gets dissipated in the device.  If
> > the input isn't connected to anything, then theoretically the pin
> > can source that much current...
>
> Not as I understood it.  As I understand it, the act of flipping the
> NOT_RBPU bit is to activate a circuit which connects a weak resistor
> between each pin of PORTB and the positive supply rail.  At
> that point, the current the device is drawing goes up by ~200 uA.

And where should the current go if the pin is unconnected (or held
high) ?

I've always read that figure as "if the (input-) pin is held low".

There might be some internal things that might make the PIC
to draw some extra current, but besides of that, I see the wpu
just as an external pull-up. That pull-up resistor will only draw
current if the pin is actively held low.

Jan-Erik.



2005\04\05@195022 by Mike Hord

picon face
On Apr 5, 2005 4:29 PM, Jan-Erik Soderholm <.....jan-erik.soderholmKILLspamspam.....telia.com> wrote:
> Mike Hord wrote :
>
> > > Doesn't it end up being the same thing, pretty much?  If the input
> > > is low, the pullup current all gets dissipated in the device.  If
> > > the input isn't connected to anything, then theoretically the pin
> > > can source that much current...
> >
> > Not as I understood it.  As I understand it, the act of flipping the
> > NOT_RBPU bit is to activate a circuit which connects a weak resistor
> > between each pin of PORTB and the positive supply rail.  At
> > that point, the current the device is drawing goes up by ~200 uA.
>
> And where should the current go if the pin is unconnected (or held
> high) ?

The same place current goes if you tie any other pin high through
an external pullup- through the logic.  There just isn't any current
through the external pin.

> I've always read that figure as "if the (input-) pin is held low".
>
> There might be some internal things that might make the PIC
> to draw some extra current, but besides of that, I see the wpu
> just as an external pull-up. That pull-up resistor will only draw
> current if the pin is actively held low.

Seems like a hot issue.  I have a board that I'm working on
right now that has very low quiescent current; about 50 uA.
I'll try it with and without PORTB pullups and see what I get-
I think nothing else is attached to those pins.  The PIC is an
18F2320, which is a nanoWatt, but it should be pretty similar.

Mike H.

2005\04\05@200351 by Jan-Erik Soderholm

face picon face
Mike Hord wrote :

> > > Not as I understood it.  As I understand it, the act of
> > > flipping the
> > > NOT_RBPU bit is to activate a circuit which connects a
> > > weak resistor
> > > between each pin of PORTB and the positive supply rail.  At
> > > that point, the current the device is drawing goes up by ~200 uA.
> >
> > And where should the current go if the pin is unconnected (or held
> > high) ?
>
> The same place current goes if you tie any other pin high through
> an external pullup- through the logic.

Yes, **IF** that pin is an OUTPUT so it can source
or sink any current !

But, for the weak pull-up to be enabled *at all*,
the PIC pin must be an input, so there is noware for
the current to go, is there ?

> There just isn't any current through the external pin.

And noware else either, AFAIK.

Jan-Erik.



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