you have to make the port an input:
So If I connect 5v to pin 22 I would be able to do avalue = PORTAand value should now be 1?even though PORTA is not set as an input?
PORTB = PINA;
value = PORTAand value should now be 1?/quote]As Nick mentions, you need to read PINSA and not PORTA. Keep in mind that if the pins are floating you'll be reading random values on the unconnected pins.