Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

The side-effects of using Weak PULL-UPS?

Status
Not open for further replies.

MrNobody

New Member
Hi, I was just thinking about using weak pull-ups in sleep mode to minimize current consumption in PIC12F615.

Lets say in normal operation, I use GP0/AN0 to read ADC and the ADC voltage is around 3V.. When I want to go into sleep mode, according to the datasheet, I can enable weak pull-up to prevent the pin from floating which will minimize current consumption. When I do that, the voltage at that input pin is 5V and if my understanding is correct, it has just turned an input into an 'output' because current is flowing into the 'thing' that i was trying to measure which is 3V (lower voltage). Of course I can add a diode to only allow the current to flow in one direction but that would increase the cost.

Is my understanding of weak pull-ups correct..? Is there a better way to minimize current consumption during sleep mode without imposing a voltage level onto the device which we are trying to measure and also without using external components..?

I don't know, i was just thinking about weak pull-ups and sleep mode.. Just trying to understand and learn more i guess.. Hmm..
 
Floating inputs are a no-no for a sleeping microcontroller. All datasheets list switching to output for low power operation. It's a trait of the CMOS logic gates that they will eat up current if left to float.

I'm not up to speed on the exact theory, but googling 'CMOS floating input' gives a bunch of leads.
 
Last edited:
The reason floating inputs for sleep is bad is because even in sleep mode the internal schmit trigger is still active, so if there's enough capacitive coupling to another part of the circuit that isn't sleeping or to an external noise source the pin will oscillate which drains power because cmos drains power only when it switches states, for lowest power usage the weak pullups/downs are probably fine.
 
Last edited:
There seems to be some confusion here regarding digital inputs above; allowing a digital input to float or setting its voltage towards half-supply may increase the supply consumption.

Analogue inputs are allowed to be at whatever voltage they want within the supply range. When an analogue input is enabled, the digital input circuitry is disabled, as is the pullup for that pin (see datasheet ANSEL notes).

As the OP stated, if the pullup is enabled, current will flow out the pin to the voltage source that was being measured.

So it would seem that leaving the pin configured as an analogue input during sleep is the way to go.
 
Analogue inputs are allowed to be at whatever voltage they want within the supply range. When an analogue input is enabled, the digital input circuitry is disabled, as is the pullup for that pin (see datasheet ANSEL notes).

Oh.. yeah.. i missed that part about setting input as analog will disable pull-ups..

It did say on the ANSEL section of the datasheet..

Code:
Note 1: Setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and
interrupt-on-change if available.

So, if the input pin is kept as analogue input, is it considered as HIGH IMPEDANCE input..? Is it considered floating..? Because in the SLEEP mode section of the datasheet, it states that

Code:
I/O pins that are highimpedance
inputs should be pulled high or low externally
to avoid switching currents caused by floating inputs.
 
I can only assume that they are referring to digital inputs. The analogue inputs are designed to have an analogue (e.g. floating) voltage present when operating, so I can only assume that it's the same during sleep.
 
My thinking has been all over the map on this. Does this logic hold ?

All but one ADC, the selected channel, is disconnected from the cap. Are the input gates of the unselected inputs freely floating! Even when you have a stable voltage on the pin.

If so I understand the following why
Analog inputs should never float.

It seems to me that the best bet is to make the inputs digital and use the weakest pullups that will keep the lines stable.

3v0
 
My thinking has been all over the map on this.
Watching your posts in this thread is like watching a [good] tennis match.

All but one ADC, the selected channel, is disconnected from the cap.
No channel is connected to the cap except for during the acquisition period preceding the conversion cycle.

It seems to me that the best bet is to make the inputs digital and use the weakest pullups that will keep the lines stable.
A digital input held at a voltage that is neither high nor low can cause shoot-through current in the digital input transistors. Enabling the weak pullup, as the OP pointed out, provides a leakage path for current from VCC to the ~3V input voltage.

Disabling the digital input circuitry stops the problem with the 'floating' input voltage (because the problem - i.e. the digital input - has been removed).
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top