What happens if an input has neither a pull-up nor a pull-down resistor?

Thread Starter

ThreeNamesGrace

Joined Jan 24, 2023
7
I was reading through this datasheet, and I found that the pin A2 (EXPST_B) doesn't have either a pull-up nor a pull-down resistor, so, what do we do in such cases? Is the voltage just processed without any problem or are we requiered to put a resistor in consequence?
 

crutschow

Joined Mar 14, 2008
34,468
Is the voltage just processed without any problem or are we requiered to put a resistor in consequence?
Below is the pin in question:

What do you mean "is the voltage just processed"?
If you are talking about an input 1 or 0 signal to the pin. of course it's processed, and no resistor is required.
A pull-up/pull-down resistor is used when a pin may not need to be used, so the resistor establishes a default value with no other input.

1681009139377.png
 

MrChips

Joined Oct 2, 2009
30,824
I was reading through this datasheet, and I found that the pin A2 (EXPST_B) doesn't have either a pull-up nor a pull-down resistor, so, what do we do in such cases? Is the voltage just processed without any problem or are we requiered to put a resistor in consequence?
A logic input requires a valid logic signal. This can be supplied from an active source, i.e. the output from a logic gate.

A logic signal can be supplied from a passive source such as a pull-up or pull-down resistor.
 

WBahn

Joined Mar 31, 2012
30,077
I was reading through this datasheet, and I found that the pin A2 (EXPST_B) doesn't have either a pull-up nor a pull-down resistor, so, what do we do in such cases? Is the voltage just processed without any problem or are we requiered to put a resistor in consequence?
If a digital input is going to be actively driven at all times, then no pull-up or pull-down resistor is needed. But if there are going to be times when the input is not being actively driven, then it needs some kind of pull-up or pull-down circuit to ensure that the input always has a voltage on it that translates to valid digital state. Sometimes this is provided with internal circuits, at least for some pins that would commonly be left unconnected. The data sheet is letting you know that that is not the case with this chip, so if you are not going to be actively driving that pin (as well as lots of others), it is your responsibility to provided adequate pull-up or pull-down conditions for them.
 

Ian0

Joined Aug 7, 2020
9,846
I was reading through this datasheet, and I found that the pin A2 (EXPST_B) doesn't have either a pull-up nor a pull-down resistor, so, what do we do in such cases? Is the voltage just processed without any problem or are we requiered to put a resistor in consequence?
"Note: there is no internal pull-up/pull-down resistor" means that you need to supply one.
In it absence, the input will float at about half supply voltage, where it may be seen as logic 1 and may equally be seen as logic 0. It will be capacitively coupled to adjacent pins, so a rising edge on the next pin along will send it into reset, generally causing havoc with the operation of the circuit.
In practice, it will depend on where the dirt is on the circuit board. If there is more dirt between the reset pin and the 0V supply, it will tend to be read as zero; meaning that it works until you clean the circuit board.
If it remains floating, it will turn both positive and negative input transistors on, making the IC draw more current than it should ruining your battery life.
Leaving it floating is a bad idea all round.
 

drjohsmith

Joined Dec 13, 2021
852
An unused input needs to be set to a defined level.

a) if you don't, how do you know if the pin is at 1 or 0, and so what is the logic doing.
b) It can randomly change, changing the logic operation
c) as stated by others, it can cause power to be drawn,
d) If its a high impedance logic, say CMOS, then its a ESD injection point, leading to premature board failure

All logic inputs need to be tied off,
 

Thread Starter

ThreeNamesGrace

Joined Jan 24, 2023
7
Thank you everybody for your answers. What I can conclude from this, is that, I need to supply my own pull-up or pull-down resistor to the camera IC.

But I have another question, when I set the pins of an Arduino as inputs, do they use pull-down resistors? Because there is an option to make them use pull-up resistors (don't worry, I won't use an Arduino with the camera, but I want to get out of my ignorance.)
 

djsfantasi

