A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
In a battery drain-sensitive circuit, what would be the best way to set up bit switches tied to PIC pins? Would you use the PIC internal weak pull ups and then switches closed are tied to ground? Or use external resistors (what value?) to tie the PIC pins low, and when the switches are closed they are tied high?
Would you keep the PIC pins set to output except when reading the dip switch?
How much drain is really happening in such case? Battery rating is 190 mah and LEDs are driven so power usage is critical…
Ransom Peek |
|
|
|
Without any thought at all, I would use the weak pull-ups with normally open switches closing to ground. I would not define the port pins as output because the output state could conflict with the switch positions and the smoke could leak out of the PIC. Microchip has MANY recommendations on reducing power consumption but it will take a lot of digging. Things like power down, sleep mode, etc. Seems if you are driving 20mA LEDs, the switches are the least of your issues. --- In , "ransom peek" <ransom.peek@c...> wrote: > In a battery drain-sensitive circuit, what would be the best way to set > up bit switches tied to PIC pins? Would you use the PIC internal weak > pull ups and then switches closed are tied to ground? Or use external > resistors (what value?) to tie the PIC pins low, and when the switches > are closed they are tied high? > > Would you keep the PIC pins set to output except when reading the dip > switch? > > How much drain is really happening in such case? Battery rating is 190 > mah and LEDs are driven so power usage is critical. > Ransom Peek |
|
Use the weak pull ups, although I've never really trusted them and have used 10K resistors myself. When the I/O pins are set to inputs the current drain is microamps. Don't leave switches defaulted as pulled low, this is not needed and will waste power. Get low power LEDs, SMT ones are very bright on low current, but even ordinary units don't need more than a 1K resistor (about 3ma current, not 20ma) to get very good luminosity. Put the PIC to sleep and either use a watchdog to wake it up periodically or use wake up on pin change on defined I/O lines. If nothing is happening, the PIC doesn't need to be running. have fun, DLC ransom peek wrote: > In a battery drain-sensitive circuit, what would be the best way to set > up bit switches tied to PIC pins? Would you use the PIC internal weak > pull ups and then switches closed are tied to ground? Or use external > resistors (what value?) to tie the PIC pins low, and when the switches > are closed they are tied high? > > Would you keep the PIC pins set to output except when reading the dip > switch? > > How much drain is really happening in such case? Battery rating is 190 > mah and LEDs are driven so power usage is critical? > Ransom Peek > Yahoo! Groups Sponsor > ADVERTISEMENT > click here > <http://rd.yahoo.com/SIG=12cmjie8q/M=267637.4116730.5333196.1261774/D=egroupweb/S=1706554205:HM/EXP=1069869026/A=1853619/R=0/*http://www.netflix.com/Default?mqso=60178356&partid=4116730 > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > >. -- --------------------------------------------------------------------- * Dennis Clark http://www.techtoystoday.com * * "Programming and Customizing the OOPic Microcontroller" Mcgraw-Hill * --------------------------------------------------------------------- |
|
|
|
Good ideas, thanks! But the bit switches will often stay tied to ground/low, using the weak internal pull ups, so does this mean drain is high?
Ransom
-----Original Message-----
Use the weak pull ups,
although I've never really
trusted them and have Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. |
|
|
|
Check your PIC specs for the current draw using weak pullups. It will be higher than if you didn't leave the pins grounded. I would find a way that defaults will minimize this. Also, can you not post using HTML? It does icky things to some (mine) email systems... have fun, DLC ransom peek wrote: > Good ideas, thanks! But the bit switches will often stay tied to > ground/low, using the weak internal pull ups, so does this mean drain is > high? > > Ransom > > -----Original Message----- > From: Dennis Clark [mailto:] > Sent: Tuesday, November 25, 2003 2:38 PM > To: > Subject: Re: [piclist] How can power consumption be minimized when using > bit switches? > > Use the weak pull ups, although I've never really trusted them and have > used 10K resistors myself. When the I/O pins are set to inputs the > current drain is microamps. Don't leave switches defaulted as pulled > low, this is not needed and will waste power. Get low power LEDs, SMT > ones are very bright on low current, but even ordinary units don't need > more than a 1K resistor (about 3ma current, not 20ma) to get very good > luminosity. Put the PIC to sleep and either use a watchdog to wake it > up periodically or use wake up on pin change on defined I/O lines. If > nothing is happening, the PIC doesn't need to be running. > > have fun, > DLC > > ransom peek wrote: >> In a battery drain-sensitive circuit, what would be the best way to set >> up bit switches tied to PIC pins? Would you use the PIC internal weak >> pull ups and then switches closed are tied to ground? Or use external >> resistors (what value?) to tie the PIC pins low, and when the switches >> are closed they are tied high? >> >> >> >> Would you keep the PIC pins set to output except when reading the dip >> switch? >> >> >> >> How much drain is really happening in such case? Battery rating is 190 >> mah and LEDs are driven so power usage is critical? >> >> >> >> >> >> Ransom Peek >> >> >> Yahoo! Groups Sponsor >> ADVERTISEMENT >> click here >> > <http://rd.yahoo.com/SIG=12cmjie8q/M=267637.4116730.5333196.1261774/D=egroupweb/S=1706554205:HM/EXP=1069869026/A=1853619/R=0/*http://www.netflix.com/Default?mqso=60178356&partid=4116730 > <http://rd.yahoo.com/SIG=12cmjie8q/M=267637.4116730.5333196.1261774/D=egroupweb/S=1706554205:HM/EXP=1069869026/A=1853619/R=0/*http:/www.netflix.com/Default?mqso=60178356&partid=4116730>> >> >> >> to unsubscribe, go to http://www.yahoogroups.com and follow the >> instructions >> >> >. > -- > --------------------------------------------------------------------- > * Dennis Clark http://www.techtoystoday.com * > * "Programming and Customizing the OOPic Microcontroller" Mcgraw-Hill * > --------------------------------------------------------------------- > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > >. > > Yahoo! Groups Sponsor > ADVERTISEMENT > click here > <http://rd.yahoo.com/SIG=12c2p9hl7/M=267637.4116732.5333197.1261774/D=egroupweb/S=1706554205:HM/EXP=1069885361/A=1853618/R=0/*http://www.netflix.com/Default?mqso=60178338&partid=4116732 > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > >. -- --------------------------------------------------------------------- * Dennis Clark http://www.techtoystoday.com * * "Programming and Customizing the OOPic Microcontroller" Mcgraw-Hill * --------------------------------------------------------------------- |
|
|
|
Yes, grounding the internal portB pullups with your switches will cause a continuous current drain. To get minimum power consumption use a PIC pin to drive an NPN transistor or N-channel FET connected to the common ground of your switch(es). When the ground pin is "off", you'll get a Hi-Z connection and the internal PIC portB pullups will draw almost no current. Only turn on the switch ground right before you need to read the switch inputs (don't forget to turn off the output when you're done reading the switches!). You could also use a PIC pin directly to provide ground on the switches, taking it low to read the switches and high to get a low current mode. I've used this technique many times with battery powered devices and it works great. Matt Pobursky Maximum Performance Systems On Tue, 25 Nov 2003 14:59:37 -0700, ransom peek wrote: Good ideas, thanks! But the bit switches will often stay tied to ground/low, using the weak internal pull ups, so does this mean drain is high? |
|
Use a single pole, double throw push button. No pullups. Off goes to ground, On connects to Vcc or visa versa. Use a shmitt trigger input if possible. Chad --- Dennis Clark <> wrote: > Use the weak pull ups, although I've never really trusted them and > have > used 10K resistors myself. When the I/O pins are set to inputs the > current drain is microamps. Don't leave switches defaulted as pulled > low, this is not needed and will waste power. Get low power LEDs, > SMT > ones are very bright on low current, but even ordinary units don't > need > more than a 1K resistor (about 3ma current, not 20ma) to get very > good > luminosity. Put the PIC to sleep and either use a watchdog to wake > it > up periodically or use wake up on pin change on defined I/O lines. > If > nothing is happening, the PIC doesn't need to be running. > > have fun, > DLC > > ransom peek wrote: > > In a battery drain-sensitive circuit, what would be the best way to > set > > up bit switches tied to PIC pins? Would you use the PIC internal > weak > > pull ups and then switches closed are tied to ground? Or use > external > > resistors (what value?) to tie the PIC pins low, and when the > switches > > are closed they are tied high? > > > > > > > > Would you keep the PIC pins set to output except when reading the > dip > > switch? > > > > > > > > How much drain is really happening in such case? Battery rating is > 190 > > mah and LEDs are driven so power usage is critical? > > > > > > > > > > > > Ransom Peek > > > > > > Yahoo! Groups Sponsor > > ADVERTISEMENT > > click here > > > <http://rd.yahoo.com/SIG=12cmjie8q/M=267637.4116730.5333196.1261774/D=egroupweb/S=1706554205:HM/EXP=1069869026/A=1853619/R=0/*http://www.netflix.com/Default?mqso=60178356&partid=4116730> > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > instructions > > > > >. > -- > --------------------------------------------------------------------- > * Dennis Clark http://www.techtoystoday.com > * > * "Programming and Customizing the OOPic Microcontroller" Mcgraw-Hill > * > --------------------------------------------------------------------- __________________________________ |
|
|
|
I¡Çve noticed that Microchip also uses a single pole double throw pushbutton on their Quickstart development board when a single pole single throw is what is theoretically needed. Is it that the extra throw will give redundancy that reduces the bounce time?
In my case bit switches best fit the application, not pushbuttons. But according to the PIC ¡ÈPower Managed Tips ¡Æn Tricks¡É : ¡È A digital input consumes the least amount of power when the input voltage is near Vdd or Vss¡É, so wouldn¡Çt a pin tied to ground when bit switch is closed cause minimal drain. If the internal weak pull ups is 10K ohm, and the circuit runs on 3 volts, the drain would be 3/10,000 = .0003 amps. A 190 mah 2032 button cell would last .190/.0003 = 633 hours per switch closed, or 633/4 = 158 hours if all four are closed.
So that logic to consider¡ÄIs this thinking correct?
Ransom
-----Original Message-----
Use a single pole,
double throw push button. No
pullups. Off goes to Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. |
|
Is it correct that when the PIC sleeps, there is no power consumption caused by these closed bit switches? The 158 hour battery life applies only to time the PIC is awake, right?
Ransom
-----Original Message-----
I¡Çve noticed that Microchip also uses a single pole double throw pushbutton on their Quickstart development board when a single pole single throw is what is theoretically needed. Is it that the extra throw will give redundancy that reduces the bounce time?
In my case bit switches best fit the application, not pushbuttons. But according to the PIC ¡ÈPower Managed Tips ¡Æn Tricks¡É : ¡È A digital input consumes the least amount of power when the input voltage is near Vdd or Vss¡É, so wouldn¡Çt a pin tied to ground when bit switch is closed cause minimal drain. If the internal weak pull ups is 10K ohm, and the circuit runs on 3 volts, the drain would be 3/10,000 = .0003 amps. A 190 mah 2032 button cell would last .190/.0003 = 633 hours per switch closed, or 633/4 = 158 hours if all four are closed.
So that logic to consider¡ÄIs this thinking correct?
Ransom
-----Original Message-----
Use a
single pole, double throw push button. No pullups. Off goes
to
| |
|
|
|
> How can power consumption be minimized > when using bit switches? If you have a spare PIC pin: use (internal) pull-ups as always, but feed the common of the switches to a PIC pin. Make this pin low to read the switches, high to minimize power consumption. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
> > How can power consumption be minimized > > when using bit switches? > > If you have a spare PIC pin: use (internal) pull-ups as > always, but feed > the common of the switches to a PIC pin. Make this pin low to read the > switches, high to minimize power consumption. Or even better, without the extra pin: switch pins are inputs with internal pull-ups when reading the swtches, outputs and low (not high!) to minimize power consumption. (be careful: make the pins low first, then output) Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
> When the I/O pins are set to inputs the > current drain is microamps. Don't leave switches defaulted as pulled > low, this is not needed and will waste power. Get low power LEDs, SMT > ones are very bright on low current, but even ordinary units don't need > more than a 1K resistor (about 3ma current, not 20ma) to get very good > luminosity. Put the PIC to sleep and either use a watchdog to wake it > up periodically or use wake up on pin change on defined I/O lines. If > nothing is happening, the PIC doesn't need to be running. > > have fun, > DLC Begs the question of the lowest power way to drive an LED. If running an LED at 3mA offers low power consumption, an occasional pulse will blink and LED, saving a lot of power. 1/3 duty cycle at some frequency will appear continuous to the human eye. so that would save even more. Running diffused LED's at low current offers a enough light to see panel indicators. Clear ones seem too focused so you must be directly in front to see them. Dave |