hi all
I want to ask a question.
the Pull up resistance must be activated wahen i use the port as input or as output in the AVR mc???
I know that this is a stupide question but really i want to understand it, pls help
As soon as you declare a pin as output the pullup is switched OFF..
If you want a pin not to interfere with any other pins connected to the same wire you also switch the pullup of - High-Z ..
In normal situation when a pin is defined as INPUT you will need the pullup to be active as there is nothing to define a "1" on this pin ..
If you are using input as a digital one and you are driving input with the open collector(swithing to ground) you can use internal pull up instead of mounting the external one.
Greetings
Dragan
If u wan to have a more accurate input, use external pull-up resistor.
Or else, u can also set it as "1" in ur program. Then the push button is connected to Gnd. When it detects smaller than 1, then proceed with wat u wan.