CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PORT B Pull up current, 250uA!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PORT B Pull up current, 250uA!
PostPosted: Sat Oct 23, 2004 9:34 am     Reply with quote

250uA for PORT B pull-ups on a PIC16F! I need to be as stingy as possible with current and that’s just too much. I use port B for button interface (the change interrupts). I was wondering what the general maximum pull up resistor is, I am thinking 200k? Why does the internal pull-ups use so much current?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Oct 23, 2004 10:39 am     Reply with quote

From ohm's law:

1/(250uA / 8 inputs) * 5V = 160K per output.

At 200K, 8 inputs would consume 200uA
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Sat Oct 23, 2004 11:31 am     Reply with quote

I did think of that myself but then I though OK if I use a 1ohm resistor tying an input to 5V. This doesn’t consume 5 Amps! Inputs are high impedance so do you basically get this impedance and the pull up resistor forming a potential divider?

Or does the datasheet refer to the current consumed when you pull the input to GND while port b pull ups are on? If so it makes sense. So the quiescent current consumption in using port b pull up’s without grounding them would be approx zero?

Will
mcafzap



Joined: 07 Sep 2003
Posts: 46
Location: Manchester, UK

View user's profile Send private message

PostPosted: Mon Oct 25, 2004 3:24 am     Reply with quote

Will,

I have used 10M pull-ups @ 3.3v, but I was concerned about excessive 'sensitivity'. This might have been solved by cleaning, but in the end I settled on 3M3 and had no trouble on a production run of 200.

As for current consumption, this is almost certainly the worst-case position when the switches are on.

Steve
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Mon Oct 25, 2004 4:49 am     Reply with quote

Thanks for your replies,
I’ve moved to the 18F part for more program space and the datasheet for that states min 50uA and max 450uA! I guess the min is the electrical overhead of switching on the logic which pulls the port high, as I need them high to detect and wake up the device this is 50uA saved!

The whole question came up because I wanted to reduce current and the fact I was switching off a peripheral IC and it was still getting power from somewhere! Turned out it was B0 and weak pull ups supplying it with some juice (It was the USBN9603 chip BTW!). It’s amazing how you forget things like that from time to time! Anyway I fixed it in software by changing B0 to output and pulling low but thought for the new version hardware pull ups on the buttons and disabling weak pull-ups would save a bit of power as well as be a little safer!

Keep well all,

Will
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Oct 25, 2004 11:31 am     Reply with quote

If your switches are normally open then the pullup current won't flow until the switch is closed.

One can also capacitor couple a switch, but that is its own can of worms.
_________________
The search for better is endless. Instead simply find very good and get the job done.
mcafzap



Joined: 07 Sep 2003
Posts: 46
Location: Manchester, UK

View user's profile Send private message

PostPosted: Tue Oct 26, 2004 2:44 am     Reply with quote

Capacitor coupling sounds very interesting, Doug. Can it be made to work without too much trouble?
I've tried all sorts of things like only enabling the pull-ups when I need them and then having to change the switch inputs to outputs to stop the floating digital input problem, which brings in its own problems of potential short-circuits.
Alternatively, with enough spare pins, you can feed the switch from an output. Set this high and check the input, then set low and check the input. If the switch is open there should be no change in the floating input in this brief interval, otherwise the input follows the driver output state. The input in this circuit can then be safely set to an output - making sure you match its state to that of the driver. But this is awfully messy.

Steve
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group