@Sprinter: Laut Datenblatt (Mega16ist es genau umgekehrt:
[/quote]12.2.1
If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin.
...
12.2.4 Reading the pin value
Independent of the setting of the Data Direction bit DDxn, the port pin can be readt through the PINxn Register bit. ...
Lesezeichen