• AVR Freaks

AnsweredHot!best options to reduce power consumption on a pin with undetermined connection

Author
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
2020/07/22 08:39:13 (permalink)
0

best options to reduce power consumption on a pin with undetermined connection

In my device, some of pins are floating but user can connect them to anything. Sometimes (based on situations) I have to reduce power consumption as much as possible to keep device stable and running.
I know tri-state (digital input) consumes a lot of power. If I set pin to digital output, it can also consume much current; for example, if user connect pin to Anode of an LED, the LED will consume power if I set pin as digital high output.
I think analog input is best option for those pins based on this article. Am I right?

Slow and Steady!
#1
NKurzman
A Guy on the Net
  • Total Posts : 18859
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 11:53:41 (permalink) ☼ Best Answerby pajuhesh80 2020/07/22 13:06:13
0
Unterminated pins should be pulled up, or down.
Yes analog input would be better than  Unterminated digital.
#2
NorthGuy
Super Member
  • Total Posts : 6228
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: online
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 12:16:54 (permalink)
+1 (1)
Many PICs have an option of activating internal pull-ups on the pins.
 
Declaring pins analog disconnects the digital input from the pin. However, if you want to detect digital signals on these pins,  you probably want to keep digital inputs connected.
 
Also, you can make these pins outputs and drive them low. Although this is probably not a good option if someone is going to connect things to these pins.
#3
RISC
Super Member
  • Total Posts : 5776
  • Reward points : 0
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 12:30:44 (permalink)
0
Hi,
Any unused I/O pin configured as an input must be either pulled up or down or programmed as output and set to high or low level (low impedance).
If one digital input pin is not connected, expect all kind of issues...this is a rule for all digital inputs.
I like to describe it as a 2m antenna feeding all disturbances around into the device...
Regards
 

For support make sure to check first here : http://microchipdeveloper.com
There are hundreds of PIC, AVR, SAM...which one do YOU use ?
#4
PStechPaul
Super Member
  • Total Posts : 2814
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 12:34:42 (permalink)
0
I/O ports (inputs) typically (from the PIC16F18324) have only about 5 to 50 nA leakage current. The internal weak pull-up has a current of 120-200 uA, but only when the pin is externally driven to Vss. The ADC draws about 1-5 uA when active.

 
#5
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:06:00 (permalink)
0
As I said I don't know what is going to be connected to those pins (not unused, just undetermined). So pull up and down and digital output options aren't good because they can cause even more current than tri-state in some situations (example in post 1). Also, program will change pin to needed state when power saving phase ends.
So I'll use analog input. Thanks everyone.

Slow and Steady!
#6
crosland
Super Member
  • Total Posts : 2017
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:26:41 (permalink)
+1 (3)
pajuhesh80
As I said I don't know what is going to be connected to those pins (not unused, just undetermined). 



That's nonsense.
 
If there's nothing in the firmware to control those pins, how can users connect anything meaningful?
 
If users can modify the firmware (e.g. with a bootloader) then they need to set the I/O appropriately.
#7
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:29:19 (permalink)
+1 (1)
... and if you care about ESD, PIC pins should NEVER be directly connected to off-board sources.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#8
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:29:19 (permalink)
+1 (1)
... and if you care about ESD, PIC pins should NEVER be directly connected to off-board sources.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#9
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:42:09 (permalink)
0
crosland
If there's nothing in the firmware to control those pins, ...
 

There is. User can control those pins. However, when device needs to switch to lowest consumption state, I change pins to analog input to prevent any possible current consumption by digital input and external devices.
 
ric
... and if you care about ESD, PIC pins should NEVER be directly connected to off-board sources.
 

I'm not worried about ESD. My device is somewhat like an Arduino.
 

Slow and Steady!
#10
crosland
Super Member
  • Total Posts : 2017
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: best options to reduce power consumption on a pin with undetermined connection 2020/07/22 13:52:16 (permalink)
0 (2)
pajuhesh80
crosland
If there's nothing in the firmware to control those pins, ...
 

There is. User can control those pins. However, when device needs to switch to lowest consumption state, I change pins to analog input to prevent any possible current consumption by digital input and external devices.

The state you choose during low power should be determined by what is connected, i.e., the configuration chosen by the user.
 

ric
... and if you care about ESD, PIC pins should NEVER be directly connected to off-board sources.
 

I'm not worried about ESD. My device is somewhat like an Arduino.

And your point is...?
#11
Jump to:
© 2020 APG vNext Commercial Version 4.5