Question

In atmega128, what is the difference between assigning internal pull-ups and not assigning pull-up when port is used as input ? I don't see the point of assigning pull-up when using port as input..

Était-ce utile?

La solution

Sometimes your input won't have an output connected to it. By enabling the internal pull up, you guarantee the input will be read as high in that condition. Without the pull up, the input would just be "floating".

Autres conseils

In atmega128, what is the difference between assigning internal pull-ups and not assigning pull-up when port is used as input ? I don't see the point of assigning pull-up when using port as input.

If there is a component connected to the input that is always actively driving the line to either low or high, you won't require a pull-up/down. You use pull-up/down resistors to ensure a well-defined logical level under all conditions.

The simplest example is an unconnected input pin of a micro controller. It would be "floating" without a pull-up/down weakly driving it to a specific level.

Consider this circuit:

enter image description here

Lets assume that C is the input to your micro controller and Vin is controlled by a mechanical switch. If Vin is 0V/open, the transistor is switched off. If you wouldn't use the pull-up resistor Rc (which could be the internal pull-up of your controller), the input C would be floating. Rc also serves a a current limiter when the transistor is switched on.

You need to connect either PullUp or PullDown. So if you are ok with a PullUp, they're already there and you can spare external resistors for that matter. If you need PullDown, you have to connect resistors externally.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top