Joined Apr 11, 2010
9,163
But I have another question, when I set the pins of an Arduino as inputs, do they use pull-down resistors? Because there is an option to make them use pull-up resistors
No, they don’t have a pull-down resistor as a default. If you just set it as an INPUT, you need to use a pull-down resistor if the input isn’t an active source. There are ways in software to act as if zero is the default. But it’s not intuitive. Use a pull-down resistor. You could also reverse the logic of the input source and use INPUT_PULLUP.
 

Thread Starter

ThreeNamesGrace

Joined Jan 24, 2023
7
No, they don’t have a pull-down resistor as a default. If you just set it as an INPUT, you need to use a pull-down resistor. There are ways in software to act as if zero is the default. But it’s not intuitive. Use a pull-down resistor. You could also reverse the logic of the input source and use INPUT_PULLUP.
Oh, that's why the pull-up resistor is used, to use negative logic. Thank you for your repply.
 

Jon Chandler

Joined Jun 12, 2008
1,055
From the camera data sheet, this part of the table is important. It shows the highest voltage that is considered a LOW signal, and the lowest voltage that is considered a HIGH signal. Between these levels is a forbidden zone; when a signal is within this region, unpredictable behavior and even locking up of the chip can result.

On a PIC18F circuit I used a bussed 5-resistor network to pull up 2 switches, 2 jumpers and /MCLR. My assembler ignored the marks on the circuit board and installed the networks backwards. Instead of the common pin being connected to +5v, it was connected to /MCLR, forming sort of a voltage divider. I tested every combination of the two switches, which worked as expected, then installed one of the jumpers for an option.

My client called shortly after he received the product, and informed me that when the two buttons were pressed simultaneously, the micro locked up completely. The only way to get it working was to disconnect power; pressing the reset switch did nothing.

I couldn't believe this but when I tried it on another unit, the exact same thing happened. This was a new batch of boards, but 20 or 30 of the units built on the same boards with the same firmware had been working flawlessly for months.

After much head scratching, I noticed the resistor networks were installed backwards. With an option jumper in place and two switches were pressed, /MCLR ended up right in the middle of the forbidden zone, which made the micro very unhappy!

SmartSelect_20230409_151955_Edge.jpg
 

WBahn

Joined Mar 31, 2012
30,077
Thank you everybody for your answers. What I can conclude from this, is that, I need to supply my own pull-up or pull-down resistor to the camera IC.

But I have another question, when I set the pins of an Arduino as inputs, do they use pull-down resistors? Because there is an option to make them use pull-up resistors (don't worry, I won't use an Arduino with the camera, but I want to get out of my ignorance.)
I don't know about the Arduino, specifically, but in general you need to look at the data sheet for the part or system you are using. It should tell you how things behave and what the options are. On many parts, the behavior is configurable and you can set it to have a weak pull-up, a week pull-down, or nothing at all. On some parts there is a default, which could be any one of those and might vary from pin to pin. You might also only have some of those options, such as a nothing or a weak-pullup. On some chips you can control the options on a pin-by-pin or port-by-port basis. On others it's a global option that affects all (or some) inputs the same. Other chips have no configurability options at all.

You need to learn how to delve into the specifications for the parts you are using to ferret out this information.
 

MrChips

Joined Oct 2, 2009
30,824
On STM32 MCUs the general purpose input/output pin (GPIO) can be configured with internal pull-down, pull-up, or none.
 

drjohsmith

Joined Dec 13, 2021
852
Arduino
To clarify.
Arduino DOES have optional pull up or down on its inputs. .
PinMode( 2, INPUT_PULLUP);
where 2 is whatever digital io pin your using.
 

djsfantasi

Joined Apr 11, 2010
9,163
Arduino
To clarify.
Arduino DOES have optional pull up or down on its inputs. .
PinMode( 2, INPUT_PULLUP);
where 2 is whatever digital io pin your using.
To further clarify, the Atmega328 -based Arduinos only have pullup resistors; there is no internal pull down resistor available. Look at page 72 of the ATMega datasheet.
 
Top