I have an atmega 16 with 8 inputs on PORTB. On all 8 pins, I have the input tied to ground through a 10k resistor. And I have a switch tied from 5V to each pin. So if the switch is closed, the pin sees 5V. If the switch is open, the pin is wired to ground through a 5V resistor.
On pins 0 through 6, this works fine. On pin 7 it won't work. On that pin I have to short the pin directly to ground in order to make it change state. The pin seems to float high, and tying it to gnd through the 10k resistor is not enough to drive it low.
The port is configured as PORTB=0x00 and DDRB=0x00.
Can someone explain why the difference in pin behavior? And how to fix it?