> 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.
> > 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
>> 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.
> 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.
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...
> 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?
>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.
>> 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...
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)?
> >> 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.
> > 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.
On Apr 5, 2005 4:29 PM, Jan-Erik Soderholm <.....jan-erik.soderholmKILLspam.....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.
> > > 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.