View previous topic :: View next topic |
Author |
Message |
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
PORT B Pull up current, 250uA! |
Posted: Sat Oct 23, 2004 9:34 am |
|
|
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
|
|
Posted: Sat Oct 23, 2004 10:39 am |
|
|
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
|
|
Posted: Sat Oct 23, 2004 11:31 am |
|
|
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
|
|
Posted: Mon Oct 25, 2004 3:24 am |
|
|
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
|
|
Posted: Mon Oct 25, 2004 4:49 am |
|
|
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
|
|
Posted: Mon Oct 25, 2004 11:31 am |
|
|
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
|
|
Posted: Tue Oct 26, 2004 2:44 am |
|
|
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 |
|
|
|